Project

General

Profile

Bug #5739

The agent doesn't manage properly non modifiable files

Added by Benoît PECCATTE about 4 years ago. Updated 25 days ago.

Status:
New
Priority:
N/A
Assignee:
-
Category:
Agent
Target version:
Pull Request:
Severity:
Major - prevents use of part of Rudder | no simple workaround
User visibility:
Infrequent - complex configurations | third party integrations
Effort required:
Medium
Priority:
22

Description

If a file is on a readonly filesystem, cfengine can't edit it but issues a promise_repaired.

Here is the code to test it : chattr +i /tmp/test

bundle agent test
{
      files:
         "/tmp/test" create    => "true",
         edit_line => edit_one_line;
}

body classes all
{
        promise_repaired => { "promise_repaired" };
        repair_failed => { "repair_failed" };
        repair_denied => { "repair_denied" };
        repair_timeout => { "repair_timeout" };
        promise_kept => { "promise_kept" };
        cancel_kept => { "cancel_kept" };
        cancel_repaired => { "cancel_repaired" };
        cancel_notkept => { "cancel_notkept" };
}

body location first_line

{
  before_after => "before";
  first_last => "first";
  select_line_matching => ".*";
}

bundle edit_line edit_one_line
{
        insert_lines:
                 "EDIT TEST !!" 
                classes => all,
                location => first_line;

        reports:
                promise_repaired::
                        "promise_repaired";
                repair_failed::
                        "repair_failed";
                repair_denied::
                        "repair_denied";
                repair_timeout::
                        "repair_timeout";
                promise_kept::
                        "promise_kept";
                cancel_kept::
                        "cancel_kept";
                cancel_repaired::
                        "cancel_repaired";
                cancel_notkept::
                        "cancel_notkept";
}

And the code to run it

echo test > /tmp/test
chattr +i /tmp/test
cf-agent -KI -f ./test.cf 
R: promise_repaired
2014-11-05T12:19:39+0100    error: /default/test4/files/'/tmp/test'[0]: Can't rename '/tmp/test.cf-after-edit' to '/tmp/test' - so promised edits could not be moved into place. (rename: Operation not permitted)
2014-11-05T12:19:39+0100    error: /default/test4/files/'/tmp/test'[0]: Unable to save file '/tmp/test' after editing

History

#1 Updated by Jonathan CLARKE about 4 years ago

  • Target version changed from 3.0.0~beta1 to 3.0.0~beta2

#2 Updated by François ARMAND about 4 years ago

  • Target version changed from 3.0.0~beta2 to 3.0.0~rc1

#3 Updated by Vincent MEMBRÉ almost 4 years ago

  • Target version changed from 3.0.0~rc1 to 3.0.0

#4 Updated by François ARMAND almost 4 years ago

  • Target version changed from 3.0.0 to 2.10.9

This seems to be an old bug, not specific to 3.0

#5 Updated by Vincent MEMBRÉ almost 4 years ago

  • Target version changed from 2.10.9 to 2.10.10

#6 Updated by Vincent MEMBRÉ almost 4 years ago

  • Target version changed from 2.10.10 to 2.10.11

#7 Updated by Vincent MEMBRÉ almost 4 years ago

  • Target version changed from 2.10.11 to 2.10.12

#8 Updated by Vincent MEMBRÉ almost 4 years ago

  • Target version changed from 2.10.12 to 2.10.13

#9 Updated by Nicolas CHARLES over 3 years ago

  • Assignee changed from Nicolas CHARLES to Benoît PECCATTE

This is a knwon bug in CFEngine ( https://dev.cfengine.com/issues/3184 ) and it seems it is fixed according to the ticket state
Benoit, could you check on 3.6.0 and 3.6.5 ?

#10 Updated by Benoît PECCATTE over 3 years ago

  • Assignee deleted (Benoît PECCATTE)

This bug has not been solved in 3.6.0 nor in 3.6.3 whereas cfe cfengine issue marks it as solved in 3.6.0

#11 Updated by François ARMAND over 3 years ago

  • Category set to Agent
  • Assignee set to Nicolas CHARLES

Nicolas, could you use your big voice on cfengine bugtracker to say it's not solved ? That would impress them much :)

#12 Updated by Vincent MEMBRÉ over 3 years ago

  • Target version changed from 2.10.13 to 2.10.14

#13 Updated by Vincent MEMBRÉ over 3 years ago

  • Target version changed from 2.10.14 to 2.10.15

#14 Updated by Vincent MEMBRÉ over 3 years ago

  • Target version changed from 2.10.15 to 2.10.16

#15 Updated by Vincent MEMBRÉ over 3 years ago

  • Target version changed from 2.10.16 to 2.10.17

#16 Updated by Vincent MEMBRÉ about 3 years ago

  • Target version changed from 2.10.17 to 2.10.18

#17 Updated by Vincent MEMBRÉ about 3 years ago

  • Target version changed from 2.10.18 to 2.10.19

#18 Updated by Vincent MEMBRÉ about 3 years ago

  • Target version changed from 2.10.19 to 2.10.20

#19 Updated by Vincent MEMBRÉ about 3 years ago

  • Target version changed from 2.10.20 to 277

#20 Updated by Vincent MEMBRÉ about 3 years ago

  • Target version changed from 277 to 2.11.18

#21 Updated by Vincent MEMBRÉ almost 3 years ago

  • Target version changed from 2.11.18 to 2.11.19

#22 Updated by Vincent MEMBRÉ almost 3 years ago

  • Target version changed from 2.11.19 to 2.11.20

#23 Updated by Vincent MEMBRÉ over 2 years ago

  • Target version changed from 2.11.20 to 2.11.21

#24 Updated by François ARMAND over 2 years ago

Nicolas or Jon, could you use you big voice on the CFEngine bugtracker ?

#25 Updated by Vincent MEMBRÉ over 2 years ago

  • Target version changed from 2.11.21 to 2.11.22

#26 Updated by Vincent MEMBRÉ over 2 years ago

  • Target version changed from 2.11.22 to 2.11.23

#27 Updated by Vincent MEMBRÉ over 2 years ago

  • Target version changed from 2.11.23 to 2.11.24

#28 Updated by Alexis MOUSSET over 2 years ago

  • Subject changed from cfengine doesn't manage properly non modifiable files to The agent doesn't manage properly non modifiable files
  • Assignee changed from Nicolas CHARLES to Alexis MOUSSET

#29 Updated by Alexis MOUSSET over 2 years ago

Still true in 3.1.

#30 Updated by Alexis MOUSSET over 2 years ago

And on master too.

#31 Updated by Vincent MEMBRÉ over 2 years ago

  • Target version changed from 2.11.24 to 308

#32 Updated by Vincent MEMBRÉ over 2 years ago

  • Target version changed from 308 to 3.1.14

#33 Updated by Vincent MEMBRÉ about 2 years ago

  • Target version changed from 3.1.14 to 3.1.15

#34 Updated by Vincent MEMBRÉ about 2 years ago

  • Target version changed from 3.1.15 to 3.1.16

#35 Updated by Vincent MEMBRÉ about 2 years ago

  • Target version changed from 3.1.16 to 3.1.17

#36 Updated by Vincent MEMBRÉ about 2 years ago

  • Target version changed from 3.1.17 to 3.1.18

#37 Updated by Vincent MEMBRÉ almost 2 years ago

  • Target version changed from 3.1.18 to 3.1.19

#38 Updated by François ARMAND over 1 year ago

  • Severity set to Major - prevents use of part of Rudder | no simple workaround
  • User visibility set to Infrequent - complex configurations | third party integrations
  • Priority set to 0

#39 Updated by Vincent MEMBRÉ over 1 year ago

  • Target version changed from 3.1.19 to 3.1.20

#40 Updated by Jonathan CLARKE over 1 year ago

  • Assignee deleted (Alexis MOUSSET)

#41 Updated by Alexis MOUSSET over 1 year ago

  • Effort required set to Medium

This happens because the definition of the outcome class is done in a completely separate context than the actual writing of the file. This probably requires quite a lot of refactoring the the files promises, setting to medium.

#42 Updated by Vincent MEMBRÉ over 1 year ago

  • Target version changed from 3.1.20 to 3.1.21

#43 Updated by Vincent MEMBRÉ over 1 year ago

  • Target version changed from 3.1.21 to 3.1.22

#44 Updated by Benoît PECCATTE over 1 year ago

  • Priority changed from 0 to 20

#45 Updated by Vincent MEMBRÉ over 1 year ago

  • Target version changed from 3.1.22 to 3.1.23

#46 Updated by Vincent MEMBRÉ over 1 year ago

  • Target version changed from 3.1.23 to 3.1.24

#47 Updated by Vincent MEMBRÉ about 1 year ago

  • Target version changed from 3.1.24 to 3.1.25

#48 Updated by Vincent MEMBRÉ about 1 year ago

  • Target version changed from 3.1.25 to 387

#49 Updated by Vincent MEMBRÉ 12 months ago

  • Target version changed from 387 to 4.1.10

#50 Updated by Vincent MEMBRÉ 10 months ago

  • Target version changed from 4.1.10 to 4.1.11
  • Priority changed from 20 to 21

#51 Updated by Vincent MEMBRÉ 8 months ago

  • Target version changed from 4.1.11 to 4.1.12

#52 Updated by Vincent MEMBRÉ 7 months ago

  • Target version changed from 4.1.12 to 4.1.13

#53 Updated by Vincent MEMBRÉ 5 months ago

  • Target version changed from 4.1.13 to 4.1.14

#54 Updated by Benoît PECCATTE 5 months ago

  • Target version changed from 4.1.14 to 4.1.15
  • Priority changed from 21 to 22

#55 Updated by Vincent MEMBRÉ 2 months ago

  • Target version changed from 4.1.15 to 4.1.16

#56 Updated by Vincent MEMBRÉ about 1 month ago

  • Target version changed from 4.1.16 to 4.1.17

#57 Updated by Vincent MEMBRÉ 25 days ago

  • Target version changed from 4.1.17 to 4.1.18

Also available in: Atom PDF