{"record":{"id":"01440ab3f30367dd","repo":"risingwavelabs/risingwave","slug":"not-root","errorCode":null,"errorMessage":"not root","messagePattern":"not root","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"src/jni_core/src/jvm_runtime.rs","lineNumber":45,"sourceCode":"\nuse crate::opendal_schema_history::*;\nuse crate::{call_method, call_static_method};\n\n/// Use 10% of compute total memory by default. Compute node uses 0.7 * system memory by default.\nconst DEFAULT_MEMORY_PROPORTION: f64 = 0.07;\n\nfn locate_libs_path() -> anyhow::Result<PathBuf> {\n    let libs_path = if let Ok(libs_path) = std::env::var(\"CONNECTOR_LIBS_PATH\") {\n        PathBuf::from(libs_path)\n    } else {\n        tracing::info!(\n            \"environment variable CONNECTOR_LIBS_PATH is not specified, use default path `./libs` instead\"\n        );\n        std::env::current_exe()\n            .and_then(|p| p.fs_err_canonicalize()) // resolve symlink of the current executable\n            .context(\"unable to get path of the executable\")?\n            .parent()\n            .expect(\"not root\")\n            .join(\"libs\")\n    };\n    Ok(libs_path)\n}\n\nfn build_jvm_with_native_registration() -> anyhow::Result<JavaVM> {\n    let libs_path = locate_libs_path().context(\"failed to locate connector libs\")?;\n    tracing::info!(path = %libs_path.display(), \"located connector libs\");\n\n    let mut class_vec = vec![];\n\n    let entries = fs::read_dir(&libs_path).context(if cfg!(debug_assertions) {\n        \"failed to read connector libs; \\\n        for RiseDev users, please check if ENABLE_BUILD_RW_CONNECTOR is set with `risedev configure`\"\n    } else {\n        \"failed to read connector libs, \\\n        please check if env var CONNECTOR_LIBS_PATH is correctly configured\"\n    })?;","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/jni_core/src/jvm_runtime.rs#L27-L63","documentation":"locate_libs_path derives the JVM `libs` directory relative to the current executable path. After canonicalizing the executable path it calls .parent().expect(\"not root\"), so the process panics with `not root` if the executable sits directly in the filesystem root directory — its path has no parent component. This is an internal invariant that should never hold in a normal installation.","triggerScenarios":"Running the RisingWave binary from the filesystem root (e.g. copied to /risingwave or /) so std::env::current_exe().parent() returns None, triggering the expect panic during build_jvm_with_native_registration.","commonSituations":"Container images that place the binary at /, custom deployments relocating the binary, docker ENTRYPOINT copying the binary to root instead of /usr/local/bin.","solutions":["Move the binary into a subdirectory (e.g. /opt/risingwave/risingwave) so its path has a parent.","Alternatively set CONNECTOR_LIBS_PATH explicitly to skip executable-relative resolution.","Restore the standard installation layout (binary next to a `libs` directory).","Keep binary and `libs` folder siblings in any custom packaging."],"exampleFix":"// before\nCOPY risingwave /risingwave\n// after\nCOPY risingwave /opt/risingwave/risingwave && COPY libs /opt/risingwave/libs","handlingStrategy":"validation","validationCode":"import os, sys\nexe = os.path.realpath(sys.argv[0])\nparent = os.path.dirname(exe)\nassert parent not in ('/', ''), 'binary must not live at filesystem root; move it or set CONNECTOR_LIBS_PATH'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Install the binary in a dedicated directory (e.g. /opt/risingwave/) with `libs` alongside it.","Set CONNECTOR_LIBS_PATH explicitly in deployment scripts and container images.","Add a preflight check in your launch script that the exe path has a parent directory."],"tags":["jvm","filesystem","panic","deployment"],"backgroundTag":"internal-invariant-violation","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}