Bug #3126
closedReports containing CFEngine variable aren't displayed in the WebUI
Description
Using a Directive returning special characters like CFEngine variables will lead to have no answer from the node in the Rudder WebUI.
An exemple would be to use the Technique JobScheduler with a command like this:
/bin/echo "This is a test" >> /tmp/my_own_log_on_${sys.host}.log 2>&1
The result will be to have a Rule with a "No Answer" state.
Updated by Nicolas CHARLES almost 12 years ago
- Status changed from New to Discussion
- Assignee changed from Nicolas CHARLES to Nicolas PERRON
Nicolas, could you show what appears in the technical logs for this directive ?
Are you sure your command line works ? the " should be escaped or the generated promises will be invalid
Updated by Jonathan CLARKE almost 12 years ago
It looks like the actual command that is run is used as the component Key in reporting on this Technique. So the logs will contain something along the lines of:
@@jobScheduler@@result_success@@$(job_scheduler_uuids[$(iterator)])@@Job@@/bin/echo "This is a test" >> /tmp/my_own_log.log 2>&1@@$(g.execRun)##$(g.uuid)@#Job returned a success return code after the last completed execution (/bin/echo "This is a test" >> /tmp/my_own_log.log 2>&1)
I'm unsure which character breaks reporting, but I'm sure it's pretty easy to reproduce on one of our machines.
Updated by Nicolas CHARLES almost 12 years ago
I can't exactly reproduice this error
I choosed the command
/bin/echo \"This is a test\" >> /tmp/my_own_log.log 2>&1
on CentOS
and it led to unknown reports with the key value
/bin/echo "This is a test" >> /tmp/my_own_log.log 2>&1
because the \" is converted to " within the cfengine code
Updated by Nicolas CHARLES almost 12 years ago
I'm checking if the \" -> " exists also on rudder 2.3
Updated by Nicolas PERRON almost 12 years ago
Nicolas CHARLES wrote:
I can't exactly reproduice this error
I choosed the command
[...]
on CentOS
and it led to unknown reports with the key value
[...]because the \" is converted to " within the cfengine code
Ok, the command to use was missing the tricky part: Use of CFEngine variable
Here is a command which turn to a "No Answer" state:
/bin/echo 'This is a test' >> /tmp/my_own_log_on_${sys.host}.log 2>&1
Updated by Nicolas PERRON almost 12 years ago
- Subject changed from Reports containing special characters aren't displayed in the WebUI to Reports containing CFEngine variable aren't displayed in the WebUI
- Description updated (diff)
Nicolas PERRON wrote:
Nicolas CHARLES wrote:
I can't exactly reproduice this error
I choosed the command
[...]
on CentOS
and it led to unknown reports with the key value
[...]because the \" is converted to " within the cfengine code
Ok, the command to use was missing the tricky part: Use of CFEngine variable
Here is a command which turn to a "No Answer" state:
[...]
As a consequence I change the title and description of the ticket
Updated by Nicolas PERRON almost 12 years ago
- Assignee changed from Nicolas PERRON to Nicolas CHARLES
Updated by Nicolas PERRON almost 12 years ago
- Target version changed from 2.4.2 to 2.4.3
Updated by Nicolas CHARLES almost 12 years ago
Ha, others bugs/details show that the logs are not sent to Rudder (or parsed by Rudder) for the line
R: @jobScheduler
@log_info@f3cc8d3a-cdae-4e7b-9b43-d8bec3686537
@4040600f-f01e-4471-93ec-fd03cf096d0d@17
@Job@/bin/echo This is a test >> /tmp/my_own_log_on_centos-5-32.log 2>&1
@2013-01-08 12:43:54+01:00##248c8e3d-1bf6-4bc1-9398-f8890b015a50@#The command will be run at a random time after 11:00 on this node (/bin/echo This is a test >> /tmp/my_own_log_on_centos-5-32.log 2>&1)
Updated by Jonathan CLARKE almost 12 years ago
Nicolas CHARLES wrote:
Ha, others bugs/details show that the logs are not sent to Rudder (or parsed by Rudder) for the line
R:@jobScheduler
@log_info@f3cc8d3a-cdae-4e7b-9b43-d8bec3686537
@4040600f-f01e-4471-93ec-fd03cf096d0d@17
@Job@/bin/echo This is a test >> /tmp/my_own_log_on_centos-5-32.log 2>&1
@2013-01-08 12:43:54+01:00##248c8e3d-1bf6-4bc1-9398-f8890b015a50@#The command will be run at a random time after 11:00 on this node (/bin/echo This is a test >> /tmp/my_own_log_on_centos-5-32.log 2>&1)
To tell which case it is (not sent to Rudder or not parsed by Rudder), check the intermediate syslogs: /var/log/syslog on the node and /var/log/rudder/reports/ on the Rudder server. If they contain the line, the problem is in the parsing by rsyslog.
Updated by Nicolas CHARLES almost 12 years ago
Ok, here the problem is our regexp for rsyslog, the component key is 64 character long max, and the key is 68 in this example
Updated by Nicolas CHARLES almost 12 years ago
- Status changed from Discussion to Pending technical review
Updated by Jonathan CLARKE almost 12 years ago
- Status changed from Pending technical review to Pending release
Updated by Nicolas PERRON almost 12 years ago
- Status changed from Pending release to Released
Updated by Benoît PECCATTE almost 10 years ago
- Category changed from 14 to Web - Config management