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

White screen when login after logout #271

Open
vemonet opened this issue Jan 25, 2022 · 1 comment
Open

White screen when login after logout #271

vemonet opened this issue Jan 25, 2022 · 1 comment

Comments

@vemonet
Copy link

vemonet commented Jan 25, 2022

Describe the bug
White screen when login to the web UI after logout

To Reproduce
Steps to reproduce the behavior:

  1. Deploy Ubuntu dekstop
  2. Login: that works
  3. Logout
  4. Re-login: white screen

Expected behavior
Should be able to re-login

Versions (please complete the following information):

  • OS: running the container on OpenShift/Kubernetes
  • image tag: latest (Ubuntu 20.04)

Additional context

Error message printed by the server:

>>> sending remote command: "cmd=fb" via X11VNC_REMOTE X property.
2022-01-25 12:20:55,261 �[1;31mERROR�[0m Command '['supervisorctl', '-c', '/etc/supervisor/supervisord.conf', 'status']' returned non-zero exit status 3. (�[1mresponse.py�[0m:36)
Traceback (most recent call last):
  File "/usr/local/lib/web/backend/vnc/response.py", line 28, in func
    return f(*args, **kwargs)
  File "/usr/local/lib/web/backend/vnc/app.py", line 32, in apistate
    mystate = state.to_dict()
  File "/usr/local/lib/web/backend/vnc/state.py", line 45, in to_dict
    self._update_health()
  File "/usr/local/lib/web/backend/vnc/state.py", line 31, in _update_health
    output = gsp.check_output([
  File "/usr/local/lib/python3.8/dist-packages/gevent/subprocess.py", line 348, in check_output
    raise CalledProcessError(retcode, process.args, output=output)
subprocess.CalledProcessError: Command '['supervisorctl', '-c', '/etc/supervisor/supervisord.conf', 'status']' returned non-zero exit status 3.

It is due to this line: https://github.com/fcwu/docker-ubuntu-vnc-desktop/blob/develop/rootfs/usr/local/lib/web/backend/vnc/state.py#L31

output = gsp.check_output([
            'supervisorctl', '-c', '/etc/supervisor/supervisord.conf',
            'status'
        ], encoding='UTF-8')

It's weird because it I try to run this from the terminal with os.system instead of gevent.subprocess after connecting with the root user it works:

import os
os.system('supervisorctl -c /etc/supervisor/supervisord.conf status')

But it does not work with gevent:

from gevent import subprocess as gsp
output = gsp.check_output([
            'supervisorctl', '-c', '/etc/supervisor/supervisord.conf',
            'status'
        ], encoding='UTF-8')

@fcwu do you have any idea where it could come from? I'll look into it more deeply and try to fix this in my fork https://github.com/vemonet/docker-ubuntu-vnc-desktop

@vemonet
Copy link
Author

vemonet commented Jan 26, 2022

The issue happens when you logout, then try to log back in, even when using the image locally. The desktop app bar at the bottom is not there anymore

It is due to x:wm being in EXITED status when the python backend checks the processes status with supervisorctl
I found a way to mitigate this by restarting x:wm if it is found to be in EXITED status when doing the check

You can find the changes here: https://github.com/vemonet/docker-ubuntu-vnc-desktop/blob/develop/rootfs/usr/local/lib/web/backend/vnc/state.py#L44

Not sure if this is optimal, but it fixes the issue for us! Locally and when deploying on Kubernetes

You can use it with the published docker image ghcr.io/vemonet/docker-ubuntu-vnc-desktop:latest

docker run -p 6080:80 -v /dev/shm:/dev/shm -e PASSWORD=pass -e HTTP_PASSWORD=pass -e VNC_PASSWORD=pass ghcr.io/vemonet/docker-ubuntu-vnc-desktop:latest

I also added a GitHub Action workflow that I could contribute, to automatically build and publish an image to the GitHub Container Registry at each push to the develop branch.

@fcwu Let me know if you are interested for me to send a pull request for one or both features!

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

1 participant