-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
Trying to setup docker container and faced with the error #87
Comments
Seems I can't run headless at this server too:
I expected this, and at the same time I thought that I would not have any problems with the container. |
Another instance with fresh debian bookworm, the situation with registration the next:
What am I doing wrong? |
Hey @SAOPP thanks for trying out Go Hass Agent! Those are some funky errors. Running the agent in a container is a bit rough at the moment. I can see the cause of the nil pointer crash in #87 (comment). It's due to the way I was building inside the image including an empty The other error in #87 (comment) is a bit trickier. I'll have to bring up a VM to do some testing and see if I can reproduce and to be able to debug it. That might take some time. Are you able to run the agent directly, not within a container, on your server? |
Welp, I think I've fixed the issues with the container build... Can you try with version ed4d3bef0275f78d96376d96e083c7260c82ac2c that is up on the ghcr.io repo? The following commands for registering and running work for me on a Ubuntu 20.04 VM in VirtualBox: Register: docker run --rm --hostname go-hass-agent-container \
--network host \
--volume go-hass-agent:/home/gouser \
ghcr.io/joshuar/go-hass-agent:ed4d3bef0275f78d96376d96e083c7260c82ac2c --debug register \
--server someserver \
--token sometoken Run: docker run --security-opt apparmor:unconfined --hostname go-hass-agent-container --name my-go-hass-agent \
--network host \
--volume go-hass-agent:/home/gouser \
--volume /proc:/host/proc:ro --volume /sys:/host/sys:ro \
--volume /var/run/dbus/system_bus_socket:/var/run/dbus/system_bus_socket:ro \
--volume /run/user/1000/bus:/run/user/1000/bus:ro \
ghcr.io/joshuar/go-hass-agent:ed4d3bef0275f78d96376d96e083c7260c82ac2c --debug Note I'm using a Docker volume rather than a bind mount for the agent config. To use a bind mount might require additional options and/or configuration on the host. Unfortunately, while I've passed in the D-Bus volumes, sensors based on D-Bus don't work in the container. I am still trying to understand how to get D-Bus working inside a container. If you have any ideas, please let me know! |
Hi! Thanks for the reply.
Yes, I'm has mention 'bout this already ova here: #87 (comment) I will try what are u propose above, and give some feedback of da result soon. Thanks. |
So, this the first try:
Next I had tried start my container in privileged mode:
And I see my server in integration: Now I’ll try to run the container, and most likely also in privileged mode... |
And here is my stack:
All done! Thanks homie! 👍 |
Oh nice! That is awesome that you got it working! I'll have to look into some of the additional steps you did, that's different than what I needed. I'm also using Podman, so might be some Docker <-> Podman differences. I think I'll close this issue for now though as it is working for you. I'll keep working away at improving the container support. If you still are having issues, feel free to re-open this issue. Thanks again for trying out the agent! |
@joshuar Hi! 😄 I noticed today that the agent was stopped, I tried to start it and got an error, I didn't look into it much... I updated the agent and saw the following in the log: Okay, let's re-created token and register again... But this is what I get when I try to register an agent on my instance:
|
Oh dear, I imagine this will partly be due to e93f733, where I've migrated the command-line parsing to a different package. For now, I'd recommand sticking to the images tagged with a version rather than docker run --rm --privileged --network host --volume /docker/homeassistant-agent:/home/gouser ghcr.io/joshuar/go-hass-agent:v9.0.0 register --server http://localhost:8123 --token TOKEN This is still a bug that will likely affect future versions, so thanks for reporting. I will look into fixing it! |
Yep! It's works. |
Great! Thanks for circling back, I'll close this off for now. |
Hello!
This situation is present with first step of registration of agent and the next with the container also.
Ubuntu Focal server and Docker version 20.10.9, build c2ea9bc.
Registration step:
docker run --rm --network host --volume /home/docker_storage/homeassistant-agent:/home/gouser ghcr.io/joshuar/go-hass-agent register --server http://homeassistant:8123 --token mytoken
Compose:
The text was updated successfully, but these errors were encountered: