Project

General

Profile

Actions

Bug #5739

closed

The agent doesn't manage properly non modifiable files

Added by Benoît PECCATTE over 9 years ago. Updated about 2 years ago.

Status:
Resolved
Priority:
N/A
Assignee:
-
Category:
Agent
Target version:
Severity:
Major - prevents use of part of Rudder | no simple workaround
UX impact:
User visibility:
Infrequent - complex configurations | third party integrations
Effort required:
Very Small
Priority:
70
Name check:
Fix check:
Regression:

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

Actions #1

Updated by Jonathan CLARKE over 9 years ago

  • Target version changed from 3.0.0~beta1 to 3.0.0~beta2
Actions #2

Updated by François ARMAND over 9 years ago

  • Target version changed from 3.0.0~beta2 to 3.0.0~rc1
Actions #3

Updated by Vincent MEMBRÉ over 9 years ago

  • Target version changed from 3.0.0~rc1 to 3.0.0
Actions #4

Updated by François ARMAND over 9 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

Actions #5

Updated by Vincent MEMBRÉ over 9 years ago

  • Target version changed from 2.10.9 to 2.10.10
Actions #6

Updated by Vincent MEMBRÉ over 9 years ago

  • Target version changed from 2.10.10 to 2.10.11
Actions #7

Updated by Vincent MEMBRÉ over 9 years ago

  • Target version changed from 2.10.11 to 2.10.12
Actions #8

Updated by Vincent MEMBRÉ about 9 years ago

  • Target version changed from 2.10.12 to 2.10.13
Actions #9

Updated by Nicolas CHARLES about 9 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 ?

Actions #10

Updated by Benoît PECCATTE about 9 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

Actions #11

Updated by François ARMAND about 9 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 :)

Actions #12

Updated by Vincent MEMBRÉ about 9 years ago

  • Target version changed from 2.10.13 to 2.10.14
Actions #13

Updated by Vincent MEMBRÉ about 9 years ago

  • Target version changed from 2.10.14 to 2.10.15
Actions #14

Updated by Vincent MEMBRÉ almost 9 years ago

  • Target version changed from 2.10.15 to 2.10.16
Actions #15

Updated by Vincent MEMBRÉ almost 9 years ago

  • Target version changed from 2.10.16 to 2.10.17
Actions #16

Updated by Vincent MEMBRÉ over 8 years ago

  • Target version changed from 2.10.17 to 2.10.18
Actions #17

Updated by Vincent MEMBRÉ over 8 years ago

  • Target version changed from 2.10.18 to 2.10.19
Actions #18

Updated by Vincent MEMBRÉ over 8 years ago

  • Target version changed from 2.10.19 to 2.10.20
Actions #19

Updated by Vincent MEMBRÉ over 8 years ago

  • Target version changed from 2.10.20 to 277
Actions #20

Updated by Vincent MEMBRÉ over 8 years ago

  • Target version changed from 277 to 2.11.18
Actions #21

Updated by Vincent MEMBRÉ over 8 years ago

  • Target version changed from 2.11.18 to 2.11.19
Actions #22

Updated by Vincent MEMBRÉ over 8 years ago

  • Target version changed from 2.11.19 to 2.11.20
Actions #23

Updated by Vincent MEMBRÉ about 8 years ago

  • Target version changed from 2.11.20 to 2.11.21
Actions #24

Updated by François ARMAND about 8 years ago

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

Actions #25

Updated by Vincent MEMBRÉ about 8 years ago

  • Target version changed from 2.11.21 to 2.11.22
Actions #26

Updated by Vincent MEMBRÉ about 8 years ago

  • Target version changed from 2.11.22 to 2.11.23
Actions #27

Updated by Vincent MEMBRÉ almost 8 years ago

  • Target version changed from 2.11.23 to 2.11.24
Actions #28

Updated by Alexis Mousset almost 8 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
Actions #29

Updated by Alexis Mousset almost 8 years ago

Still true in 3.1.

Actions #30

Updated by Alexis Mousset almost 8 years ago

And on master too.

Actions #31

Updated by Vincent MEMBRÉ almost 8 years ago

  • Target version changed from 2.11.24 to 308
Actions #32

Updated by Vincent MEMBRÉ almost 8 years ago

  • Target version changed from 308 to 3.1.14
Actions #33

Updated by Vincent MEMBRÉ over 7 years ago

  • Target version changed from 3.1.14 to 3.1.15
Actions #34

Updated by Vincent MEMBRÉ over 7 years ago

  • Target version changed from 3.1.15 to 3.1.16
Actions #35

Updated by Vincent MEMBRÉ over 7 years ago

  • Target version changed from 3.1.16 to 3.1.17
Actions #36

Updated by Vincent MEMBRÉ over 7 years ago

  • Target version changed from 3.1.17 to 3.1.18
Actions #37

Updated by Vincent MEMBRÉ over 7 years ago

  • Target version changed from 3.1.18 to 3.1.19
Actions #38

Updated by François ARMAND about 7 years 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
Actions #39

Updated by Vincent MEMBRÉ about 7 years ago

  • Target version changed from 3.1.19 to 3.1.20
Actions #40

Updated by Jonathan CLARKE about 7 years ago

  • Assignee deleted (Alexis Mousset)
Actions #41

Updated by Alexis Mousset about 7 years 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.

Actions #42

Updated by Vincent MEMBRÉ about 7 years ago

  • Target version changed from 3.1.20 to 3.1.21
Actions #43

Updated by Vincent MEMBRÉ almost 7 years ago

  • Target version changed from 3.1.21 to 3.1.22
Actions #44

Updated by Benoît PECCATTE almost 7 years ago

  • Priority changed from 0 to 20
Actions #45

Updated by Vincent MEMBRÉ almost 7 years ago

  • Target version changed from 3.1.22 to 3.1.23
Actions #46

Updated by Vincent MEMBRÉ almost 7 years ago

  • Target version changed from 3.1.23 to 3.1.24
Actions #47

Updated by Vincent MEMBRÉ over 6 years ago

  • Target version changed from 3.1.24 to 3.1.25
Actions #48

Updated by Vincent MEMBRÉ over 6 years ago

  • Target version changed from 3.1.25 to 387
Actions #49

Updated by Vincent MEMBRÉ over 6 years ago

  • Target version changed from 387 to 4.1.10
Actions #50

Updated by Vincent MEMBRÉ over 6 years ago

  • Target version changed from 4.1.10 to 4.1.11
  • Priority changed from 20 to 21
Actions #51

Updated by Vincent MEMBRÉ about 6 years ago

  • Target version changed from 4.1.11 to 4.1.12
Actions #52

Updated by Vincent MEMBRÉ about 6 years ago

  • Target version changed from 4.1.12 to 4.1.13
Actions #53

Updated by Vincent MEMBRÉ almost 6 years ago

  • Target version changed from 4.1.13 to 4.1.14
Actions #54

Updated by Benoît PECCATTE almost 6 years ago

  • Target version changed from 4.1.14 to 4.1.15
  • Priority changed from 21 to 22
Actions #55

Updated by Vincent MEMBRÉ over 5 years ago

  • Target version changed from 4.1.15 to 4.1.16
Actions #56

Updated by Vincent MEMBRÉ over 5 years ago

  • Target version changed from 4.1.16 to 4.1.17
Actions #57

Updated by Vincent MEMBRÉ over 5 years ago

  • Target version changed from 4.1.17 to 4.1.18
Actions #58

Updated by Vincent MEMBRÉ over 5 years ago

  • Target version changed from 4.1.18 to 4.1.19
Actions #59

Updated by Alexis Mousset over 5 years ago

  • Target version changed from 4.1.19 to 4.1.20
  • Priority changed from 22 to 23
Actions #60

Updated by Alexis Mousset almost 5 years ago

  • Target version changed from 4.1.20 to 588
Actions #61

Updated by Alexis Mousset almost 5 years ago

  • Target version changed from 588 to 5.0.13
Actions #62

Updated by Vincent MEMBRÉ almost 5 years ago

  • Target version changed from 5.0.13 to 5.0.14
  • Priority changed from 23 to 24
Actions #63

Updated by Vincent MEMBRÉ over 4 years ago

  • Target version changed from 5.0.14 to 5.0.15
Actions #64

Updated by Vincent MEMBRÉ over 4 years ago

  • Target version changed from 5.0.15 to 5.0.16
Actions #65

Updated by Alexis Mousset over 4 years ago

  • Target version changed from 5.0.16 to 5.0.17
Actions #66

Updated by Vincent MEMBRÉ about 4 years ago

  • Target version changed from 5.0.17 to 5.0.18
Actions #67

Updated by Vincent MEMBRÉ almost 4 years ago

  • Target version changed from 5.0.18 to 5.0.19
Actions #68

Updated by Vincent MEMBRÉ almost 4 years ago

  • Target version changed from 5.0.19 to 5.0.20
Actions #69

Updated by Vincent MEMBRÉ over 3 years ago

  • Target version changed from 5.0.20 to 797
Actions #70

Updated by Benoît PECCATTE almost 3 years ago

  • Target version changed from 797 to 6.1.14
Actions #71

Updated by Vincent MEMBRÉ almost 3 years ago

  • Target version changed from 6.1.14 to 6.1.15
Actions #72

Updated by Vincent MEMBRÉ almost 3 years ago

  • Target version changed from 6.1.15 to 6.1.16
Actions #73

Updated by Vincent MEMBRÉ almost 3 years ago

  • Target version changed from 6.1.16 to 6.1.17
Actions #74

Updated by Vincent MEMBRÉ over 2 years ago

  • Target version changed from 6.1.17 to 6.1.18
Actions #75

Updated by Vincent MEMBRÉ over 2 years ago

  • Target version changed from 6.1.18 to 6.1.19
Actions #76

Updated by François ARMAND over 2 years ago

  • Subject changed from The agent doesn't manage properly non modifiable files to Validate that cf-agent 3.18 properly manage non modifiable files
  • Effort required changed from Medium to Very Small
  • Priority changed from 24 to 70

It was tracked on https://tracker.mender.io/browse/CFE-821

But https://tracker.mender.io/browse/CFE-3578 seems to be a duplicate and was corrected in CFE 3.18 => need validation

Setting to very small for the validation

Actions #77

Updated by Alexis Mousset over 2 years ago

  • Subject changed from Validate that cf-agent 3.18 properly manage non modifiable files to The agent doesn't manage properly non modifiable files

Still true, it only fixes the classes for permission attribute, but not content (which is way trickier due to files promises architecture).

Actions #78

Updated by Alexis Mousset about 2 years ago

  • Status changed from New to Resolved

This is fixed in latest master https://tracker.mender.io/browse/CFE-821

Actions

Also available in: Atom PDF