amir20 / dozzle

Realtime log viewer for docker containers.
https://dozzle.dev/
MIT License
5.02k stars 266 forks source link

Auto-connect to hosts at interval #3044

Closed agneevX closed 2 weeks ago

agneevX commented 1 month ago

Hello!

When a Docker host is unavailable at Dozzle startup, Dozzle takes time to become available due to unavailable hosts.

Also, when the host does eventually become available, it no longer shows in Dozzle.

I think Dozzle should start-up with available hosts with a short timeout and check for connectable hosts every x time interval, which could be made configurable.

Thanks!

amir20 commented 1 month ago

This was asked before and discussed in https://github.com/amir20/dozzle/issues/2969

tldr; Dozzle reconnects. However, at startup it does need a successful connection at least once. This works as designed to avoid misconfigurations.

amir20 commented 1 month ago

When a Docker host is unavailable at Dozzle startup, Dozzle takes time to become available due to unavailable hosts

Also can you clarify what you mean by that? If a host is unavailable then Dozzle should show an error immediately.

agneevX commented 4 weeks ago

tldr; Dozzle reconnects.

Hmm okay. I've seen Docker hosts disappear from this list entirely.

Also can you clarify what you mean by that? If a host is unavailable then Dozzle should show an error immediately.

Dozzle does start, but there's a little delay compared to if the host was not added to Dozzle. I'm now aware of the flag that controls this.

amir20 commented 4 weeks ago

Hmm okay. I've seen Docker hosts disappear from this list entirely.

🤔 that seems like a bug. As mentioned in that other bug, it should never disappear. It should look like this when it can't connect.

333313765-607edd4a-adf9-48b0-8b2a-94ad56c983a9

Dozzle does start, but there's a little delay compared to if the host was not added to Dozzle. I'm now aware of the flag that controls this

If you have dozens of remote host then there could be a delay since each host is connecting sequentially and not in parallel.

It is pretty complex to allow Dozzle to start accepting connections before checking the validity of remote hosts. So I don't think I can change the order. But perhaps, there can be some optimization where all hosts are connected in parallel.

However, this should only happen if you have a lot of hosts. For my use cases with <3 hosts it has been a split second for Dozzle to fail.

Share more about your use case. I can test.

agneevX commented 3 weeks ago

So it turns out the Dozzle image was auto-updated sometime in between and a Docker host was not available when it started up:

Screenshot 2024-06-22 at 9 35 49 PM
amir20 commented 3 weeks ago

Ah interesting. I see why that could be confusing now. I didn't think auto updating would break when host is gone.

I think using an agent might fix this.

Could you read my proposal at https://github.com/amir20/dozzle/issues/3052 and provide feedback? I think it would be a while before it's ready but I am looking for feedback.

agneevX commented 2 weeks ago

I'm closing this issue since I'm no longer facing this issue.

Could you read my proposal at https://github.com/amir20/dozzle/issues/3052 and provide feedback?

I don't have experience with k8s, sorry :(

But I don't think removing this functionality is a good idea for users like me.