Can't access to the logs from webadmin since last update

, ,

:uk:/:us: french below

Hello !
I don’t know if I need to open an issue on github for that. Just tell me what is best.
Sincerlly.

My YunoHost server

Hardware: Intel nuc used as an internet cube (vpn, wifi hotspot)
YunoHost version: 3.6.4.5
I have access to my server : Through SSH or through the webadmin or through Shell in a box
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : no

Description of my issue

I applied the last update for yunohost (from 3.6.4.3 to 3.6.4.5 I think). Since, I can’t access the logs page from the webadmin, and I get this error message :

Action

GET /logs
{"with_details":"","limit":"25"}

Traceback

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/moulinette/interfaces/api.py", line 439, in process
    ret = self.actionsmap.process(arguments, timeout=30, route=_route)
  File "/usr/lib/python2.7/dist-packages/moulinette/actionsmap.py", line 523, in process
    return func(**arguments)
  File "/usr/lib/moulinette/yunohost/log.py", line 106, in log_list
    metadata = read_yaml(md_path)
  File "/usr/lib/python2.7/dist-packages/moulinette/utils/filesystem.py", line 73, in read_yaml
    loaded_yaml = yaml.safe_load(file_content)
  File "/usr/lib/python2.7/dist-packages/yaml/__init__.py", line 93, in safe_load
    return load(stream, SafeLoader)
  File "/usr/lib/python2.7/dist-packages/yaml/__init__.py", line 71, in load
    return loader.get_single_data()
  File "/usr/lib/python2.7/dist-packages/yaml/constructor.py", line 37, in get_single_data
    node = self.get_single_node()
  File "/usr/lib/python2.7/dist-packages/yaml/composer.py", line 36, in get_single_node
    document = self.compose_document()
  File "/usr/lib/python2.7/dist-packages/yaml/composer.py", line 55, in compose_document
    node = self.compose_node(None, None)
  File "/usr/lib/python2.7/dist-packages/yaml/composer.py", line 84, in compose_node
    node = self.compose_mapping_node(anchor)
  File "/usr/lib/python2.7/dist-packages/yaml/composer.py", line 133, in compose_mapping_node
    item_value = self.compose_node(node, item_key)
  File "/usr/lib/python2.7/dist-packages/yaml/composer.py", line 84, in compose_node
    node = self.compose_mapping_node(anchor)
  File "/usr/lib/python2.7/dist-packages/yaml/composer.py", line 133, in compose_mapping_node
    item_value = self.compose_node(node, item_key)
  File "/usr/lib/python2.7/dist-packages/yaml/composer.py", line 64, in compose_node
    if self.check_event(AliasEvent):
  File "/usr/lib/python2.7/dist-packages/yaml/parser.py", line 98, in check_event
    self.current_event = self.state()
  File "/usr/lib/python2.7/dist-packages/yaml/parser.py", line 449, in parse_block_mapping_value
    if not self.check_token(KeyToken, ValueToken, BlockEndToken):
  File "/usr/lib/python2.7/dist-packages/yaml/scanner.py", line 116, in check_token
    self.fetch_more_tokens()
  File "/usr/lib/python2.7/dist-packages/yaml/scanner.py", line 224, in fetch_more_tokens
    return self.fetch_alias()
  File "/usr/lib/python2.7/dist-packages/yaml/scanner.py", line 607, in fetch_alias
    self.tokens.append(self.scan_anchor(AliasToken))
  File "/usr/lib/python2.7/dist-packages/yaml/scanner.py", line 926, in scan_anchor
    % ch.encode('utf-8'), self.get_mark())
ScannerError: while scanning an alias
  in "", line 12, column 32:
      YNH_APP_ARG_WIFI_PASSPHRASE: **********
                                   ^
expected alphabetic or numeric character, but found '*'
  in "", line 12, column 33:
      YNH_APP_ARG_WIFI_PASSPHRASE: **********
                                    ^

Apparently, the problem comes from the hotspot application. I tried to uninstall it but the log page still return the same error.

It is not a critical bug, since the other services seems to work fine.


:fr: English above

Salut !
Je ne sais pas si je dois ouvrir un ticket sur github pour ça. Dit moi ce que vous préférez.
Cordialement :slight_smile:

Mon serveur YunoHost

Matériel: Intel nuc utilisé *comme une * brique internet (vpn, hotspot wifi)
Version de YunoHost: 3.6.4.5
J’ai accès à mon serveur : En SSH ou Par la webadmin ou avec Shell in a box
Êtes-vous dans un contexte particulier ou avez-vous effectué des modificiations particulières sur votre instance ? : non

Description du problème

J’ai appliqué la dernière mise à jour (depuis 3.6.4.3 vers 3.6.4.5 im me semble). Depuis, je n’ai plus accès à aux logs depuis le webadmin, et j’ai le message d’erreur suivant :

Action

GET /logs
{"with_details":"","limit":"25"}

Traceback

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/moulinette/interfaces/api.py", line 439, in process
    ret = self.actionsmap.process(arguments, timeout=30, route=_route)
  File "/usr/lib/python2.7/dist-packages/moulinette/actionsmap.py", line 523, in process
    return func(**arguments)
  File "/usr/lib/moulinette/yunohost/log.py", line 106, in log_list
    metadata = read_yaml(md_path)
  File "/usr/lib/python2.7/dist-packages/moulinette/utils/filesystem.py", line 73, in read_yaml
    loaded_yaml = yaml.safe_load(file_content)
  File "/usr/lib/python2.7/dist-packages/yaml/__init__.py", line 93, in safe_load
    return load(stream, SafeLoader)
  File "/usr/lib/python2.7/dist-packages/yaml/__init__.py", line 71, in load
    return loader.get_single_data()
  File "/usr/lib/python2.7/dist-packages/yaml/constructor.py", line 37, in get_single_data
    node = self.get_single_node()
  File "/usr/lib/python2.7/dist-packages/yaml/composer.py", line 36, in get_single_node
    document = self.compose_document()
  File "/usr/lib/python2.7/dist-packages/yaml/composer.py", line 55, in compose_document
    node = self.compose_node(None, None)
  File "/usr/lib/python2.7/dist-packages/yaml/composer.py", line 84, in compose_node
    node = self.compose_mapping_node(anchor)
  File "/usr/lib/python2.7/dist-packages/yaml/composer.py", line 133, in compose_mapping_node
    item_value = self.compose_node(node, item_key)
  File "/usr/lib/python2.7/dist-packages/yaml/composer.py", line 84, in compose_node
    node = self.compose_mapping_node(anchor)
  File "/usr/lib/python2.7/dist-packages/yaml/composer.py", line 133, in compose_mapping_node
    item_value = self.compose_node(node, item_key)
  File "/usr/lib/python2.7/dist-packages/yaml/composer.py", line 64, in compose_node
    if self.check_event(AliasEvent):
  File "/usr/lib/python2.7/dist-packages/yaml/parser.py", line 98, in check_event
    self.current_event = self.state()
  File "/usr/lib/python2.7/dist-packages/yaml/parser.py", line 449, in parse_block_mapping_value
    if not self.check_token(KeyToken, ValueToken, BlockEndToken):
  File "/usr/lib/python2.7/dist-packages/yaml/scanner.py", line 116, in check_token
    self.fetch_more_tokens()
  File "/usr/lib/python2.7/dist-packages/yaml/scanner.py", line 224, in fetch_more_tokens
    return self.fetch_alias()
  File "/usr/lib/python2.7/dist-packages/yaml/scanner.py", line 607, in fetch_alias
    self.tokens.append(self.scan_anchor(AliasToken))
  File "/usr/lib/python2.7/dist-packages/yaml/scanner.py", line 926, in scan_anchor
    % ch.encode('utf-8'), self.get_mark())
ScannerError: while scanning an alias
  in "", line 12, column 32:
      YNH_APP_ARG_WIFI_PASSPHRASE: **********
                                   ^
expected alphabetic or numeric character, but found '*'
  in "", line 12, column 33:
      YNH_APP_ARG_WIFI_PASSPHRASE: **********
                                    ^

Il semble qu’il y ai un problème avec l’application hotspot. J’ai essayé de la desinstaller, mais cela n’a pas corrigé le problème.

Ce bug n’est pas critique, puisque tous les autres services semblent fonctionner correctement.

Salut,

oui, c’est un probleme connu qu’on essaye de comprendre depuis quelques semaines …

Est-ce que tu peux faire un grep -nr -C10 "WIFI_PASSPHRASE" /var/log/yunohost/categories/operation/*.yml (j’essaye de reproduire l’issue de mon côté)

Edit : ah ! nevermind, I can reproduce the issue

1 Like

Bonjour,

Depuis la mise à jour d´aujourdhui je n´ai plus d´accès aux Logs en webadmin, j´ai le message ¨ YunoHost a rencontré une erreur interne :confused: ¨ ?? La mis à jour concernait AMPACHE et le passage de la 3.6.4.3 à le 3.6.4.5 de Yunohost ( c´est curieux il me semblait que j´étais déjà en 3.6.4.5!).
Pour information complémentaire j´ai depuis l´avant dernière mise à jour également le message ¨ Le fichier yaml de metadata associé aux logs est corrompu : '{md_file}¨

Bonjour Aleks,
S’il s’agit d’un bug connu, j’espère que mon ‘cas’ aidera à le résoudre :slight_smile:

Voici le résultat du grep :

/var/log/yunohost/categories/operation/20190304-212406-app_install-hotspot.yml-2-  app: hotspot
/var/log/yunohost/categories/operation/20190304-212406-app_install-hotspot.yml-3-  args: domain=<DOMAINE>&path=%2Fwifiadmin&wifi_ssid=<SSID>&wifi_passphrase=<PASSWORD>&firmware_nonfree=no
/var/log/yunohost/categories/operation/20190304-212406-app_install-hotspot.yml-4-  force: false
/var/log/yunohost/categories/operation/20190304-212406-app_install-hotspot.yml-5-  label: Wifi Hotspot
/var/log/yunohost/categories/operation/20190304-212406-app_install-hotspot.yml-6-  no_remove_on_failure: false
/var/log/yunohost/categories/operation/20190304-212406-app_install-hotspot.yml-7-ended_at: 2019-03-04 21:25:19.784626
/var/log/yunohost/categories/operation/20190304-212406-app_install-hotspot.yml-8-env:
/var/log/yunohost/categories/operation/20190304-212406-app_install-hotspot.yml-9-  YNH_APP_ARG_DOMAIN: <DOMAINE>
/var/log/yunohost/categories/operation/20190304-212406-app_install-hotspot.yml-10-  YNH_APP_ARG_FIRMWARE_NONFREE: 'no'
/var/log/yunohost/categories/operation/20190304-212406-app_install-hotspot.yml-11-  YNH_APP_ARG_PATH: /wifiadmin
/var/log/yunohost/categories/operation/20190304-212406-app_install-hotspot.yml:12:  YNH_APP_ARG_WIFI_PASSPHRASE: <PASSWORD>
/var/log/yunohost/categories/operation/20190304-212406-app_install-hotspot.yml-13-  YNH_APP_ARG_WIFI_SSID: <SSID>
/var/log/yunohost/categories/operation/20190304-212406-app_install-hotspot.yml-14-  YNH_APP_ID: hotspot
/var/log/yunohost/categories/operation/20190304-212406-app_install-hotspot.yml-15-  YNH_APP_INSTANCE_NAME: hotspot
/var/log/yunohost/categories/operation/20190304-212406-app_install-hotspot.yml-16-  YNH_APP_INSTANCE_NUMBER: '1'
/var/log/yunohost/categories/operation/20190304-212406-app_install-hotspot.yml-17-  YNH_CWD: /var/cache/yunohost/from_file/hotspot_ynh-5ee291480d4b91b136e108cac6b281b748777053/scripts
/var/log/yunohost/categories/operation/20190304-212406-app_install-hotspot.yml-18-  YNH_STDINFO: /tmp/tmpduB8vs/stdinfo
/var/log/yunohost/categories/operation/20190304-212406-app_install-hotspot.yml-19-error: null
/var/log/yunohost/categories/operation/20190304-212406-app_install-hotspot.yml-20-operation: app_install
/var/log/yunohost/categories/operation/20190304-212406-app_install-hotspot.yml-21-related_to:
/var/log/yunohost/categories/operation/20190304-212406-app_install-hotspot.yml-22-- - app
--
/var/log/yunohost/categories/operation/20190723-084256-app_install-hotspot.yml-2-  app: hotspot
/var/log/yunohost/categories/operation/20190723-084256-app_install-hotspot.yml-3-  args: domain=<DOMAINE>&path=%2Fwifiadmin&wifi_ssid=<SSID>&wifi_passphrase=**********&firmware_nonfree=no
/var/log/yunohost/categories/operation/20190723-084256-app_install-hotspot.yml-4-  force: false
/var/log/yunohost/categories/operation/20190723-084256-app_install-hotspot.yml-5-  label: Wifi Hotspot
/var/log/yunohost/categories/operation/20190723-084256-app_install-hotspot.yml-6-  no_remove_on_failure: false
/var/log/yunohost/categories/operation/20190723-084256-app_install-hotspot.yml-7-ended_at: 2019-07-23 08:44:18.884604
/var/log/yunohost/categories/operation/20190723-084256-app_install-hotspot.yml-8-env:
/var/log/yunohost/categories/operation/20190723-084256-app_install-hotspot.yml-9-  YNH_APP_ARG_DOMAIN: <DOMAINE>
/var/log/yunohost/categories/operation/20190723-084256-app_install-hotspot.yml-10-  YNH_APP_ARG_FIRMWARE_NONFREE: 'no'
/var/log/yunohost/categories/operation/20190723-084256-app_install-hotspot.yml-11-  YNH_APP_ARG_PATH: /wifiadmin
/var/log/yunohost/categories/operation/20190723-084256-app_install-hotspot.yml:12:  YNH_APP_ARG_WIFI_PASSPHRASE: **********
/var/log/yunohost/categories/operation/20190723-084256-app_install-hotspot.yml-13-  YNH_APP_ARG_WIFI_SSID: <SSID>
/var/log/yunohost/categories/operation/20190723-084256-app_install-hotspot.yml-14-  YNH_APP_ID: hotspot
/var/log/yunohost/categories/operation/20190723-084256-app_install-hotspot.yml-15-  YNH_APP_INSTANCE_NAME: hotspot
/var/log/yunohost/categories/operation/20190723-084256-app_install-hotspot.yml-16-  YNH_APP_INSTANCE_NUMBER: '1'
/var/log/yunohost/categories/operation/20190723-084256-app_install-hotspot.yml-17-  YNH_CWD: /var/cache/yunohost/from_file/hotspot_ynh-a4837a8063aff8755be7c21451995adf72b39a35/scripts
/var/log/yunohost/categories/operation/20190723-084256-app_install-hotspot.yml-18-  YNH_INTERFACE: api
/var/log/yunohost/categories/operation/20190723-084256-app_install-hotspot.yml-19-  YNH_STDINFO: /tmp/tmpKQ2zJV/stdinfo
/var/log/yunohost/categories/operation/20190723-084256-app_install-hotspot.yml-20-  YNH_STDRETURN: /tmp/tmppERIT6/stdreturn
/var/log/yunohost/categories/operation/20190723-084256-app_install-hotspot.yml-21-error: null
/var/log/yunohost/categories/operation/20190723-084256-app_install-hotspot.yml-22-operation: app_install

J’ai remplacé les valeurs sensibles (mots de passes, etc) par des balises ( < PASSWORD>)

A noter que j’ai laissé le mot de passe qui se trouve dans le second fichier car

  1. il semble correspondre au message d’erreur
  2. je ne sais pas d’où il sort (je n’ai jamais utilisé une succession d’étoiles comme mot de passe)

Amicalement.
Jershon

J’ai publié un correctif sur les paquets moulinette et yunohost, donc une nouvelle mise à jour devrait corriger le probleme …

(Ceci dit : pour les anciens logs, Yunohost continuera de râler à cause d’un problème de syntaxe avec un message qui fait peur … mais dans l’absolu ce n’est pas + problématique que ça. Il “disparaitra” tout seul car par défaut seul les 50(?) opérations les plus récentes sont listées)

Il s’agit du nouveau mécanisme qui “censure” automatiquement les informations telles que les mot de passe des logs, pour ne pas les publier sur le forum sans faire gaffe…

1 Like

Merci beaucoup :hugs:

Cela me semble judicieux, car cela fait toujours bizarre de lire son mot de passe dans un fichier le log :stuck_out_tongue:

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