set_variable_values_ini() with 3.18.2

112 views
Skip to first unread message

Bob

unread,
Aug 10, 2022, 5:25:28 PM8/10/22
to help-cfengine
I am using community version 3.18.2 on both Debian 10 and Debian 11. When I upgraded from 3.15.1 I started getting these errors:

 verbose: P:    Stack path: /default/main/methods/'Local policies in no specified order'/default/sitemain/files/'/etc/xrdp/sesman.ini'/default/set_variable_values_ini/field_edits/'.+\s:AlwaysGroupCheck\s:=.:'[1]
 verbose: Additional promise info: version 'CFEngine Promises.cf 3.18.2' source
path '/var/cfengine/inputs/lib/files.cf' at line 446
   error: No matched line to edit fields of for pattern '#+\s*AlwaysGroupCheck\s*=.*' in '/etc/xrdp/sesman.ini'
   error: Errors encountered when actuating fields_edit promise '#+\s*AlwaysGroupCheck\s*=.*'

Background: I set up a variable to edit the /etc/xrdp/sessman.ini file as follows:

vars:
    "sesman_ini[Security][AllowRootLogin]" string => "false";
    "sesman_ini[Security][TerminalServerUsers]" string => "xrdp";
    "sesman_ini[Security][AlwaysGroupCheck]" string => "true";

files:
    "/etc/xrdp/sesman.ini"
    comment       => "Custom sesman.ini settings for xrdp",
    edit_line     => set_variable_values_ini("siteg.sesman_ini", "Security"),
    classes       => if_repaired("restart_xrdp");


The good news is the edits I need are happening, but the errors are getting logged. Anyway to get rid of these errors?

Vratislav Podzimek

unread,
Aug 16, 2022, 8:28:36 AM8/16/22
to help-c...@googlegroups.com
On Wed, 2022-08-10 at 14:25 -0700, Bob wrote:
> I am using community version 3.18.2 on both Debian 10 and Debian 11. When I upgraded from 3.15.1 I
> started getting these errors:
>
>  verbose: P:    Stack path: /default/main/methods/'Local policies in no specified
> order'/default/sitemain/files/'/etc/xrdp/sesman.ini'/default/set_variable_values_ini/field_edits/'
> .+\s:AlwaysGroupCheck\s:=.:'[1]
>  verbose: Additional promise info: version 'CFEngine Promises.cf 3.18.2' source
> path '/var/cfengine/inputs/lib/files.cf' at line 446
>    error: No matched line to edit fields of for pattern '#+\s*AlwaysGroupCheck\s*=.*' in
> '/etc/xrdp/sesman.ini'
>    error: Errors encountered when actuating fields_edit promise '#+\s*AlwaysGroupCheck\s*=.*'
Hi Bob,
these errors are a result of a change [1] in the edit_line implementation to better inform users
what is happening (the referenced private ticket has a title "Make sure all files and packages
promises inform about all changes they make"). But since you are using the 'set_variable_values_ini'
edit_line bundle, there's no way for you to fix this in your policy. It is actually a bug in the
'set_variable_values_ini' bundle. Feel free to report it. [2]

[1] https://github.com/cfengine/core/commit/9f114044d2530c20797d0c1cac51d2892b476b5f
[2] https://tracker.mender.io

--
Vratislav
signature.asc

mosc...@metalabs.de

unread,
Feb 8, 2023, 10:47:54 AM2/8/23
to help-cfengine
Hi everyone,

this issue still persists, right?
 
Regards,
Moritz

Nick Anderson

unread,
Feb 8, 2023, 1:04:49 PM2/8/23
to mosc...@metalabs.de, help-cfengine
Is there a ticket?

--
You received this message because you are subscribed to the Google Groups "help-cfengine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to help-cfengin...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/help-cfengine/8152cac5-a924-435c-87d9-b65d95539f81n%40googlegroups.com.

Nick Anderson

unread,
Feb 8, 2023, 1:13:15 PM2/8/23
to mosc...@metalabs.de, help-cfengine
Quickly reviewed the full thread, I don't think an issue was opened. Sounds like it could be an easy fix, but we need a ticket, reproduction information, ideally standalone policy to reproduce, better if it's in the form of an actual pr adding test. 

I'm traveling, will try to remember to follow up but no promises.
Message has been deleted

t.d...@servicemusic.org.uk

unread,
Aug 16, 2024, 5:17:49 PM8/16/24
to help-cfengine
Is there any progress on this, please?  It is somewhat of an irritant to us and our logging!

Thanks.

-- David Lee

Nick Anderson

unread,
Aug 19, 2024, 5:01:33 PM8/19/24
to t.d...@servicemusic.org.uk, help-c...@googlegroups.com
"t.d...@servicemusic.org.uk" <t.d...@servicemusic.org.uk> writes:

> Is there any progress on this, please? It is somewhat of an irritant to us and our logging!
>
> Thanks.

Hi David


I didn't see a ticket in this thread to check status on, probably
no work has been done.

PRs are great if you know how to fix, but at least having a standalone
policy file that reproduces the issue is necessary.

If you can make sure there is a ticket that at least contains a
reproducer then there is better chance of something happening.


--
Nick Anderson | Doer of Things | (+1) 785-550-1767 | https://northern.tech

t.d...@servicemusic.org.uk

unread,
Nov 15, 2024, 10:48:03 AM11/15/24
to help-cfengine
I had lost track of the fact you still needed me to provide a test case.

Here it is.  It is extracted from a real part of our policy, setting a key=value in RH8 "/etc/dnf/automatic.conf" (I've slightly tweaked it to make it standalone and using a safe target file).

Run it at least twice (or as often as you like).  You'll see that although the target file successfully converges, CFE persists in (falsely) reporting errors.

Please could you take it forward from this?

=================================================================
#
# Demonstrate CFEngine "edit_line" bug:
#

body file control
{
      inputs => { "/var/cfengine/inputs/lib/files.cf" };
}

bundle agent __main__
{    
  vars:
    any::
      #"fname" string => "/etc/dnf/automatic.conf";
      "fname" string => "/tmp/automatic.conf";

      "tab[commands][apply_updates]" string => "no";

  files:
    any::
      "$(fname)"
        edit_line => set_variable_values_ini("$(this.bundle).tab", "commands");

}
=================================================================

Thanks.

-- David Lee

t.d...@servicemusic.org.uk

unread,
Dec 5, 2024, 9:34:55 AM12/5/24
to help-cfengine
Any news on this, please?

Thanks.

-- David Lee
-- Diamond Light Source

Nick Anderson

unread,
Dec 5, 2024, 1:08:26 PM12/5/24
to help-cfengine
I took that snippet and created a ticket. https://northerntech.atlassian.net/browse/ENT-12503

t.d...@servicemusic.org.uk

unread,
Dec 5, 2024, 2:52:40 PM12/5/24
to help-cfengine

Thanks, Nick.

While I don't seem to have access to:

I can successfully see:

So the latter should be fine.

-- David Lee

t.d...@servicemusic.org.uk

unread,
Apr 4, 2025, 5:07:58 AMApr 4
to help-cfengine
Is there any progress report on this bug, please?

Thanks.

-- David Lee
-- Diamond Light Source

Nick Anderson

unread,
Apr 8, 2025, 11:26:46 AMApr 8
to help-cfengine
No, I don't see any changes to either ticket recently.
Reply all
Reply to author
Forward
0 new messages