Project

General

Profile

Tâche #21452

Scénario #21281: Epic1: faire un "passe plat" minimaliste non validant pour l'API Gateway

Investiguer sur le message renvoyé par l'api-bridge lors d'un appel à l'API

Added by Gérald Schwartzmann over 3 years ago. Updated over 3 years ago.

Status:
Fermé
Priority:
Normal
Assigned To:
Start date:
09/26/2017
Due date:
% Done:

100%

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

Description

Pour reproduire, ajouter le caractère * n'importe où dans le nom de la clé salt_command :

  • curl -v -X 'POST' -d '{"kwargs":{"servername":"*", "sal*t_command":"test.ping"}}' http://eolebase.ac-test.fr:30005/api/v1/exec.salt
Note: Unnecessary use of -X or --request, POST is already inferred.
*   Trying 192.168.0.24...
* Connected to eolebase.ac-test.fr (192.168.0.24) port 30005 (#0)
> POST /api/v1/exec.salt HTTP/1.1
> Host: eolebase.ac-test.fr:30005
> User-Agent: curl/7.47.0
> Accept: */*
> Content-Length: 58
> Content-Type: application/x-www-form-urlencoded
> 
* upload completely sent off: 58 out of 58 bytes
< HTTP/1.1 500 Internal Server Error
< Content-Type: text/plain; charset=utf-8
< Content-Length: 59
< Connection: keep-alive
< Date: Tue, 26 Sep 2017 13:13:31 GMT
< X-Kong-Upstream-Latency: 10003
< X-Kong-Proxy-Latency: 0
< Via: kong/0.11.0
< 
{
  "error": {
    "message": "internal server error" 
  }
* Connection #0 to host eolebase.ac-test.fr left intact

Ceci provoque le traceback suivant :

saltmaster_1  | [INFO    ] Got return from horus.ac-test.fr for job 20170926102419218434
api-bridge_1  | wamp-client> 2017/09/26 10:24:23 Call to 'v1.exec.salt' canceled (mode=killnowait)
crossbar_1    | 2017-09-26T10:24:23+0000 [Router         13] Traceback (most recent call last):
crossbar_1    |   File "/usr/local/site-packages/autobahn/wamp/websocket.py", line 88, in onMessage
crossbar_1    |     for msg in self._serializer.unserialize(payload, isBinary):
crossbar_1    |   File "/usr/local/site-packages/autobahn/wamp/serializer.py", line 131, in unserialize
crossbar_1    |     msg = Klass.parse(raw_msg)
crossbar_1    |   File "/usr/local/site-packages/autobahn/wamp/message.py", line 2910, in parse
crossbar_1    |     raise ProtocolError("invalid value '{0}' for 'mode' option in CANCEL".format(option_mode))
crossbar_1    | autobahn.wamp.exception.ProtocolError: invalid value 'killnowait' for 'mode' option in CANCEL
crossbar_1    |
crossbar_1    | 2017-09-26T10:24:23+0000 [Router         13] session "7836466719742994" left realm "realm1" 
saltmaster_1  | [INFO    ] User eole Published command saltutil.find_job with jid 20170926102424296600
api-bridge_1  | 2017/09/26 10:24:28 [cf1bc6870d09/M2mJENisSm-000001] error: timeout while waiting for reply
api-bridge_1  | 2017/09/26 10:24:28 [cf1bc6870d09/M2mJENisSm-000001] "POST http://api-bridge:3000/v1/exec.salt HTTP/1.1" from 172.18.0.8:49994 - 500 59B in 10.001656749s
saltmaster_1  | [INFO    ] 127.0.0.1 - - [26/Sep/2017:10:24:34] "POST / HTTP/1.1" 200 68 "" "python-requests/2.18.4" 

Relancer le conteneur zephir_api-bridge_1 permet de remettre l'api en état :
docker restart zephir_api-bridge_1

Associated revisions

Revision b8c2a0ea (diff)
Added by William Petit over 3 years ago

Use "skip" mode for RPC timeouts

ref #21452

Revision a79ae994 (diff)
Added by William Petit over 3 years ago

Basic arguments validation and saltmaster service stabilization

- Use dumb-init as init system in saltmaster service
- Validate that required arguments are present for exec.salt message
- Use autobahn-autoreconnect to prevent unresponding salt_ctrl

ref #21452

Revision 0f194ed7 (diff)
Added by Joël Cuissinat over 3 years ago

salt_args argument is NOT required

ref #21452

History

#1 Updated by Fabrice Barconnière over 3 years ago

  • Subject changed from Investiguer sur le message renvoyé par crossbar lors d'un appel à l'API to Investiguer sur le message renvoyé par l'api-bridge lors d'un appel à l'API
  • Description updated (diff)

#2 Updated by William Petit over 3 years ago

  • Status changed from Nouveau to En cours

#3 Updated by William Petit over 3 years ago

  • Assigned To set to William Petit

#4 Updated by William Petit over 3 years ago

  • Status changed from En cours to Résolu

#5 Updated by William Petit over 3 years ago

  • Remaining (hours) changed from 2.0 to 0.25

#6 Updated by Fabrice Barconnière over 3 years ago

  • Status changed from Résolu to En cours

#7 Updated by Fabrice Barconnière over 3 years ago

  • % Done changed from 0 to 60

Toujours une erreur en appelant une commande salt system.reboot :

api-bridge_1  | wamp-client> 2017/09/27 08:37:18 Call to 'v1.exec.salt' canceled (mode=skip)
crossbar_1    | 2017-09-27T08:37:18+0000 [Router         11] Traceback (most recent call last):
crossbar_1    |   File "/usr/local/site-packages/autobahn/wamp/websocket.py", line 95, in onMessage
crossbar_1    |     self._session.onMessage(msg)
crossbar_1    |   File "/usr/local/site-packages/crossbar/router/session.py", line 537, in onMessage
crossbar_1    |     self._router.process(self, msg)
crossbar_1    |   File "/usr/local/site-packages/crossbar/router/router.py", line 237, in process
crossbar_1    |     self._dealer.processCancel(session, msg)
crossbar_1    |   File "/usr/local/site-packages/crossbar/router/dealer.py", line 767, in processCancel
crossbar_1    |     cancel.mode
crossbar_1    |   File "/usr/local/site-packages/autobahn/wamp/message.py", line 3910, in __init__
crossbar_1    |     assert(mode is None or mode in [self.ABORT, self.KILL])
crossbar_1    | AssertionError
crossbar_1    | 
crossbar_1    | 2017-09-27T08:37:18+0000 [Router         11] session "1204602797103157" left realm "realm1" 
saltmaster_1  | [INFO    ] User eole Published command saltutil.find_job with jid 20170927083718927778
api-bridge_1  | 2017/09/27 08:37:23 [9cc0454db3bb/8nvL6qL9F8-000001] error: timeout while waiting for reply

#8 Updated by William Petit over 3 years ago

  • Status changed from En cours to Résolu

#9 Updated by Joël Cuissinat over 3 years ago

  • Status changed from Résolu to Fermé
  • % Done changed from 60 to 100
  • Remaining (hours) changed from 0.25 to 0.0

Also available in: Atom PDF