Full ERROR Message Example
ERROR main 2020-10-19 18:43:25,397 Directories.java:132 - Doesn't have write permissions for /var/lib/cassandra/data directory
What does this error mean?
This error means the cassandra user does not have the correct OS permissions to write to the data directory location specified in the cassandra.yaml file.
Why does this error occur?
As the error suggests, the permissions for the specific directory are not set for the user to be able to write. Sometimes this error occurs because you have used a package install of Cassandra, but are not starting as a service. This leads to a mismatch in permissions
How do you fix this error?
Check the permissions for the directory specified by the data_file_directories parameter in the cassandra.yaml file. Your settings should look similar to the following:
$ ls -l /var/lib/cassandra/
total 16
drwxr-xr-x 2 cassandra cassandra 4096 Oct 19 18:43 commitlog
drwxr-xr-x 7 cassandra cassandra 4096 Oct 19 18:43 data
drwxr-xr-x 2 cassandra cassandra 4096 Oct 19 18:42 hints
drwxr-xr-x 2 cassandra cassandra 4096 Oct 19 18:42 saved_caches
If the permissions are correct, double check that the user running Cassandra matches the user and group that the directory permissions are set to. The ps tool can help you find this quickly and easily
$ ps auwx | grep cassandra | awk '{print $1}'
automat+
If the users do not match, adjust the user that you are using to start Cassandra.