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

[agents] Error from the socket server after agent removed #356

Closed
2 tasks done
tippfehlr opened this issue Jan 10, 2024 · 2 comments · Fixed by #617
Closed
2 tasks done

[agents] Error from the socket server after agent removed #356

tippfehlr opened this issue Jan 10, 2024 · 2 comments · Fixed by #617
Labels
bug Something isn't working

Comments

@tippfehlr
Copy link

⚠️ Please verify that this bug has NOT been reported before.

  • I checked and didn't find similar issue

🛡️ Security Policy

Description

I removed an agent, now every ~3 seconds this error is logged:

dockge-dockge-1  | 2024-01-10T11:15:28Z [AGENT-MANAGER] ERROR: Error from the socket server: raspberrypi:5001

the agent management is great, I removed it for other reasons

👟 Reproduction steps

  • add an agent
  • add a stack to the remote agent, I can’t remember if I removed it before removing the agent
  • remove the agent

👀 Expected behavior

The dockge host does not try to connect to the agent anymore.

😓 Actual Behavior

The dockge host (probably) tries to connect to the agent, fails (because it is no longer online) and throws/reports an error.

Dockge Version

1.4.1

💻 Operating System and Arch

Debian/Armbian

🌐 Browser

Firefox 121.0.1

🐋 Docker Version

Docker version 24.0.7, build afdd53b

🟩 NodeJS Version

No response

📝 Relevant log output

…
dockge-dockge-1  | 2024-01-10T11:13:46Z [AGENT-MANAGER] ERROR: Error from the socket server: raspberrypi:5001
dockge-dockge-1  | 2024-01-10T11:13:54Z [AGENT-MANAGER] ERROR: Error from the socket server: raspberrypi:5001
dockge-dockge-1  | 2024-01-10T11:14:02Z [AGENT-MANAGER] ERROR: Error from the socket server: raspberrypi:5001
dockge-dockge-1  | 2024-01-10T11:14:05Z [AGENT-MANAGER] ERROR: Error from the socket server: raspberrypi:5001
dockge-dockge-1  | 2024-01-10T11:14:09Z [AGENT-MANAGER] ERROR: Error from the socket server: raspberrypi:5001
dockge-dockge-1  | 2024-01-10T11:14:17Z [AGENT-MANAGER] ERROR: Error from the socket server: raspberrypi:5001
dockge-dockge-1  | 2024-01-10T11:14:25Z [AGENT-MANAGER] ERROR: Error from the socket server: raspberrypi:5001
dockge-dockge-1  | 2024-01-10T11:14:28Z [AGENT-MANAGER] ERROR: Error from the socket server: raspberrypi:5001
dockge-dockge-1  | 2024-01-10T11:14:31Z [AGENT-MANAGER] ERROR: Error from the socket server: raspberrypi:5001
dockge-dockge-1  | 2024-01-10T11:14:34Z [AGENT-MANAGER] ERROR: Error from the socket server: raspberrypi:5001
dockge-dockge-1  | 2024-01-10T11:14:37Z [AGENT-MANAGER] ERROR: Error from the socket server: raspberrypi:5001
dockge-dockge-1  | 2024-01-10T11:14:45Z [AGENT-MANAGER] ERROR: Error from the socket server: raspberrypi:5001
dockge-dockge-1  | 2024-01-10T11:14:48Z [AGENT-MANAGER] ERROR: Error from the socket server: raspberrypi:5001
dockge-dockge-1  | 2024-01-10T11:14:56Z [AGENT-MANAGER] ERROR: Error from the socket server: raspberrypi:5001
dockge-dockge-1  | 2024-01-10T11:15:04Z [AGENT-MANAGER] ERROR: Error from the socket server: raspberrypi:5001
dockge-dockge-1  | 2024-01-10T11:15:08Z [AGENT-MANAGER] ERROR: Error from the socket server: raspberrypi:5001
dockge-dockge-1  | 2024-01-10T11:15:11Z [AGENT-MANAGER] ERROR: Error from the socket server: raspberrypi:5001
dockge-dockge-1  | 2024-01-10T11:15:17Z [AGENT-MANAGER] ERROR: Error from the socket server: raspberrypi:5001
dockge-dockge-1  | 2024-01-10T11:15:20Z [AGENT-MANAGER] ERROR: Error from the socket server: raspberrypi:5001
dockge-dockge-1  | 2024-01-10T11:15:28Z [AGENT-MANAGER] ERROR: Error from the socket server: raspberrypi:5001
dockge-dockge-1  | 2024-01-10T11:15:36Z [AGENT-MANAGER] ERROR: Error from the socket server: raspberrypi:5001
dockge-dockge-1  | 2024-01-10T11:15:44Z [AGENT-MANAGER] ERROR: Error from the socket server: raspberrypi:5001
dockge-dockge-1  | 2024-01-10T11:15:52Z [AGENT-MANAGER] ERROR: Error from the socket server: raspberrypi:5001
…
@tippfehlr tippfehlr added the bug Something isn't working label Jan 10, 2024
@DomiiBunn
Copy link
Contributor

It actually keeps on attempting to connect to deleted agents.

I'm looking at the code now and might find a fix

DomiiBunn added a commit to DomiiBunn/dockge that referenced this issue Sep 24, 2024
@DomiiBunn DomiiBunn mentioned this issue Sep 24, 2024
6 tasks
DomiiBunn added a commit to DomiiBunn/dockge that referenced this issue Sep 24, 2024
@DomiiBunn DomiiBunn mentioned this issue Sep 24, 2024
6 tasks
@DomiiBunn
Copy link
Contributor

Replication

Add a new agent,
Bring the agent offline
Delete the agent

Agent is removed from the db however it is kept as a connection state in socket.io

Solution. Call socket.disconnect before deleting the agent.

A temporary solution. Restart the dockge docker container by hand. It will no longer have the connection in memory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants