Project

General

Profile

Tâche #7855

Distribution EOLE - Scénario #8827: Focus gen_config

erreur peu clair si eolegenconfig.conf n'est pas valide

Added by Emmanuel GARETTE over 7 years ago. Updated about 7 years ago.

Status:
Fermé
Priority:
Normal
Assigned To:
Start date:
10/29/2014
Due date:
% Done:

100%

Estimated time:
2.00 h
Spent time:
Remaining (hours):
0.0

Description

Il manquait une virgule dans le fichier /root/eole-genconfig/src/eolegenconfig.conf et j'ai une erreur peu clair :

python eoleflask-dev-server.py 
--------------------------------------------------------------------------------
INFO in eoleflask-dev-server [eoleflask-dev-server.py:51]:
Loading configuration file "/root/eole-genconfig/src/eolegenconfig.conf" 
--------------------------------------------------------------------------------
Traceback (most recent call last):
  File "eoleflask-dev-server.py", line 52, in <module>
    config = json.loads(file(configfile).read().decode('utf-8'))
  File "/usr/lib/python2.7/json/__init__.py", line 326, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/json/decoder.py", line 366, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python2.7/json/decoder.py", line 382, in raw_decode
    obj, end = self.scan_once(s, idx)

Associated revisions

Revision ec36b454 (diff)
Added by Ghislain Loaec about 7 years ago

Error on configuration file parsing - Fixes #7855 @1h

Revision 734d4ad3 (diff)
Added by Ghislain Loaec about 7 years ago

Log error when parsing config file - Fixes #7855

History

#1 Updated by Joël Cuissinat over 7 years ago

  • Target version deleted (Eole 2.4 Stable)
  • Estimated time set to 2.00 h

#2 Updated by Joël Cuissinat over 7 years ago

cosmétique -> pas urgent pour 2.4.0

#3 Updated by Joël Cuissinat about 7 years ago

  • Parent task set to #8827

#4 Updated by Benjamin Bohard about 7 years ago

  • Remaining (hours) set to 2.0

#5 Updated by Ghislain Loaec about 7 years ago

  • Status changed from Nouveau to Résolu
  • Start date set to 10/29/2014
  • % Done changed from 0 to 100

#6 Updated by Ghislain Loaec about 7 years ago

  • Remaining (hours) changed from 2.0 to 0.0

Le message d'erreur est désormait plus pertinent :

--------------------------------------------------------------------------------
ERROR in eoleflask-dev-server [./eoleflask-dev-server.py:55]:
Unable to parse configuration file "/root/Workspace/eole-genconfig/src/eolegenconfig.conf" 
--------------------------------------------------------------------------------

A noter qu'une erreur de lecture du fichier de configuration n'est pas bloquant (le serveur se lance malgré tout). Merci de spécifier si cela n'est pas le comportement souhaité.

#7 Updated by Joël Cuissinat about 7 years ago

  • Status changed from Résolu to En cours
  • Assigned To set to Ghislain Loaec
  • % Done changed from 100 to 50
  • Remaining (hours) changed from 0.0 to 1.0

La correction a été faite pour les développeurs mais sur un serveur ce script n'est pas disponible !

Mais dans la réalité ça donne :

root@eolebase:~# CreoleService eoleflask restart 
Restart System V service eoleflask
Stop System V service eoleflask                                     [  OK  ]
Start System V service eoleflask                                    [  OK  ]
root@eolebase:~# tail /var/log/eoleflask/eoleflask.log
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/eoleflask/loader.py", line 64, in load_app
    config = json.loads(f.read().decode('utf-8'))
  File "/usr/lib/python2.7/json/__init__.py", line 326, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/json/decoder.py", line 366, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python2.7/json/decoder.py", line 382, in raw_decode
    obj, end = self.scan_once(s, idx)
ValueError: Expecting , delimiter: line 6 column 1 (char 93)

=> eoleflask doit-il démarrer en cas d'erreur ?

#8 Updated by Ghislain Loaec about 7 years ago

  • Status changed from En cours to Résolu
  • % Done changed from 50 to 100

#9 Updated by Ghislain Loaec about 7 years ago

  • Remaining (hours) changed from 1.0 to 0.0

Les problèmes de lecture du fichier de configuration (eoleflask/loader) sont désormais loggués. Néanmoins, un autre problème surgit: Le problème est loggué en double (demande similaire: #8060). Cela provient du fait qu'il existe 2 instances de eoleflask, et qu'elles partagent le même fichier de log. cf. #9515

#10 Updated by Joël Cuissinat about 7 years ago

  • Status changed from Résolu to Fermé

Résolution et remarque confirmées :

root@horus:~# tail -f /var/log/eoleflask/eoleflask.log 
2014-11-06 12:14:23,401: eoleflask - Unable to parse configuration file "eolegenconfig.conf" 
2014-11-06 12:14:23,412: eoleflask - Unable to parse configuration file "eolegenconfig.conf" 

Also available in: Atom PDF