Project

General

Profile

Actions

Bug #11417

closed

Command "rudder remote run -a" does not warn about missing token

Added by Janos Mattyasovszky about 7 years ago. Updated almost 6 years ago.

Status:
Released
Priority:
N/A
Category:
Agent
Target version:
Severity:
Minor - inconvenience | misleading | easy workaround
UX impact:
User visibility:
Operational - other Techniques | Technique editor | Rudder settings
Effort required:
Very Small
Priority:
0
Name check:
Fix check:
Regression:

Description

When running rudder remote run -a, it does not show the error message if missing a token.

(review noteE: the correct command is: rudder remote run -at token
Any other combinaison (notably -a -t ) fails, at least on centos 7)

bash -x revealed:

+ full_api_call /api/nodes '' '' ''
[cut]
++ _get_conf '' token
++ conf=
++ name=token
++ conffile=/root/.rudder
++ '[' -f /root/.rudder ']'
++ return
+ token=
+ '[' -z '' ']'
+ echo 'A token is mandatory to query the server'
+ exit 1
parse error: Invalid numeric literal at line 1, column 2
error    Rudder agent was interrupted during execution by a fatal error
         Run with -i to see log messages.

## Summary #####################################################################
0 components verified in 0 directives
execution time: 0.01s
################################################################################

Recommending that the error message echo "A token is mandatory to query the server" is shown on stderr and that a sanity-check is run before full_api_call is actually used as input for a pipe, so that a valid pre-execution error message can be displayed to the user instead of guessing what "parse error: Invalid numeric literal at line 1, column 2" actually hides.

ver 4.1.7-2 sles11


Related issues 1 (0 open1 closed)

Related to Rudder - Bug #13897: Command "rudder remote run" must accept "-a -t" RejectedActions
Actions

Also available in: Atom PDF