Closed asias closed 2 days ago
I think it is related to monitor. Monitor is not supported in the docker backend. It tries to do something on host that is the reason it asks for password. After I disable monitor, no password is asked for.
Seems like the test here was trying to perform the action - scylla-manager server installation - that is not yet supported on the docker backend. Raised an issue / feature request for that - https://github.com/scylladb/scylla-cluster-tests/issues/9323.
For now we disable scylla-manager usage when running tests on docker backend, by adding use_mgmt: false
to a test config, or setting SCT_USE_MGMT=false
env var.
But this still don't justify the original problem of asking password when executing command with sudo. For instance in my system, even when running the test without manager disabled, I'm failing on a code
if self.is_docker():
self.remoter.sudo(
"yum remove -y scylla scylla-jmx scylla-tools scylla-tools-core scylla-server scylla-conf")
with the error:
< t:2024-11-21 11:39:24,751 f:tester.py l:196 c:sdcm.tester p:ERROR > Command: 'sudo yum remove -y scylla scylla-jmx scylla-tools scylla-tools-core scylla-server scylla-conf' │
...
< t:2024-11-21 11:39:24,751 f:tester.py l:196 c:sdcm.tester p:ERROR > Stderr: │
< t:2024-11-21 11:39:24,751 f:tester.py l:196 c:sdcm.tester p:ERROR > │
< t:2024-11-21 11:39:24,751 f:tester.py l:196 c:sdcm.tester p:ERROR > sudo: yum: command not found
I.e. it was ok with the sudo..
But this still don't justify the original problem of asking password when executing command with sudo. For instance in my system, even when running the test without manager disabled, I'm failing on a code
if self.is_docker(): self.remoter.sudo( "yum remove -y scylla scylla-jmx scylla-tools scylla-tools-core scylla-server scylla-conf")
So the reason of asking sudo password in the place above is simply due to the fact that self.remoter
is the host machine here (as for docker backend the monitoring stack is installed into host machine, not on a dedicated docker instance).
self
Out[2]: <sdcm.cluster_docker.DockerMonitoringNode at 0x7f42b9759600>
self.remoter
Out[3]: <sdcm.remote.local_cmd_runner.LocalCmdRunner at 0x7f42c9cd6d40>
...
self.remoter.run('hostname').stdout
Out[6]: 'dmitriy-d3581\n'
So depending on whether passwordless sudo is configured on a dev machine or not, the password can be asked or not.
We probably need to add a check, so that we fail fast if docker backend is used and use_mgmt
/SCT_USE_MGMT
config parameter is not set to false.
It is under docker images. The sudo password should not be needed.