Bringing together the Apache Cassandra experts from the community and DataStax.

Want to learn? Have a question? Want to share your expertise? You are in the right place!

Not sure where to begin? Getting Started

 

question

santu4bth_192032 avatar image
santu4bth_192032 asked ·

Why am I getting permission errors in the DS201 Academy course VM?

ubuntu@ds201-node1:~$ labwork/config_node

modifying /home/ubuntu/node/resources/cassandra/conf/cassandra.yaml as follows:
num_tokens: 1
listen_addresss: 127.0.0.1
rpc_address: 127.0.0.1
seeds: 127.0.0.1, 127.0.0.2, 127.0.0.3
data_file_directories: /home/ubuntu/node/data/data
commitlog_directory: /home/ubuntu/node/data/commit-log
hints_directory: /home/ubuntu/node/data/hints
saved_caches_directory: /home/ubuntu/node/data/saved-caches
intital_token: 0
cdc_raw_directory: /home/ubuntu/node/data/cdc_raw
native_transport_port: 9042
labwork/config_node: 45: labwork/config_node: cannot create /home/ubuntu/node/resources/cassandra/conf/cassandra.yaml_new: Permission denied
mv: cannot stat '/home/ubuntu/node/resources/cassandra/conf/cassandra.yaml_new': No such file or directory
modifying /home/ubuntu/node/resources/cassandra/conf/cassandra-env.sh as follows:
MAX_HEAP_SIZE="512M"
HEAP_NEWSIZE="128M"
JMX_PORT="7199"
labwork/config_node: 74: labwork/config_node: cannot create /home/ubuntu/node/resources/cassandra/conf/cassandra-env.sh_new: Permission denied
mv: cannot stat '/home/ubuntu/node/resources/cassandra/conf/cassandra-env.sh_new': No such file or directory
ubuntu@ds201-node1:~$ ls -l
total 890360
drwxr-xr-x 5 ubuntu ubuntu 4096 Apr 5 2019 Desktop
-rw-r--r-- 1 ubuntu ubuntu 911703665 Apr 5 2019 dse-6.0.0-bin.tar.gz
drwxrwxrwx 3 ubuntu ubuntu 4096 Jun 14 03:38 labwork
drwxr-xr-x 10 root root 4096 Apr 14 2018 node
drwxr-xr-x 10 ubuntu ubuntu 4096 Apr 14 2018 node1
drwxr-xr-x 3 ubuntu ubuntu 4096 Apr 5 2019 Pictures

Im getting the above errors while trying to run labwork/config_node file .I'm working on DS201 course.Can you please help troubleshoot the issue?

Thanks
Santosh

academyds201
10 |1000 characters needed characters left characters exceeded

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 ·

The issue is that you performed step 3 of exercise 1 as root so the node directory is now owned by root:

drwxr-xr-x 10 root root 4096 Apr 14 2018 node

As a result, the labwork/config_node script no longer has permissions to modify files in the directory.

You need to reset ownership back to the ubuntu user with the following command:

$ sudo chown -R ubuntu:ubuntu node

This will allow you to run the script and continue with the exercise. Cheers!

Share
10 |1000 characters needed characters left characters exceeded

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