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

Closing worker with reason: worker recycled #367

Open
jasthema opened this issue Nov 3, 2023 · 6 comments
Open

Closing worker with reason: worker recycled #367

jasthema opened this issue Nov 3, 2023 · 6 comments

Comments

@jasthema
Copy link

jasthema commented Nov 3, 2023

hi there

I have compose the webssh for docker with command docker-compose up.
All works if in my laptop browser I connect directly to the host where docker runs. (https://myapp.com)

now I connect to a server to authenticate user (https://myauthserver.com) vs the LDAP, and if user is allowed it redirect to FQDN of my docker (https://myapp.com). but once I try to trigger the ssh connectivity, I got an error, session is closed with Closing worker with reason: worker recycled.

in some blog I found to add the --origin parameter, putting "*" or the DNS name, or to increase the delay. but nothing.

here my last version of Docker file:

FROM python:3.9
EXPOSE 8888
RUN pip install webssh
CMD wssh --ssladdress='0.0.0.0' --sslport=443 --certfile='/PATHTOCERT/certificate.crt' --keyfile=''/PATHTOCERT/certificate.key' --origin='https://myauthserver.com' --delay=6 --redirect=true

I put the certificate on /PATHTOCERT/

then I started the docker as below:
docker run --name webssh-test -d -v /PATHTOCERT/:/PATHTOCERT/ -p443:443 webssh-master-web

so if I run browser to go directly to the host where docker run, all works:
here the log
[I 231103 15:21:20 web:2344] 200 GET / (MYIP) 1.02ms
[I 231103 15:21:25 handler:452] Connecting to XXXXXXXXXX:22
[I 231103 15:21:25 transport:1893] Connected (version 2.0, client OpenSSH_8.0)
[I 231103 15:21:25 handler:86] Trying password authentication
[I 231103 15:21:26 transport:1893] Auth banner: b'Authorized uses only. All activity may be monitored and reported.\n'
[I 231103 15:21:26 transport:1893] Authentication (password) successful!
[W 231103 15:21:28 handler:446] Could not detect the default encoding.
[I 231103 15:21:28 web:2344] 200 POST / (MYIP) 2879.68ms
[I 231103 15:21:28 web:2344] 101 GET /ws?id=YYYYYYYYYYYYYYYYYYYYYYYYYY (MYIP) 0.80ms
[I 231103 15:21:28 handler:537] Connected from XXXXXXXXXX:54996

but If use an intermediate server to authenticate user versus LDAP, then it redirect to docker web:
[I 231103 15:22:29 web:2344] 200 GET / (AuthenticationServerIP) 1.01ms
[I 231103 15:22:37 handler:452] Connecting to XXXXXXXXXX:22
[I 231103 15:22:37 transport:1893] Connected (version 2.0, client OpenSSH_8.0)
[I 231103 15:22:37 handler:86] Trying password authentication
[I 231103 15:22:37 transport:1893] Auth banner: b'Authorized uses only. All activity may be monitored and reported.\n'
[I 231103 15:22:37 transport:1893] Authentication (password) successful!
[I 231103 15:22:37 web:2344] 200 POST / (AuthenticationServerIP) 755.35ms
[W 231103 15:22:41 web:2344] 400 GET /ws?id=YYYYYYYYYYYYYYYYYYYYYYYYYY (AuthenticationServerIP) 0.72ms
[W 231103 15:22:43 worker:33] Recycling worker YYYYYYYYYYYYYYYYYYYYYYYYYY
[I 231103 15:22:43 worker:123] Closing worker YYYYYYYYYYYYYYYYYYYYYYYYYY with reason: worker recycled
[I 231103 15:22:43 worker:131] Connection to XXXXXXXXXX:22 lost

what I am missing? which parameter shall I add to wssh ?

@Disk-MTH
Copy link

Hello, @jasthema, I have the same problem, have you fix it ?

@jasthema
Copy link
Author

@Disk-MTH , not solved yet :-(

@Chenhu-source
Copy link

I met as well

@futurecad
Copy link

Have you solved this problem?

@jasthema
Copy link
Author

jasthema commented Sep 8, 2024

Not solved, I discontinued the project. It seems a problem of proxy redirect and I guess the docker image is not compatible with it. I had similar problem with other containers behind proxy redirect authentication. I had to create a firewall rule to limit access.

@futurecad
Copy link

Not solved, I discontinued the project. It seems a problem of proxy redirect and I guess the docker image is not compatible with it. I had similar problem with other containers behind proxy redirect authentication. I had to create a firewall rule to limit access.

What other projects have you changed to subsequently?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants