Comments (10)
I think the current solution is good and doesn't need to be changed. Because sometimes I only care about the logs of other connected Hosts
Based on this, it sounds like I should NOT wait for all to connect. So perhaps trying to reconnect when UI updates is the best option.
I hope the REMOTE_HOST can always fix on the left host list and show the connection status of the host. (It can change in time when the host disconnect after some time)
I feel like this wouldn't be a great experience. If the connection can be fixed, then it should just be fixed. No reason to bother with UI icons.
There is a lot of async code happening here so I have to be careful. I'll see what I can do in the future.
from dozzle.
This sounds like a bug that should be fixed. And I agree it can be improved. I don't use REMOTE_HOST
a lot personally which is why I never noticed it.
I am wondering if Dozzle should auto reconnect automatically or try only when the UI is refreshed. I think both are great options with different tradeoffs.
While reading the code, I did notice that if the events API throws an exception then I log
log.Fatalf("error while listening to docker events: %v. Exiting...", err)
So question, when remote connection exits, do you see this error? The part I don't understand is that this is a fatal log which should cause Dozzle to restart. That was my original goal to not reconnect and instead just exit the program so it would reconnect.
It sounds like you are not getting that error which might mean something else is happening.
If you don't see that error, do you know what is causing the host to disconnect?
from dozzle.
I just tested it locally and I do see error while listening to docker events: unexpected EOF. Exiting...
so let me know what error, if any, you see...
from dozzle.
Are you using --restart unless-stopped
?
from dozzle.
i can see these but not found Exiting...
here is my config
version: "3"
services:
dozzle_test:
container_name: dozzle_test
restart: always
image: amir20/dozzle:latest
volumes:
- /var/run/docker.sock:/var/run/docker.sock
extra_hosts:
- 'host.docker.internal:host-gateway'
ports:
- 9999:8080
environment:
- DOZZLE_REMOTE_HOST=tcp://host.docker.internal:2377|TEST_HOST
dockerproxy:
container_name: dockerproxy
image: tecnativa/docker-socket-proxy
volumes:
- /var/run/docker.sock:/var/run/docker.sock
ports:
- 2377:2375
environment:
- CONTAINERS=1
from dozzle.
In my actual situation, my REMOTE_HOST will lose connection for a while before reconnecting (sometimes caused by machine restart), maybe a few minutes or more.
So sometimes restarting Dozzle still cannot connect to REMOTE_HOST immediately.
I think it would be good to have both automatic and manual ways
Dozzle auto reconnect automatically at backend
every minute (or a suitable time interval)
and try to reconnect when the UI is refreshed
(or provide a connect button)
from dozzle.
I think I have an idea what's happening. This is a guess though:
- Dozzle gets started with 2 connections successfully, but at some point the remote connection fails
- Dozzle restarts, so the remote connection is still not working and it only connects to 1 connection
- Since one connection still exists, Dozzle is up and running and you don't see the remote connection. This also matches the errors you showed me.
This only happens if you have restart: always
.
So I have a solution in mind but it might not be the best.
Right now, Dozzle doesn't fail if at least one connection succeeds. If I was to fail and not start Dozzle if any of the remote connections fails, then it would retry until all of them are working.
What do you think about this solution? When I think about it, it might make more sense to fail because one should know if one of the connections doesn't work. It also happens to work out well with restart: always
because Docker will automatically restart Dozzle until all connections works. That way I don't have to retry. The bad part to this solution would be if any connections fails the Dozzle wouldn't be useful at all.
The other solution would be reconnect when the UI is triggered. This adds a lot of complexity though because now I have to asynchronously check if all clients are valid and potentially introducing a lot of race conditions.
I think it's a rare for Docker hosts to restart so perhaps restarting Dozzle and having it reconnect would be the easiest. In fact, a one line change.
from dozzle.
Yes, I think your guess is right. In fact, I always keep at least one connection that is localhost and it's always work fine.
Dozzle doesn't fail if at least one connection succeeds
I think the current solution is good and doesn't need to be changed. Because sometimes I only care about the logs of other connected Hosts.
I agree with restart the Dozzle container to reconnect to Remote Host.
In fact, that's what I did. restart the dozzle container in the UI by setting DOZZLE_ENABLE_ACTIONS
I deploy multiple dozzle container and they have their own REMOTE_HOST, and when a remote host lose connection I often forget if it's in the REMOTE_HOST or not
I hope the REMOTE_HOST can always fix on the left host list and show the connection status of the host. (It can change in time when the host disconnect after some time)
And I can know which host lost connection and try to reconnect it.
from dozzle.
I spent some time on this. It turns out to be very complicated. When the client is connected, the UI loads assuming it has everything it needs and flushes all data to UI. But when the client is disconnected, the UI will load without any data because it loads asynchronously. But then the client my fail, which is not handled correctly. If the client succeeds then its get even more complicated because the data needs to be streamed to the UI.
I am not sure if I have a good solution for this. I may have to rethink a lot here.
from dozzle.
@azhezzzz can you try amir20/dozzle:pr-2876
I think I have a fix. I tried to keep it simple. The only caveat is that all hosts do need to connect initially. After that, if a host fails, Dozzle will not exit, instead retry on every UI refresh.
from dozzle.
Related Issues (20)
- Concatenated logs HOT 7
- Logs stopping at a certain point HOT 3
- It's displaying logs from another container HOT 4
- 🙋🏻Feedback needed: Docker Swarm support HOT 12
- Running stacks in sidebar or filter by Stack HOT 44
- Is the color of the log text incorrect? HOT 1
- Password only provider for authentication HOT 1
- Default background color for ANSI logs is black instead of default HOT 4
- Dozzle (internal) time / TZ environment option HOT 4
- I don't want to track all docker container logs. HOT 3
- v 6.4.3 breaks container actions HOT 4
- Dozzle Config screen and Container Summary missing from Safari but present in Chrome HOT 8
- 🙋🏻 Traefik 2.11 breaks Dozzle (fixed) HOT 15
- Constant blinking/reload of logs in the latest dozzle HOT 3
- Can't scroll up in side-by-side view HOT 2
- DOZZLE_TAILSIZE alternative HOT 1
- Problem identifying "Fail" HOT 4
- feat: support copy permanent link URL to clipboard HOT 7
- Podman Socket Connection Issue HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dozzle.