Cannot create directory ‘/opt/dremio/log’: Permission denied

When launching the Dremio app in kubernetes environment, I get this error message:

mkdir: cannot create directory ‘/opt/dremio/log’: Permission denied
starting dremio
/opt/dremio/bin/dremio: line 126: /opt/dremio/log/server.out: No such file or directory
/opt/dremio/bin/dremio: line 127: /opt/dremio/log/server.out: No such file or directory

on startup, during the launch of kubernetes pod (visible in the stdout of the master/executor containers).
The Dremio daemon process is owned by ‘dremio’ user (from the output of the shell: ps -ef | grep Dremio)

dremio@dremio-executor-0:/opt/dremio$ ps -ef | grep Dremio
dremio       1     0 58 13:55 ?        02:53:17 /usr/local/openjdk-8/bin/java -Djava.util.logging.config.class=org.slf4j.bridge.SLF4JBridgeHandler -Djava.library.path=/opt/dremio/lib -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Ddremio.plugins.path=/opt/dremio/plugins -Xmx4096m -XX:MaxDirectMemorySize=25856m -XX:+PrintClassHistogramAfterFullGC -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/opt/dremio/log -Dio.netty.maxDirectMemory=0 -Dio.netty.tryReflectionSetAccessible=true -DMAPR_IMPALA_RA_THROTTLE -DMAPR_MAX_RA_STREAMS=400 -XX:+UseG1GC -Dzookeeper=zk-hs:2181 -Dservices.coordinator.enabled=false -Dservices.coordinator.master.enabled=false -Dservices.coordinator.master.embedded-zookeeper.enabled=false -Dservices.executor.enabled=true -Dservices.conduit.port=45679 -Dservices.node-tag=default -cp /opt/dremio/conf:/opt/dremio/jars/*:/opt/dremio/jars/ext/*:/opt/dremio/jars/3rdparty/*:/usr/local/openjdk-8/lib/tools.jar com.dremio.dac.daemon.DremioDaemon

In dremio-env side, I configured the DREMIO_LOG_DIR to be at ${DREMIO_HOME}/log (as recommended) and tried also to be at /var/log/dremio but unfortunately, the permission denied error persists.

Any help would be appreciated.
Cheers

@imar

Can you please send us the output of ls -ld /opt/dremio/log and ls -ltrh /opt/dremio?

Hello @balaji.ramaswamy

here is the output of ls -ltrh /opt/dremio :

dremio@dremio-executor-0:/opt/dremio$ ls -ltrh /opt/dremio
total 52K
drwxr-xr-x. 2 root   root   4.0K Sep 10 15:47 licenses
drwxr-xr-x. 2 root   root   4.0K Sep 10 15:47 bin
drwxr-xr-x. 1 root   root   4.0K Sep 10 16:11 plugins
drwxr-xr-x. 3 root   root   4.0K Sep 10 16:11 winutils
drwxr-xr-x. 2 root   root   4.0K Sep 10 16:11 share
drwxr-xr-x. 2 root   root   4.0K Sep 10 16:11 lib
drwxr-xr-x. 5 root   root    12K Sep 10 16:11 jars
drwxrwxrwx. 3 root   root    187 Oct 19 09:29 conf
drwxr-xr-x. 3 root   root   4.0K Oct 19 09:30 cloudcache
drwxrwxrwx. 5 dremio dremio 4.0K Oct 19 09:30 data

But there is no folder /opt/dremio/log, I am receiving a ‘Permission denied’ message when the kubernetes pod starts.

@imar It looks like most of these folders are owned b root. If you type ls -ld /opt/dremio does the output listing show root:root as the ownership, that needs to be dremio:dremio, try this

cd /opt
chown dremio:dremio dremio

ld -ld dremio – should show dremio:dremio

Now try to start the pod

Hi, I have the same issue like him, here’s the result after run chown dremio:dremio dremio

dremio@dremio-executor-0:/opt$ chown dremio:dremio dremio
chown: changing ownership of 'dremio': Operation not permitted

It means we need to be root user ?

@alpha94511 It seems like the folder is owned by someone else so only root can chnge