Project

General

Profile

Actions

Bug #10113

closed

User story #9714: Remote run API should use relay API

asynchronous call on relay remote run api makes an error

Added by Vincent MEMBRÉ about 7 years ago. Updated about 7 years ago.

Status:
Released
Priority:
1
Category:
API
Target version:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
Name check:
Fix check:
Regression:

Description

We call subprocess.popen with "command &" and shell parameter (default to false)

This leads to an error:

[Wed Feb 01 15:38:05 2017] [error] [client 127.0.0.1] mod_wsgi (pid=5950): Exception occurred processing WSGI script '/opt/rudder/share/relay-api/relay-api.wsgi'.
[Wed Feb 01 15:38:05 2017] [error] [client 127.0.0.1] Traceback (most recent call last):
[Wed Feb 01 15:38:05 2017] [error] [client 127.0.0.1]   File "/opt/rudder/share/relay-api/flask/lib/python2.6/site-packages/werkzeug/wsgi.py", line 703, in __next__
[Wed Feb 01 15:38:05 2017] [error] [client 127.0.0.1]     return self._next()
[Wed Feb 01 15:38:05 2017] [error] [client 127.0.0.1]   File "/opt/rudder/share/relay-api/flask/lib/python2.6/site-packages/werkzeug/wrappers.py", line 81, in _iter_encoded
[Wed Feb 01 15:38:05 2017] [error] [client 127.0.0.1]     for item in iterable:
[Wed Feb 01 15:38:05 2017] [error] [client 127.0.0.1]   File "/opt/rudder/share/relay-api/relay_api/remote_run.py", line 177, in generate_output
[Wed Feb 01 15:38:05 2017] [error] [client 127.0.0.1]     yield call_remote_run(host, node, classes, keep_output, asynchronous)
[Wed Feb 01 15:38:05 2017] [error] [client 127.0.0.1]   File "/opt/rudder/share/relay-api/relay_api/remote_run.py", line 93, in call_remote_run
[Wed Feb 01 15:38:05 2017] [error] [client 127.0.0.1]     return run_command(REMOTE_RUN_COMMAND + classes_parameter + " " + host, uuid, keep_output, asynchronous)
[Wed Feb 01 15:38:05 2017] [error] [client 127.0.0.1]   File "/opt/rudder/share/relay-api/relay_api/remote_run.py", line 106, in run_command
[Wed Feb 01 15:38:05 2017] [error] [client 127.0.0.1]     process = Popen(command)
[Wed Feb 01 15:38:05 2017] [error] [client 127.0.0.1]   File "/usr/lib64/python2.6/subprocess.py", line 642, in __init__
[Wed Feb 01 15:38:05 2017] [error] [client 127.0.0.1]     errread, errwrite)
[Wed Feb 01 15:38:05 2017] [error] [client 127.0.0.1]   File "/usr/lib64/python2.6/subprocess.py", line 1234, in _execute_child
[Wed Feb 01 15:38:05 2017] [error] [client 127.0.0.1]     raise child_exception
[Wed Feb 01 15:38:05 2017] [error] [client 127.0.0.1] OSError: [Errno 2] No such file or directory

We should use shell=True as parameter

Actions #1

Updated by Vincent MEMBRÉ about 7 years ago

  • Status changed from New to In progress
Actions #2

Updated by Vincent MEMBRÉ about 7 years ago

  • Status changed from In progress to Pending technical review
  • Assignee changed from Vincent MEMBRÉ to Benoît PECCATTE
  • Pull Request set to https://github.com/Normation/rudder-packages/pull/1241
Actions #3

Updated by Vincent MEMBRÉ about 7 years ago

  • Status changed from Pending technical review to Pending release
  • % Done changed from 0 to 100
Actions #4

Updated by Vincent MEMBRÉ about 7 years ago

  • Parent task set to #9714
Actions #5

Updated by Vincent MEMBRÉ about 7 years ago

  • Status changed from Pending release to Released

This bug has been fixed in Rudder 4.1.0 which was released today.

Actions

Also available in: Atom PDF