Configure temporary file path
Function workers use java.io.tmpdir in the JVM as the default temporary file path, which is also used as the default extraction file path for each NAR package. NAR packages require a local file path to extract and load to the Java class loader.
On VM or bare-metal installations, OS cleanup of /tmp can delete extracted files while the functions worker is running, which causes ClassNotFoundException or NoClassDefFoundError errors. Use a dedicated directory instead. See Configure the NAR extraction directory.
If you want to change the default extraction file path for NAR packages to another directory, you can add the following parameter with the desired directory in the functions_worker.yml file. The configuration varies depending on the function runtime you are using.
| Function runtime | Configuration for temporary file path |
|---|---|
| Thread runtime Process runtime | narExtractionDirectory |
| Kubernetes runtime | functionRuntimeFactoryConfigs.narExtractionDirectory |