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
Agent wont start after update "Unable to retrieve local agent IP address" #203
Comments
I had the same problem around 3 months. |
I guess you still have the issue now or did you solve it somehow ? |
I still have this issue, I just recreate it every time |
Maybe set the watchtower to monitor only mode for the portainer-agent container. Add the label |
I found the problem is about the watchtower, it clones the container configs included hostname when upgrading the container. When upgrade/re-create the container, by default the docker daemon will assign a new hostname to the container and update internal dns, but the watchtower won't update the container hostname after the container upgrade so the agent will try to look up the old hostname and it would be getting nxdomain result by docker internal dns. Line 6 in b39a072
|
I try to add the My config:
|
Thanks for sharing. I added
to my compose file, lets see if this works with the next update. |
i can confirm that setting the hostname and the container_name fixed the issue for me. Portainer agent is now updating fine with watchtower. |
Was able to fix this from Portainer by just stopping continer > Duplicate / Edit > scroll down to advanced container settings > Network > make hostname field match container name > Deploy Container |
Hello,
i use watchtower to update my containers but the Portainer agent keeps to have issues when updated.
Whenever watchtower updates the container, it keeps restarting with the following error message:
agent_1 | 2021/08/05 12:22:25 [ERROR] [main,docker] [message: Unable to retrieve local agent IP address] [error: Error: No such container: 6c9fd4504fb5]
And i use the following compose file:
I can fix it by manually running docker-compose down and than up again but this defeats the whole purpose of the automatic updates.
Regards
The text was updated successfully, but these errors were encountered: