Tâche #21435
Scénario #21278: Epic1: Créer les actions dans Salt -Master
Gérer les cas d'erreur dans les actions créées
Status:
Fermé
Priority:
Normal
Assigned To:
Target version:
Remaining (hours):
0.0
Description
- Définit les erreurs possibles à l'exécution de l'action et les renvoyer
- Vérifier leur prise en compte dans l'API bridge
Associated revisions
manage exceptions in saltmaster service
- add error definitions in messages and service code
- add documentation for error management in Creation_Microservice.txt
ref #21435
manage exceptions in saltmaster service
- add error definitions in messages and service code
- add documentation for error management in Creation_Microservice.txt
ref #21435
Correction code-block (gestion des erreurs)
ref #21435
History
#1 Updated by Bruno Boiget over 5 years ago
- Status changed from Nouveau to En cours
#2 Updated by Bruno Boiget over 5 years ago
- Status changed from En cours to Résolu
#3 Updated by Bruno Boiget over 5 years ago
- Remaining (hours) changed from 3.0 to 0.25
#4 Updated by Bruno Boiget over 5 years ago
- Description updated (diff)
- Remaining (hours) changed from 0.25 to 1.0
- informations ajoutées dans la documentation (création d'un microservice)
- les messages remontent bien jusqu'à l'API bridge, mais ne sont pas encore remontés jusqu'à l'utilisateur (il voit une 'internal error')
ex en mettant un mauvais mot de passe pour l'authentification Salt :
saltmaster_1 | [WARNING ] Authentication failure of type "eauth" occurred. saltmaster_1 | [INFO ] 127.0.0.1 - - [26/Sep/2017:12:08:42] "POST /login HTTP/1.1" 401 447 "" "python-requests/2.18.4" saltmaster_1 | 2017-09-26T12:08:42 ApplicationError: ApplicationError(error=<exec.salt.error.login_error>, args=[], kwargs={'reason': 'Error while authenticated to salt-api : Unauthorized'}, enc_algo=None): Traceback (most recent call last): saltmaster_1 | File "/srv/salt_ctrl/salt_ctrl.py", line 30, in exec_command saltmaster_1 | assert resp.status_code == 200, resp.reason saltmaster_1 | AssertionError: Unauthorized saltmaster_1 | saltmaster_1 | During handling of the above exception, another exception occurred: saltmaster_1 | saltmaster_1 | Traceback (most recent call last): saltmaster_1 | File "/usr/local/lib/python3.5/dist-packages/txaio/aio.py", line 443, in done saltmaster_1 | res = f.result() saltmaster_1 | File "/usr/lib/python3.5/asyncio/futures.py", line 274, in result saltmaster_1 | raise self._exception saltmaster_1 | File "/usr/local/lib/python3.5/dist-packages/txaio/aio.py", line 365, in as_future saltmaster_1 | res = fun(*args, **kwargs) saltmaster_1 | File "/srv/salt_ctrl/salt_ctrl.py", line 33, in exec_command saltmaster_1 | raise ApplicationError(u'exec.salt.error.login_error', reason=err_msg) saltmaster_1 | autobahn.wamp.exception.ApplicationError: ApplicationError(error=<exec.salt.error.login_error>, args=[], kwargs={'reason': 'Error while authenticated to salt-api : Unauthorized'}, enc_algo=None) saltmaster_1 | api-bridge_1 | 2017/09/26 12:08:42 [aca333f51119/U5OFPkjEYQ-000001] "POST http://api-bridge:3000/v1/exec.salt HTTP/1.1" from 172.18.0.8:39612 - 500 59B in 2.797773373s api-bridge_1 | 2017/09/26 12:08:42 [aca333f51119/U5OFPkjEYQ-000001] error: error calling remote procedure 'v1.exec.salt': exec.salt.error.login_error: reason=Error while authenticated to salt-api : Unauthorized
Autre problème :
Salt ne provoque pas un état d'erreur si une action demandée n'existe pas, ou si elle échoue sur certains serveurs. (réponse 200 avec liste des messages remontés par les minions).
#5 Updated by Gérald Schwartzmann over 5 years ago
- Remaining (hours) changed from 1.0 to 0.0
#6 Updated by Joël Cuissinat over 5 years ago
- Status changed from Résolu to Fermé