ensure => absent errors

9 views
Skip to first unread message

Alan Batie

unread,
May 6, 2020, 7:29:58 PM5/6/20
to Rex Users

desc "test ensuring group absent";

task "group_absent", sub {

   group "games", gid => 20, ensure => "absent";

};

# rex group_absent

[2020-05-06 16:25:49] INFO - Running task group_absent on <local>

[2020-05-06 16:25:50] ERROR - Error executing task:

[2020-05-06 16:25:50] ERROR - Error deleting group games at /usr/local/share/perl5/Rex/User/Linux.pm line 511, <> line 30.


[2020-05-06 16:25:50] ERROR - 1 out of 1 task(s) failed:

[2020-05-06 16:25:50] ERROR -   group_absent failed on <local>

[2020-05-06 16:25:50] ERROR -             Error deleting group games at /usr/local/share/perl5/Rex/User/Linux.pm line 511, <> line 30.


Why is this erroring?  The group doesn't exist, and that's what it's supposed to be making sure of, right?

Still happening with 1.10.0...

erkif...@gmail.com

unread,
May 16, 2020, 3:00:02 PM5/16/20
to rex-...@googlegroups.com
Hi Alan,

thanks for the post.

On 2020-05-06 16:29, Alan Batie wrote:
>
>
>desc "test ensuring group absent";
>
>task "group_absent", sub {
>
> group "games", gid => 20, ensure => "absent";
>
>};
>
># rex group_absent
>
>[2020-05-06 16:25:49] INFO - Running task group_absent on <local>
>
>[2020-05-06 16:25:50] ERROR - Error executing task:
>
>[2020-05-06 16:25:50] ERROR - Error deleting group games at
>/usr/local/share/perl5/Rex/User/Linux.pm line 511, <> line 30.
>
>
>[2020-05-06 16:25:50] ERROR - 1 out of 1 task(s) failed:
>
>[2020-05-06 16:25:50] ERROR - group_absent failed on <local>
>
>[2020-05-06 16:25:50] ERROR - Error deleting group games at /usr
>/local/share/perl5/Rex/User/Linux.pm line 511, <> line 30.
>
>Why is this erroring?

The exact reason for the error should be visible in the debug output
(rex -d group_absent).

>The group doesn't exist, and that's what it's
>supposed to be making sure of, right?

If it tries and fails to remove a non-existing group, then it does
indeed sound like a bug.

>Still happening with 1.10.0...

Sounds like you already experienced it with an earlier version too.
Please check our GitHub issue tracker[1] if this has been already
reported, and if not, make sure to create a bug report.

I expect a fix for this could definitely land in the next release.
Until then, as a workaround, you may check if the group exists first,
and then only call the removal if the group is there.

[1]: https://github.com/RexOps/Rex/issues

Cheers,
FErki

Alan Batie

unread,
May 16, 2020, 7:28:35 PM5/16/20
to rex-...@googlegroups.com
On 5/16/20 11:43 AM, erkif...@gmail.com wrote:

> If it tries and fails to remove a non-existing group, then it does
> indeed sound like a bug.

> Sounds like you already experienced it with an earlier version too.
> Please check our GitHub issue tracker[1] if this has been already
> reported, and if not, make sure to create a bug report.

Yes, I was running 1.5 before and upgraded to see if it was fixed.
Searching for a matching issue...was not obvious, so I created one,
sorry if it's a duplicate.

> I expect a fix for this could definitely land in the next release.
> Until then, as a workaround, you may check if the group exists first,
> and then only call the removal if the group is there.

That's exactly what I did; from looking at the code, it looks like the
fix is to have rm_group do that itself, as you actually do want other
errors to get returned. I included more details in the report:
https://github.com/RexOps/Rex/issues/1321

erkif...@gmail.com

unread,
May 21, 2020, 3:40:02 AM5/21/20
to rex-...@googlegroups.com
Hi Alan,

On 2020-05-16 16:28, Alan Batie wrote:

>That's exactly what I did; from looking at the code, it looks like the
>fix is to have rm_group do that itself, as you actually do want other
>errors to get returned. I included more details in the report:
>https://github.com/RexOps/Rex/issues/1321

thanks for the bug report! There's already a fix merged via
https://github.com/RexOps/Rex/pull/1322 for the next release, which
should arrive on 2020-06-05.

If you can give it a try before that by installing from source or using
a trial release later, let us know your experience.

Cheers,
FErki

Alan Batie

unread,
May 21, 2020, 6:40:51 PM5/21/20
to rex-...@googlegroups.com
On 5/21/20 12:31 AM, erkif...@gmail.com wrote:

> If you can give it a try before that by installing from source or using
> a trial release later, let us know your experience.

Yes, that seems to have fixed it, thanks!

Reply all
Reply to author
Forward
0 new messages