[PUP-639] If insync? on a property causes a failure then you get a failed event on the resource, rather than on the property Created: 2013/10/30  Updated: 2019/04/04  Resolved: 2013/11/07

Status: Resolved
Project: Puppet
Component/s: None
Affects Version/s: PUP 3.3.1
Fix Version/s: PUP 3.4.0

Type: Bug Priority: Normal
Reporter: Ruth Linehan Assignee: Ethan Brown
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by PUP-675 PR (2036): Issue/23081/report propert... Closed
Relates
relates to PUP-1524 Duplicate events since 3.4.0 Closed
relates to PUP-526 `name` attribute is not always inclu... Closed
Template:
Epic Link: PE 3.2 Requests
Story Points: 2
Sprint: Week 2013-10-30 to 2013-11-06, Week 2013-11-06 to 2013-11-13
QA Contact: Kurt Wall

 Description   

If you try to change the owner or group of a file to an owner/group that doesn't exist, you end up with a failure event for the whole resource, with no property listed in the event. We know what property failed, so the event should happen for that property, rather than for the whole resource/without a property.



 Comments   
Comment by Ruth Linehan [ 2013/10/30 ]

This affects Event Inspector, since Event Inspector de-duplicates events based on property, and these events don't have a property. However, when the issue is fixed, the change event will have a property of owner or group, so de-duplication doesn't happen and you will then see both the failed and changed events.

Comment by Michelle Johansen (Inactive) [ 2013/10/30 ]

Waiting on PE 3.2 priority decision

Comment by Kylo Ginsberg [ 2013/11/04 ]

Pairing with Andy on this.

Comment by Ethan Brown [ 2013/11/07 ]

Reverted to old master, verified no name with

```
bundle exec puppet apply -e 'file

{ "/tmp/foo" : owner => "nothere" }

'
```

In log

```
File[/tmp/foo]: !ruby/object:Puppet::Resource::Status
resource: File[/tmp/foo]
file:
line: 1
evaluation_time: 0.001141
change_count: 0
out_of_sync_count: 1
tags:

  • file
  • class
    time: 2013-11-07 11:57:55.776140 -05:00
    events:
  • !ruby/object:Puppet::Transaction::Event
    audited: false
    message: "Could not find user nothere"
    name: !ruby/sym resource_error
    status: failure
    time: 2013-11-07 11:57:55.777273 -05:00
    out_of_sync: true
    changed: false
    resource_type: File
    title: /tmp/foo
    skipped: false
    failed: true
    containment_path:
  • Stage[main]
  • ""
  • File[/tmp/foo]
    ```

Cherry-picked in commit from PR

```
bundle exec puppet apply -e 'file

{ "/tmp/foo" : owner => "nothere" }

'
```

Got

```
File[/tmp/foo]: !ruby/object:Puppet::Resource::Status
resource: File[/tmp/foo]
file:
line: 1
evaluation_time: 0.001683
change_count: 0
out_of_sync_count: 1
tags:

  • file
  • class
    time: 2013-11-07 11:50:59.398549 -05:00
    events:
  • !ruby/object:Puppet::Transaction::Event
    audited: false
    property: owner
    previous_value: 501
    desired_value: nothere
    historical_value:
    message: "change from Iristyle to nothere failed: Could not find user nothere"
    name: !ruby/sym owner_changed
    status: failure
    time: 2013-11-07 11:50:59.400037 -05:00
    out_of_sync: true
    changed: false
    resource_type: File
    title: /tmp/foo
    skipped: false
    failed: true
    containment_path:
  • Stage[main]
  • ""
  • File[/tmp/foo]
    ```
Generated at Sat Jan 25 00:34:49 PST 2020 using JIRA 7.7.1#77002-sha1:e75ca93d5574d9409c0630b81c894d9065296414.