Open dimakr opened 8 months ago
I think this is an issue specific to docker backend, since this file exist and was created by root already see https://github.com/scylladb/scylla-cluster-tests/commit/565e996bd37f2dc288db4c71c0cef046a38a2664
I think this copy command, can be done with sudo
I think this is an issue specific to docker backend, since this file exist and was created by root already see 565e996
I think this copy command, can be done with sudo
I tried to troubleshoot it further and see that there are 2 options to get rid of permission denied
problem:
sudo chown $USER: /home/$USER/.cassandra/cqlshrc'
somewhere hereBoth options help.
BUT, it turned out that something changes /home/$USER/.cassandra/cqlshrc
again, after certificate installation is finished.
The behavior after applying fix for certificate installation is:
/home/$USER/.cassandra/cqlshrc
file content before certificate installation is
[connection]
hostname = 172.17.0.2
[connection]
factory = cqlshlib.ssl.ssl_transport_factory
[ssl] certfile = /etc/scylla/ssl_conf/client/test.crt validate = false userkey = /etc/scylla/ssl_conf/client/test.key usercert = /etc/scylla/ssl_conf/client/test.crt
3. some time later after the test progresses the content of the file is reverted back to
[connection] hostname = 172.17.0.2
As a result of this described behavior the test is failing with error:
Validation is enabled; SSL transport factory requires a valid certfile to be specified. Please provide path to the certfile in [ssl] section as 'certfile' option in /home/scylla-test/.cassandra/cqlshrc (or use [certfiles] section) or set SSL_CERTFILE environment variable.
I will troubleshoot this more to get to root cause of what is reverting the `/home/$USER/.cassandra/cqlshrc` file to initial state.
But should we do it in another issue, and in the current one take care only of `permission denied` problem? @fruch
this code logic, of overwrite this file, was create for VM, and assume is didn't existed before
and in this case, root have created this file (as part of the Dockerfile), so we need root permission to handle the file, and we need to make sure it's merged, not override, since would break the cqlsh.
and it's need to be persistent somehow, so restarts won't make the SSL configuration go away, and also the key files themselves.
so the solution for this, is a bit more complicated than just permissions
I think that it would need something like creating the file and key, and mounting them into place (into the user directory, and maybe into /root/ as well)
other direction would be todo this configuration before each run_cqlsh call, and not part of setup. but that might be a bit excessive
Issue description
If encryption is enabled in test configuration, any nemesis fails on the step of client certificate installation:
Steps to Reproduce
Expected behavior: client certificate is successfully installed during DB node init and the scenario is started.
Actual behavior: client certificate installation is failed with
cp: cannot create regular file '/home/scylla-test/.cassandra/cqlshrc': Permission denied
error.Impact
The issue prevents from starting a nemesis for scenarios with encryption enabled. Workaround for the issue is to execute test scenarios with encryption disabled.
How frequently does it reproduce?
Always.
Installation details
SCT Version: master Scylla version: 5.4.4 Environment: local tests execution on docker backend.
Logs
SCT log: sct.log