Skip to content
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

Bluechi daemon fails when run in a rootless container with --network=host #564

Open
rhatdan opened this issue Sep 13, 2023 · 6 comments
Open
Assignees
Labels
backlog This is next up in priority bug Something isn't working

Comments

@rhatdan
Copy link
Contributor

rhatdan commented Sep 13, 2023

Describe the bug

Please enter a clear and concise description of what the bug is.

To Reproduce

Please provide the steps to reproduce the issue.

$ podman run --device /dev/fuse --replace --cap-add=all --network=host --name autosd --security-opt label=disable -d quay.io/centos-sig-automotive/autosd:latest
$ podman exec -ti autosd systemctl status bluchi

If I remove --network=host bluechi works, so I believe is is attempting to do something that is not allowed by default unless you setup a different network. Issue is I could not find where bluechi printed an error message telling me why it fails.

Expected behavior

Please describe what you would expect to happen.

Expected Bluchi to work with --network=host.

@rhatdan rhatdan added the bug Something isn't working label Sep 13, 2023
@engelmi
Copy link
Member

engelmi commented Sep 14, 2023

The default logging sink should be journald. Could you post the logs returned by podman exec -it autosd journalctl -u bluechi and podman exec -it autosd journalctl -u bluechi-agent? @rhatdan

@ygalblum
Copy link
Contributor

ygalblum commented Oct 9, 2023

@rhatdan

The issue is with the Bluechi controller default port. By default, the controller port is 842. When running as rootless with network=host this translates to a non-root application trying to open a privileged (<1024) port.
I was able to start the controller after changing the port in the configuration file. I used 8420, but I guess any number above 1024 will work.

In addition, please note that there is an typo in the 00-default.conf file in the image in which managerPort is set instead of ManagerPort.

If we do intend to run such a configuration (that is rootless on the host network), maybe we should rethink the default port.

@rhatdan
Copy link
Contributor Author

rhatdan commented Oct 9, 2023

SGTM and good find.
@engelmi @dougsland @Yarboa Thoughts?

@dougsland
Copy link
Contributor

SGTM and good find. @engelmi @dougsland @Yarboa Thoughts?

Make sense @ygalblum explanation. If bluechi is not changing the default port, we must document this in bluechi docs session adding @engelmi in the loop.

@engelmi
Copy link
Member

engelmi commented Oct 10, 2023

Nice catch! @ygalblum
As far as I can remember having a default port < 1024 was a security concern - so that you have to explicitly either open the port or configure a different one to be used. I am not sure if we should still stick to this considering the rootless use case. I think that just adding a config file is simple enough to keep it. Yet it's still a way to cause a setup error.
What do you think? @rhatdan @dougsland @ygalblum

@ygalblum
Copy link
Contributor

I don't know. Maybe we can also ask should we allow running this container rootless with network=host. For example, some web server containers will also fail to start with this configuration as they try to open ports 80 or 443.

@mkemel mkemel added this to the v0.7 milestone Nov 21, 2023
@mkemel mkemel added jira Issues that are synced to Jira backlog This is next up in priority and removed jira Issues that are synced to Jira labels Nov 21, 2023
@mkemel mkemel removed this from the v0.7 milestone Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog This is next up in priority bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants