Project

General

Profile

Actions

Bug #16700

closed

Garbled generated policies in 6.0

Added by Nicolas CHARLES about 4 years ago. Updated about 4 years ago.

Status:
Released
Priority:
N/A
Category:
Web - Config management
Target version:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
0
Name check:
Reviewed
Fix check:
Checked
Regression:

Description

Policy generation failed in 6.0, after https://issues.rudder.io/issues/16699

content is completly garbled

bundle agent cleanForceInventoryFlagFile
{

  files:
      "${g.rudder_base}/etc/force_inventory" 
        delete     => tidy,
        ifvarclass => "inventory_sent"; # if the force inventory file was present, and we successfully sent an inventory, clean up the flag file

}
icurl} --no-verify --put --authentication ${g.davuser}:${g.davpw} --file"; 
      "download_command_suffix"   string => "--url ${download_endpoint}";

  classes:
    any::
  insert_lines:
      "${file_edit_header}" 
        location    => start,
        insert_type => "preserve_block";
}

      "${str}" not_matching => "true";

  insert_lines:
      "${str}";
}

Files

promises.cf (34.7 KB) promises.cf Nicolas CHARLES, 2020-02-10 17:02
Actions #2

Updated by Nicolas CHARLES about 4 years ago

Removing the files fixes the issue

Adding random text at the end of the file breaks again

to reproduce:
cp -ar inputs inputs.new
[root@server cfengine-community]# cd inputs.new/
[root@server inputs.new]# vim promises.cf
Add some text at the end

policy generation fails

Actions #3

Updated by François ARMAND about 4 years ago

It seems that generation append to existing policy.new files in place of replacing them.

Actions #4

Updated by François ARMAND about 4 years ago

  • Status changed from New to In progress
  • Assignee set to François ARMAND
Actions #5

Updated by François ARMAND about 4 years ago

Actually, it only happens when the corrupted file is LONGER than the newly writen file. So, it's like there is "replace" which is done in place of an "overwrite".

Actions #6

Updated by François ARMAND about 4 years ago

  • Status changed from In progress to Pending technical review
  • Assignee changed from François ARMAND to Nicolas CHARLES
  • Pull Request set to https://github.com/Normation/rudder/pull/2762
Actions #7

Updated by François ARMAND about 4 years ago

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

Updated by François ARMAND about 4 years ago

  • Fix check changed from To do to Checked
Actions #9

Updated by Alexis Mousset about 4 years ago

  • Subject changed from garbled generated policies in 6.0 to Garbled generated policies in 6.0
  • Name check changed from To do to Reviewed
Actions #10

Updated by Vincent MEMBRÉ about 4 years ago

  • Status changed from Pending release to Released

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

Actions

Also available in: Atom PDF