-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Missing logs when cloudstack-setup-agent is run with sudo #10703
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thanks for opening your first issue here! Be sure to follow the issue template! |
I think the command should be like |
For the sake of sanity, I re-ran the command as you suggested
This indeed creates the following log:
But there's still no trace of the reason why `route -n|awk '/^0.0.0.0/ {print $2,$8}' failed with a permission error from the cloudstack-setup-agent, whereas running the same from commandline as non root works, even without sudo. So I still think that the raised exception is never written to the logfile. |
the permission error does not raise, right ? anyway, in my opinion, the general way of adding host to cloudstack is
|
Yes, permission error does not raise, unless I "make it raise" by modding the source script. I would love to add the host via the UI, but no: My machine is a fresh AlmaLinux 9.5 with a SCAP profile enabled, so I can understand that the SCAP profile configs may break things, and I am willing to get my hands dirty configuring the right stuff. Other missing logs example:
Looking into that script, I see that every ran command is redirected with |
from my experience, these messages are misleading have you already configured the bridges ? |
Yes, they are configured via NetworkManager, but they have other names (I read that cloudbr0 and cloudbr1 are not mandatory names, so I decided to go with names I can work with)
Btw, running
[EDIT]cloudstack-agent shows that server certificate isn't good, which isn't surprising since I used an internal dns name[/EDIT] |
Go to zone->physical networks, update the kvm network traffic label of the physical networks to br_xxx0 |
I double checked that the labels are set correctly. All the bridges are up and connected to ethernet interfaces.
On the management server,
Of course, keytool is installed.
So running the keystore script looks good. |
@deajan there should be some logs like
|
I did some more tests.
I commented all those out in order for the script run to succed. Perhaps this can be added to the KVM wiki. I didn't expect root to run the command with With those variables setup, adding the host via UI still failed.
Investigating further, I noticed that commented passwords are still used in the regex of the keystore-setup script. This time, I could add my host. I've tested my script for another host. |
@deajan current doc can be found at https://docs.cloudstack.apache.org/en/latest/installguide/hypervisor/kvm.html#install-and-configure-the-agent |
Mind pointing me into the right direction to make the PR ? There are like 2.8k repositories on apache github :) |
check this |
@weizhouapache Thank you :) |
problem
Trying to setup a AlmaLinux 9.5 KVM host with Cloudstack 4.20.
So far, I followed the instructions in the wiki and created a cloudstack user with sudo permissions.
When running
sudo -u cloudstack cloudstack-setup-agent
, it did spit some strange error messageWhen running
route -n|awk '/^0.0.0.0/ {print $2,$8}'
alone it worked well.So I started hacking into the python code, and added a raise statement.
This time, I got the following error message
This allowed me to debug and find out that I had
Defaults noexec
in my/etc/sudoers
file set, even when running sudo I wasn't allowed to run/bin/sh
.The problem here is that running
cloudstack-setup-agent
with sudo doesn't create any error log in/var/log/cloudstack/agent/setup.log
file, even if runningsudo -u cloudstack echo "Test" >> /var/log/cloudstack/agent/setup.log
works.As a side note, the bash class should perhaps send those exception errors to stderr too
versions
The versions of ACS, hypervisors, storage, network etc..
The steps to reproduce the bug
...
What to do about it?
No response
The text was updated successfully, but these errors were encountered: