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

[Bug]: Terminal session is not stopped when container stop #3519

Open
Vahor opened this issue Sep 20, 2024 · 2 comments · Fixed by #3559
Open

[Bug]: Terminal session is not stopped when container stop #3519

Vahor opened this issue Sep 20, 2024 · 2 comments · Fixed by #3559
Labels
🐛 Bug Reported issues that need to be reproduced by the team. 🐞 Confirmed Bug Verified issues that have been reproduced by the team.

Comments

@Vahor
Copy link
Contributor

Vahor commented Sep 20, 2024

Error Message and Logs

Container terminal session is not stopped when container stop. Resulting in server access.

Steps to Reproduce

  1. Create an app using coolify like nginx:latest
  2. Start the app
  3. Connect to the terminal using the Terminal tab of the app
  4. Check hostname, we are inside the container
    image
  5. Stop the app (using the stop button, and stay on the terminal page)
    image
    we have a ssh terminal outside of the container

Example Repository URL

No response

Coolify Version

v4.0.0-beta.341

Are you using Coolify Cloud?

No (self-hosted)

Operating System and Version (self-hosted)

Ubuntu 24.04.1 LTS

Additional Information

Not that huge of an issue as currently there's no permission to restrict access on the terminal. But in the future this could become a problem.

@Vahor Vahor added 🐛 Bug Reported issues that need to be reproduced by the team. 🔍 Triage Issues that need assessment and prioritization. labels Sep 20, 2024
@andrasbacsai
Copy link
Member

This will be fixed in the upcoming version.

@peaklabs-dev peaklabs-dev added this to the v4.0.0 Stable Release milestone Sep 25, 2024
@peaklabs-dev peaklabs-dev added 🐞 Confirmed Bug Verified issues that have been reproduced by the team. and removed 🔍 Triage Issues that need assessment and prioritization. labels Sep 25, 2024
@LEstradioto
Copy link
Contributor

LEstradioto commented Sep 25, 2024

Actually, this is a complex topic. Some info here:

  • Terminal is a nested ssh, first connect to main coolify container (PARENT PROCESS), then inside this process we run another ssh aiming to the selected container/server (CHILD PROCESS)
  • when any process is killed or crash unexpectedly (SIGKILL), as in OP case, PARENT cant listen to this signal, so, its normal to terminal turns back to PARENT, but here we have an added complexity, because, cant catch any signals, because it is nested processes
  • we are solving this listening on frontend if user types exit or CTRL+D, then we kill PARENT. This solves a problem but add another, like, if user types exit no matter where, like, inside vi editor, then we are killing PARENT too... not nice

  • I think Andras will fix with a remotely reload the page if child container changes its status, is that right? I tried branch next and I couldnt reproduce this unfortunately
  • alternatively we could add a hearbeat between child and parent (more complex though)
  • or, we could use an Enable/disable checkbox to user choose if he wants to kill parent when typing exit or ctrl+D, maybe this would be more user-friendly

For anyone interested, here terminal flow:

image

@github-actions github-actions bot removed 🐛 Bug Reported issues that need to be reproduced by the team. 🐞 Confirmed Bug Verified issues that have been reproduced by the team. labels Sep 26, 2024
@peaklabs-dev peaklabs-dev reopened this Sep 26, 2024
@peaklabs-dev peaklabs-dev added 🐛 Bug Reported issues that need to be reproduced by the team. 🐞 Confirmed Bug Verified issues that have been reproduced by the team. labels Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Reported issues that need to be reproduced by the team. 🐞 Confirmed Bug Verified issues that have been reproduced by the team.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants