Project

General

Profile

Actions

Bug #3126

closed

Reports containing CFEngine variable aren't displayed in the WebUI

Added by Nicolas PERRON over 11 years ago. Updated about 9 years ago.

Status:
Released
Priority:
1
Category:
Web - Config management
Target version:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
Name check:
Fix check:
Regression:

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.


Related issues 2 (0 open2 closed)

Blocked by Rudder - Bug #3158: The reporting keys in Rudder are artificially limited to 64 charactersReleasedJonathan CLARKE2013-01-08Actions
Blocked by Rudder - Bug #3160: Using \" in component key values leads to invalid reporting valuesReleasedFrançois ARMAND2013-01-08Actions
Actions #1

Updated by Nicolas CHARLES over 11 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

Actions #2

Updated by Jonathan CLARKE over 11 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.

Actions #3

Updated by Nicolas CHARLES over 11 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

Actions #4

Updated by Nicolas CHARLES over 11 years ago

I'm checking if the \" -> " exists also on rudder 2.3

Actions #5

Updated by Nicolas PERRON over 11 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

Actions #6

Updated by Nicolas PERRON over 11 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

Actions #7

Updated by Nicolas PERRON over 11 years ago

  • Assignee changed from Nicolas PERRON to Nicolas CHARLES
Actions #8

Updated by Nicolas PERRON over 11 years ago

  • Target version changed from 2.4.2 to 2.4.3
Actions #9

Updated by Nicolas CHARLES over 11 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)

Actions #10

Updated by Jonathan CLARKE over 11 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.

Actions #11

Updated by Nicolas CHARLES over 11 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

Actions #12

Updated by Nicolas CHARLES over 11 years ago

  • Status changed from Discussion to Pending technical review

This bug is resolved by the correction of of #3158 and #3160

Actions #13

Updated by Jonathan CLARKE about 11 years ago

  • Status changed from Pending technical review to Pending release
Actions #14

Updated by Nicolas PERRON about 11 years ago

  • Status changed from Pending release to Released
Actions #15

Updated by Benoît PECCATTE about 9 years ago

  • Category changed from 14 to Web - Config management
Actions

Also available in: Atom PDF