Can't acces admin GUI after update

Hi,

I run yh on a rpi4 4gb. After running the last update, i can’t access the admin-gui anymore. I already tried to restart yh, the api and nginx - nothing helped.

This is the message (german) I receive when trying to access the admin GUI:

Blockquote

Die YunoHost API antwortet nicht

Tut uns wirklich leid.

Sie sollten für Hilfe im Forum oder im Chat nachschauen, um das Problem zu beheben, oder einen Bug melden im Bugtracker.
Die folgenden Informationen könnten nützlich sein für die Person, die Ihnen hilft:

Fehler: "502" Bad Gateway

Aktion: "GET" /yunohost/api/installed?locale=de

Fehlermeldung:

Die YunoHost-API antwortet nicht. Vielleicht ist ‘yunohost-api’ ausgefallen oder wurde neu gestartet?

Blockquote

Do you please have a hint how to solve this? Thanks!

Have you try :

  • to restart yunohost-api
  • to refresh webadmin cache with “CTRL + F5” (in the browser) ?

Or ctrl-shift-R, depending on browser. You could also try an incognito/private window, sometimes that sheds some light.

You already restarted nginx and the api, so you do have SSH-access, don’t you? Is there anything in the yunohost- or nginx-logs?

ok: refreshing webadmin cache or trying private mode didn’t solve the problem.

yes, i have ssh access. how do I get to the yunohost and nginx logs?

Log in as admin, then

$ sudo tail -f /var/log/yunohost/yunohost-api.log

Keep the SSH session open and try to log in to the web admin. The -f option to tail will ‘follow’ the new additions, so you have a live view of what is happening.
When I open the (white) admin logon page, this is logged:

2022-01-08 13:02:36,214 DEBUG    geventwebsocket.handler (unknown function) - Initializing WebSocket
2022-01-08 13:02:36,214 DEBUG    geventwebsocket.handler (unknown function) - Validating WebSocket request
2022-01-08 13:02:36,214 DEBUG    moulinette.core set_locale - unable to load locale 'en' from '/usr/share/moulinette/locale'
2022-01-08 13:02:36,215 DEBUG    moulinette.core set_locale - unable to load locale 'en' from '/usr/lib/moulinette/yunohost/locales'
2022-01-08 13:02:36,215 INFO     geventwebsocket.handler (unknown function) - 127.0.0.1 - - [2022-01-08 13:02:36] "GET /installed?locale=null HTTP/1.1" 200 159 0.001429

Then when I enter the password and press the Login-button, the log is appended with

2022-01-08 13:04:10,779 DEBUG    geventwebsocket.handler (unknown function) - Initializing WebSocket
2022-01-08 13:04:10,780 DEBUG    geventwebsocket.handler (unknown function) - Validating WebSocket request
2022-01-08 13:04:10,780 DEBUG    geventwebsocket.handler (unknown function) - Can only upgrade connection if using GET method.
2022-01-08 13:04:10,781 DEBUG    moulinette.actionsmap get_authenticator - Loading auth module yunohost.authenticators.ldap_admin
2022-01-08 13:04:10,788 INFO     geventwebsocket.handler (unknown function) - 127.0.0.1 - - [2022-01-08 13:04:10] "POST /login HTTP/1.1" 200 383 0.008304
2022-01-08 13:04:10,946 DEBUG    geventwebsocket.handler (unknown function) - Initializing WebSocket
2022-01-08 13:04:10,947 DEBUG    geventwebsocket.handler (unknown function) - Validating WebSocket request
2022-01-08 13:04:10,947 DEBUG    moulinette.actionsmap get_authenticator - Loading auth module yunohost.authenticators.ldap_admin
2022-01-08 13:04:10,948 DEBUG    moulinette.core acquire - acquiring lock...
2022-01-08 13:04:10,948 DEBUG    moulinette.core acquire - lock has been acquired
2022-01-08 13:04:10,948 DEBUG    moulinette.actionsmap process - loading python module yunohost.tools took 0.000s
2022-01-08 13:04:10,948 DEBUG    moulinette.actionsmap process - processing action [362.72]: yunohost.tools.versions with args={}
2022-01-08 13:04:10,981 DEBUG    moulinette.actionsmap process - action [362.72] executed in 0.033s
2022-01-08 13:04:10,982 DEBUG    moulinette.core release - lock has been released
2022-01-08 13:04:10,983 INFO     geventwebsocket.handler (unknown function) - 127.0.0.1 - - [2022-01-08 13:04:10] "GET /versions?locale=en HTTP/1.1" 200 355 0.036960

How does it look on your side?

Does diagnosis give any clou,

$ sudo yunohost diagnosis run
$ sudo yunohost diagnosis show basesystem

Any warnings? And which version of Yunohost does it show? My Yunohost has no pending upgrades or migrations, it shows

reports: 
  description: Base system
  id: basesystem
  items: 
    0: 
      details: Server model is To Be Filled By O.E.M. To Be Filled By O.E.M.
      status: INFO
      summary: Server hardware architecture is lxc amd64
    1: 
      status: INFO
      summary: Server is running Linux kernel 5.11.22-5-pve
    2: 
      status: INFO
      summary: Server is running Debian 10.11
    3: 
      details: 
        - yunohost version: 4.3.5 (stable)
        - yunohost-admin version: 4.3.3 (stable)
        - moulinette version: 4.3.3 (stable)
        - ssowat version: 4.3.3 (stable)
      status: INFO
      summary: Server is running YunoHost 4.3.5 (stable)

I had that very same problem… It turn out to be the most unexpected thing… cookies … try a different browser, try to remove ALL the cookies your browser have… try “incognito” modes… I’ve been crazy for months with this issue… and turn out to be something that simple… web browser cookies.

1 Like

502 Bad Gateway is symptomatic of the API being down

You should try to systemctl restart yunohost-api from SSH

If that doesn’t work, then investigate with journalctl -u yunohost-api --no-pager --no-hostname

unfortunately, this didnt help.

hi,

I restarted the api, but it didn’t help anything. when i investigated with journalctl, i saw that the api is restarted every 5 seconds, this is what the timestamp shows every 5 seconds:

Jan 09 13:46:15 systemd[1]: yunohost-api.service: Main process exited, code=exited, status=1/FAILURE
Jan 09 13:46:15 systemd[1]: yunohost-api.service: Failed with result 'exit-code'.
Jan 09 13:46:20 systemd[1]: yunohost-api.service: Service RestartSec=5s expired, scheduling restart.
Jan 09 13:46:20 systemd[1]: yunohost-api.service: Scheduled restart job, restart counter is at 22948.
Jan 09 13:46:20 systemd[1]: Stopped YunoHost API Server.
Jan 09 13:46:20 systemd[1]: Started YunoHost API Server.
Jan 09 13:46:21 yunohost-api[7984]: Traceback (most recent call last):
Jan 09 13:46:21 yunohost-api[7984]:   File "/usr/bin/yunohost-api", line 44, in <module>
Jan 09 13:46:21 yunohost-api[7984]:     yunohost.api(debug=opts.debug, host=opts.host, port=opts.port)
Jan 09 13:46:21 yunohost-api[7984]:   File "/usr/lib/moulinette/yunohost/__init__.py", line 42, in api
Jan 09 13:46:21 yunohost-api[7984]:     routes={("GET", "/installed"): is_installed_api},
Jan 09 13:46:21 yunohost-api[7984]:   File "/usr/lib/python3/dist-packages/moulinette/__init__.py", line 100, in api
Jan 09 13:46:21 yunohost-api[7984]:     Api(routes=routes).run(host, port)
Jan 09 13:46:21 yunohost-api[7984]:   File "/usr/lib/python3/dist-packages/moulinette/interfaces/api.py", line 741, in __init__
Jan 09 13:46:21 yunohost-api[7984]:     actionsmap = ActionsMap(ActionsMapParser())
Jan 09 13:46:21 yunohost-api[7984]:   File "/usr/lib/python3/dist-packages/moulinette/actionsmap.py", line 476, in __init__
Jan 09 13:46:21 yunohost-api[7984]:     self.parser = self._construct_parser(actionsmaps, top_parser)
Jan 09 13:46:21 yunohost-api[7984]:   File "/usr/lib/python3/dist-packages/moulinette/actionsmap.py", line 674, in _construct_parser
Jan 09 13:46:21 yunohost-api[7984]:     self.name = _global["name"]
Jan 09 13:46:21 yunohost-api[7984]: KeyError: 'name'
Jan 09 13:46:21 systemd[1]: yunohost-api.service: Main process exited, code=exited, status=1/FAILURE
Jan 09 13:46:21 systemd[1]: yunohost-api.service: Failed with result 'exit-code'.

i just don’t know, what it means, the problem is and how to fix it. could you please give me a hint?

it shows these lines over and over again:

2022-01-09 13:57:31,946 DEBUG    moulinette.interface __init__ - initializing base actions map parser for api
2022-01-09 13:57:31,947 DEBUG    moulinette.actionsmap __init__ - loading actions map namespace 'yunohost'
2022-01-09 13:57:31,953 DEBUG    moulinette.actionsmap _construct_parser - building parser...
2022-01-09 13:57:37,443 DEBUG    moulinette.interface __init__ - initializing base actions map parser for api
2022-01-09 13:57:37,444 DEBUG    moulinette.actionsmap __init__ - loading actions map namespace 'yunohost'
2022-01-09 13:57:37,450 DEBUG    moulinette.actionsmap _construct_parser - building parser...`Preformatted text`

diagnosis shows the following:

sudo yunohost diagnosis run
Traceback (most recent call last):
  File "/usr/bin/yunohost", line 72, in <module>
    parser=parser
  File "/usr/lib/moulinette/yunohost/__init__.py", line 25, in cli
    ret = moulinette.cli(args, output_as=output_as, timeout=timeout, top_parser=parser)
  File "/usr/lib/python3/dist-packages/moulinette/__init__.py", line 130, in cli
    Cli(top_parser=top_parser, load_only_category=load_only_category).run(
  File "/usr/lib/python3/dist-packages/moulinette/interfaces/cli.py", line 471, in __init__
    load_only_category=load_only_category,
  File "/usr/lib/python3/dist-packages/moulinette/actionsmap.py", line 476, in __init__
    self.parser = self._construct_parser(actionsmaps, top_parser)
  File "/usr/lib/python3/dist-packages/moulinette/actionsmap.py", line 674, in _construct_parser
    self.name = _global["name"]
KeyError: 'name'`Preformatted text`

show basesystem shows the same output.

it seems that something is broken with moulinette, but i not a single clue what this means or what to do. could you please have a look at it?

You could try

$ sudo apt reinstall  moulinette yunohost yunohost-admin

I just did it at my Yunohost, especially the yunohost-part takes a while, but it does not seem to have any adverse effects. Even better, it solved a problem I had but did not yet have time to look into :stuck_out_tongue: Thanks!

1 Like

My bad… sorry.

thanks! it helped to solve the former error, but now there is new one, when i try to login:

Ein unerwarteter Fehler ist in Yunohost aufgetreten

Tut uns wirklich leid.

Sie sollten für Hilfe im Forum oder im Chat nachschauen, um das Problem zu beheben, oder einen Bug melden im Bugtracker.
Die folgenden Informationen könnten nützlich sein für die Person, die Ihnen hilft:

Fehler: "400" Bad Request

Aktion: "POST" /yunohost/api/login

Fehlermeldung:

Missing credentials parameter

Blockquote

do you have any hints?

Maybe try @bjarkan’s suggestions again, different browsers, incognito, clear cookies? What does yunohost-api.log show now, when you try to log in?

great! thanks, it worked with @bjarkan suggestion! thank you!

2 Likes

I thought I was wrong, that’s why I apologize about it… but since there are several issues about the yunohost web interface that can be solved so easily, I suggested to at least try, to remove cookies, incognito, different browser blah blah blah…

You’re very welcome… but never underestimate the hard work behind the scene, mostly unseen, from people like @Aleks and many others, that are dedicating half theirs life, to this project.

Indeed, and I can already see myself on my death bed, with the doctor saying “sir, you are dying!”, and me saying “what do you mean, ‘dying’ !? Please provide the full logs and context, ffs!” :thinking:

3 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.