question

sunandosamaddar avatar image
sunandosamaddar asked Erick Ramirez edited

Cannot start DSE instance for DS201 Academy course, getting multiple FileNotFoundException and "Permission denied" errors

sunando ~/node/bin$ ./dse cassandra
sunando ~/node/bin$ OpenJDK 64-Bit Server VM warning: Cannot open file /var/log/cassandra/gc.log due to Permission denied

...
16:33:09,634 |-ERROR in ch.qos.logback.core.rolling.RollingFileAppender[SYSTEMLOG] - openFile(/var/log/cassandra/system.log,true) call failed. java.io.FileNotFoundException: /var/log/cassandra/system.log (Permission denied)
        at java.io.FileNotFoundException: /var/log/cassandra/system.log (Permission denied)
        at      at java.io.FileOutputStream.open0(Native Method)
        at      at java.io.FileOutputStream.open(FileOutputStream.java:270)
        at      at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
        at      at ch.qos.logback.core.recovery.ResilientFileOutputStream.<init>(ResilientFileOutputStream.java:26)
        ...
16:33:09,635 |-ERROR in ch.qos.logback.core.rolling.RollingFileAppender[DEBUGLOG] - openFile(/var/log/cassandra/debug.log,true) call failed. java.io.FileNotFoundException: /var/log/cassandra/debug.log (Permission denied)
        at java.io.FileNotFoundException: /var/log/cassandra/debug.log (Permission denied)
        at      at java.io.FileOutputStream.open0(Native Method)
        at      at java.io.FileOutputStream.open(FileOutputStream.java:270)
        at      at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
        ...
16:33:09,835 |-ERROR in ch.qos.logback.core.rolling.RollingFileAppender[GremlinServerFileAppender] - openFile(/var/log/cassandra/gremlin.log,true) call failed. java.io.FileNotFoundException: /var/log/cassandra/gremlin.log (Permission denied)
        at java.io.FileNotFoundException: /var/log/cassandra/gremlin.log (Permission denied)
        ...
16:33:09,837 |-ERROR in ch.qos.logback.core.rolling.RollingFileAppender[SLF4JAuditWriterAppender] - Failed to create parent directories for [/var/log/cassandra/audit/audit.log]
16:33:09,837 |-ERROR in ch.qos.logback.core.rolling.RollingFileAppender[SLF4JAuditWriterAppender] - openFile(/var/log/cassandra/audit/audit.log,true) call failed. java.io.FileNotFoundException: /var/log/cassandra/audit/audit.log (No such file or directory)
        at java.io.FileNotFoundException: /var/log/cassandra/audit/audit.log (No such file or directory)
        ...
16:33:09,839 |-ERROR in ch.qos.logback.core.rolling.RollingFileAppender[DroppedAuditEventAppender] - Failed to create parent directories for [/var/log/cassandra/audit/dropped-events.log]
16:33:09,839 |-ERROR in ch.qos.logback.core.rolling.RollingFileAppender[DroppedAuditEventAppender] - openFile(/var/log/cassandra/audit/dropped-events.log,true) call failed. java.io.FileNotFoundException: /var/log/cassandra/audit/dropped-events.log (No such file or directory)
        at java.io.FileNotFoundException: /var/log/cassandra/audit/dropped-events.log (No such file or directory)
        ...

INFO  [main] 2022-01-26 16:33:09,861  DseModule.java:101 - Loading DSE module
...
INFO: An exception was caught and reported. Message: org.apache.cassandra.exceptions.ConfigurationException: metadata directory '/var/lib/cassandra/metadata' or, if it does not already exist, an existing parent directory of it, is not readable and writable for the DSE. Check file system and configuration.
org.apache.cassandra.exceptions.ConfigurationException: metadata directory '/var/lib/cassandra/metadata' or, if it does not already exist, an existing parent directory of it, is not readable and writable for the DSE. Check file system and configuration.
        at org.apache.cassandra.config.DatabaseDescriptor.resolveAndCheckDirectory(DatabaseDescriptor.java:1271)
        ...

ERROR [main] 2022-01-26 16:33:10,602  DseModule.java:108 - Exiting...
com.google.inject.CreationException: Unable to create injector, see the following errors:

1) An exception was caught and reported. Message: metadata directory '/var/lib/cassandra/metadata' or, if it does not already exist, an existing parent directory of it, is not readable and writable for the DSE. Check file system and configuration.
        at com.datastax.bdp.DseModule.configure(Unknown Source)
        ...
Caused by: org.apache.cassandra.exceptions.ConfigurationException: metadata directory '/var/lib/cassandra/metadata' or, if it does not already exist, an existing parent directory of it, is not readable and writable for the DSE. Check file system and configuration.
        at org.apache.cassandra.config.DatabaseDescriptor.resolveAndCheckDirectory(DatabaseDescriptor.java:1271)
        ...

sunando ~/node/bin$ ./dsetool status
Connection refused to host: 127.0.0.1; nested exception is:
        java.net.ConnectException: Connection refused (Connection refused)

Hi, I'm just getting started with Cassandra foundations, and this is what I'm experiencing while following the setup instructions in DS201 with dse-6.8.19 in WSL2. My distro has the following prequisites besides having Python 3.8.10.

sunando ~/node/bin$ java -version
openjdk version "1.8.0_312"
OpenJDK Runtime Environment (build 1.8.0_312-8u312-b07-0ubuntu1~20.04-b07)
OpenJDK 64-Bit Server VM (build 25.312-b07, mixed mode)
sunando ~/node/bin$ python -V
Python 2.7.18
ds201
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

Erick Ramirez avatar image
Erick Ramirez answered

As these errors suggest:

ERROR in ch.qos.logback.core.rolling.RollingFileAppender[SYSTEMLOG] - openFile(/var/log/cassandra/system.log,true) call failed. java.io.FileNotFoundException: /var/log/cassandra/system.log (Permission denied)
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[DEBUGLOG] - openFile(/var/log/cassandra/debug.log,true) call failed. java.io.FileNotFoundException: /var/log/cassandra/debug.log (Permission denied)
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[GremlinServerFileAppender] - openFile(/var/log/cassandra/gremlin.log,true) call failed. java.io.FileNotFoundException: /var/log/cassandra/gremlin.log (Permission denied)
An exception was caught and reported. Message: metadata directory '/var/lib/cassandra/metadata' or, if it does not already exist, an existing parent directory of it, is not readable and writable for the DSE. Check file system and configuration.

The DSE process does not have permissions to access /var/log/cassandra and /var/lib/cassandra.

You need to make sure that the DSE process has both read and write access to the subdirectories and parent directories. If you've created the filesystems as root, you will need to reset ownership to the DSE user. Cheers!

Share
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.