Bug #1896
closedCFEngine package method seems to confuse class names
Added by Jonathan CLARKE almost 13 years ago. Updated over 9 years ago.
Description
Trying to install 2 packages, defining a result class for each based on the package name:
rudder> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> rudder> Offering these package-promise suggestions to the managers rudder> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> rudder> -> Deletion schedule... rudder> -> Addition schedule... rudder> Execute scheduled package addition rudder> Command prefix: /usr/bin/yum -y install rudder> Executing /usr/bin/yum -y install git-core.*... rudder> Q:yum -y install git-c ...:Loaded plugins: fastestmirror rudder> Q:yum -y install git-c ...:Loading mirror speeds from cached hostfile rudder> Q:yum -y install git-c ...: * base: mirror.ovh.net rudder> Q:yum -y install git-c ...: * epel: mirror01.th.ifl.net rudder> Q:yum -y install git-c ...: * extras: mirror.ovh.net rudder> Q:yum -y install git-c ...: * updates: mirror.ovh.net rudder> Q:yum -y install git-c ...:Setting up Install Process rudder> Q:yum -y install git-c ...:No package git-core.* available. rudder> Q:yum -y install git-c ...:Nothing to do rudder> Q:yum -y install git-c ...: rudder> -> Command related to promiser "git-core" returned code defined as promise kept (0) rudder> ?> defining promise result class rpm_package_install_kept_git_core rudder> Package schedule execution ok for git-core.* (outcome cannot be promised by cf-agent) rudder> Executing /usr/bin/yum -y install vim.*... rudder> Q:yum -y install vim.* ...:Loaded plugins: fastestmirror rudder> Q:yum -y install vim.* ...:Loading mirror speeds from cached hostfile rudder> Q:yum -y install vim.* ...: * base: mirror.ovh.net rudder> Q:yum -y install vim.* ...: * epel: mirror01.th.ifl.net rudder> Q:yum -y install vim.* ...: * extras: mirror.ovh.net rudder> Q:yum -y install vim.* ...: * updates: mirror.ovh.net rudder> Q:yum -y install vim.* ...:Setting up Install Process rudder> Q:yum -y install vim.* ...:No package vim.* available. rudder> Q:yum -y install vim.* ...:Nothing to do rudder> Q:yum -y install vim.* ...: rudder> -> Command related to promiser "git-core" returned code defined as promise kept (0) rudder> ?> defining promise result class rpm_package_install_kept_git_core
Note that after trying to install package vim, CFEngine defines the class rpm_package_install_kept_*git_core* (which is wrong!)
Files
Updated by Jonathan CLARKE almost 13 years ago
I think a solution that might work for this is calling a separate bundle to install a package. I'm not sure, but it's worth a try.
Updated by Nicolas CHARLES almost 13 years ago
Isn't it because of a bulk package install, preventing CFEngine to effectively separate each packages installation ?
Updated by Jonathan CLARKE almost 13 years ago
- Target version changed from 23 to 2.3.0
Updated by Matthieu CERDA almost 13 years ago
- Status changed from 2 to In progress
After a short diving session in the CFengine SVN, we found a commit that might match this bug : r3007
Patch :
--- src/verify_packages.c (révision 3006) +++ src/verify_packages.c (révision 3007) @@ -1688,7 +1688,7 @@ } else { - cfPS(cf_error,CF_FAIL,"",pp,a,"!! Package \"%s\" cannot be verified -- no match\n",pp->promiser); + cfPS(cf_inform,CF_FAIL,"",pp,a,"!! Package \"%s\" cannot be verified -- no match\n",pp->promiser); } break; @@ -1960,7 +1960,7 @@ ReplaceStr(line,lineSafe,sizeof(lineSafe),"%","%%"); CfOut(cf_inform,"","Q:%20.20s ...:%s",cmd,lineSafe); - if (line[0] != '\0' && verify) + if (verify && line[0] != '\0') { if (a.packages.package_noverify_regex) { @@ -1976,21 +1976,25 @@ packmanRetval = cf_pclose(pfp); - if(verify) // return code check for verify policy + if(verify && a.packages.package_noverify_returncode != CF_NOINT) { - if(a.packages.package_noverify_returncode != CF_NOINT) + if(a.packages.package_noverify_returncode == packmanRetval) { - if(a.packages.package_noverify_returncode == packmanRetval) - { - cfPS(cf_inform,CF_FAIL,"",pp,a,"!! Package verification error (returned %d)",packmanRetval); - retval = false; - } - else - { - CfOut(cf_verbose, "", " Package successfully verified from return code"); - } + cfPS(cf_inform,CF_FAIL,"",pp,a,"!! Package verification error (returned %d)",packmanRetval); + retval = false; } + else + { + cfPS(cf_inform,CF_NOP,"",pp,a,"-> Package verification succeeded (returned %d)",packmanRetval); + } } + else if(verify && a.packages.package_noverify_regex) + { + if(retval) // set status if we succeeded above + { + cfPS(cf_inform,CF_NOP,"",pp,a,"-> Package verification succeeded (no match with package_noverify_regex)"); + } + } else if(setCmdClasses) // generic return code check { retval = VerifyCommandRetcode(packmanRetval,true,a,pp);
I will confirm the bug on our version, and try to recompile it with this patch for testing purpose.
Updated by Matthieu CERDA almost 13 years ago
- Status changed from In progress to Discussion
- % Done changed from 0 to 20
This is a bug. It has been reported to CFengine => https://cfengine.com/bugtracker/view.php?id=831 , now we have to wait for a solution.
Updated by Matthieu CERDA almost 13 years ago
Note : The commit 3007 in CFengine's SVN was a failure.
Updated by François ARMAND almost 13 years ago
- Target version changed from 2.3.0 to 2.3.1
Updated by Jonathan CLARKE almost 13 years ago
- Target version changed from 2.3.1 to 2.3.2
Updated by Jonathan CLARKE almost 13 years ago
- Target version changed from 2.3.2 to 2.3.3
Updated by Jonathan CLARKE over 12 years ago
- Target version changed from 2.3.3 to 2.3.4
Updated by Jonathan CLARKE over 12 years ago
- Target version changed from 2.3.4 to 2.3.7
Updated by Nicolas PERRON over 12 years ago
- Target version changed from 2.3.7 to 2.3.8
It seems that this bug has not been fixed yet.
Updated by Jonathan CLARKE about 12 years ago
According to https://cfengine.com/bugtracker/view.php?id=829, this will be fixed in CFEngine 3.3.4.
Updated by Jonathan CLARKE about 12 years ago
The patch is here: https://github.com/cfengine/core/commit/201f3abc9c94254b1d87233f1a8cd5483f20320e
We should test this and apply it for 2.3.8 and 2.4.0 if possible.
Updated by Jonathan CLARKE about 12 years ago
- Target version changed from 2.3.8 to 2.3.9
Updated by Jonathan CLARKE almost 12 years ago
- Assignee deleted (
Matthieu CERDA)
Updated by Nicolas PERRON over 11 years ago
- Category changed from 14 to 11
- Status changed from Discussion to In progress
This should not be in a Discussion state since a patch must be applied during packaging.
Updated by Nicolas PERRON over 11 years ago
- Target version changed from 2.3.9 to 2.3.10
Updated by Nicolas CHARLES over 11 years ago
- Assignee set to Nicolas PERRON
Nicolas, you set this ticket in Progress without any assignee. A ticket in progress must have an assigne, so I assign it to you.
Updated by Matthieu CERDA over 11 years ago
- Assignee changed from Nicolas PERRON to Matthieu CERDA
I'll catch this, since NPE is unavailable at the moment.
Updated by Matthieu CERDA over 11 years ago
- Status changed from In progress to Discussion
- Assignee changed from Matthieu CERDA to Jonathan CLARKE
I took a look at the CFEngine 3.2.0 and 3.2.4 code base (= Rudder 2.3 and 2.4), and the patch is totally inapplicable.
As discussed with NCH, the patch is originally made for the CFEngine 3.3.X code base, that has been drastically simplified and modified by Mikhail Gusarov, and the impacted function is completely different, see the example below:
static int ExecuteSchedule(struct CfPackageManager *schedule,enum package_actions action) { struct CfPackageItem *pi; struct CfPackageManager *pm; int size,estimated_size,retval = true,verify = false; char *command_string = NULL; struct Attributes a = {{0}}; struct Promise *pp; int ok; for (pm = schedule; pm != NULL; pm = pm->next) { if (pm->action != action) { continue; } if (pm->pack_list == NULL) { continue; } estimated_size = 0; for (pi = pm->pack_list; pi != NULL; pi=pi->next) { size = strlen(pi->name) + strlen(" "); switch (pm->policy) { case cfa_individual: if (size > estimated_size) { estimated_size = size + CF_MAXVARSIZE; } break; case cfa_bulk: estimated_size += size + CF_MAXVARSIZE; break; default: break; } } pp = pm->pack_list->pp; a = GetPackageAttributes(pp);
And the patch:
@@ -856,6 +856,9 @@ static int ExecuteSchedule(PackageManager *schedule, enum package_actions action for (pi = pm->pack_list; pi != NULL; pi = pi->next) { + pp = pi->pp; + a = GetPackageAttributes(pp); + char *sp, *offset = command_string + strlen(command_string); if (a.packages.package_file_repositories && (action == cfa_addpack || action == cfa_update))
I can not reasonably apply this patch blindly, without beeing able to balance the consequences, I'm sorry.
Jon, what should we do here ?
Updated by François ARMAND over 11 years ago
For now, we use the following the workaround (and we don't see any other way to proceed until switching to a newer version of Rudder, see #2519 )
Updated by Matthieu CERDA over 11 years ago
- Target version changed from 2.3.10 to 2.3.11
Updated by Nicolas PERRON over 11 years ago
- Project changed from Rudder to 34
- Category deleted (
11)
Updated by Matthieu CERDA over 11 years ago
- Target version changed from 2.3.11 to 2.3.12
Updated by Matthieu CERDA over 11 years ago
- Target version changed from 2.3.12 to 2.3.13
Updated by Nicolas PERRON about 11 years ago
- Target version changed from 2.3.13 to 84
Updated by Nicolas PERRON about 11 years ago
- Target version changed from 84 to 2.4.7
Updated by Nicolas PERRON about 11 years ago
- Target version changed from 2.4.7 to 2.4.8
Updated by Jonathan CLARKE about 11 years ago
- Assignee deleted (
Jonathan CLARKE) - Priority changed from 2 to 3
I have just checked and I confirm that this issue is no longer present in CFEngine 3.4 (and therefore in Rudder 2.6+).
It does however still affect CFEngine 3.2 and therefore Rudder 2.4 (and 2.3 and 2.5 but they are no longer supported). Fixing this in CFEngine 3.2 is non trivial, and upstream has been clear they do not intend to provide patches or new versions on older releases.
As a result, I can't see us putting a high priority on this bug, for now.
Updated by Jonathan CLARKE about 11 years ago
Actually, I take that back, it's not that hard. I attach a patch that should fix this. I haven't tested it, but it is issued from https://cfengine.com/bugtracker/view.php?id=829 and seems logical to me.
Updated by Nicolas PERRON almost 11 years ago
- Target version changed from 2.4.8 to 2.4.9
Updated by Nicolas PERRON almost 11 years ago
- Status changed from Discussion to New
Updated by Nicolas PERRON almost 11 years ago
- Target version changed from 2.4.9 to 2.4.10
Updated by Nicolas PERRON almost 11 years ago
- Target version changed from 2.4.10 to 2.4.11
Updated by Nicolas PERRON almost 11 years ago
- Target version changed from 2.4.11 to 2.4.12
Updated by Nicolas PERRON over 10 years ago
- Target version changed from 2.4.12 to 2.4.13
Updated by Vincent MEMBRÉ over 10 years ago
- Target version changed from 2.4.13 to 2.6.11
Since version 2.4 is not maintained anymore, retageting this issue to 2.6
Updated by Vincent MEMBRÉ over 10 years ago
- Target version changed from 2.6.11 to 2.6.12
Updated by Vincent MEMBRÉ over 10 years ago
- Target version changed from 2.6.12 to 2.6.13
Updated by Vincent MEMBRÉ about 10 years ago
- Target version changed from 2.6.13 to 2.6.14
Updated by Jonathan CLARKE about 10 years ago
- Target version changed from 2.6.14 to 2.6.16
Updated by Jonathan CLARKE about 10 years ago
- Target version changed from 2.6.16 to 2.6.17
Updated by Nicolas PERRON about 10 years ago
- Target version changed from 2.6.17 to 2.6.18
Updated by Matthieu CERDA almost 10 years ago
- Target version changed from 2.6.18 to 2.6.19
Updated by Vincent MEMBRÉ almost 10 years ago
- Target version changed from 2.6.19 to 2.6.20
Updated by François ARMAND over 9 years ago
- Assignee set to Jonathan CLARKE
This ticket seems to be out of date, since we only support CFEngine >= 3.5 now.
Could it be closed as won't fix - 2.6 not supported anymore ?
Updated by François ARMAND over 9 years ago
- Target version changed from 2.6.20 to 2.10.10
Updated by Vincent MEMBRÉ over 9 years ago
- Target version changed from 2.10.10 to 2.10.11
Updated by Vincent MEMBRÉ over 9 years ago
- Target version changed from 2.10.11 to 2.10.12
Updated by Benoît PECCATTE over 9 years ago
- Project changed from 34 to Rudder
- Category set to Packaging
Updated by Vincent MEMBRÉ over 9 years ago
- Target version changed from 2.10.12 to 2.10.13
Updated by Vincent MEMBRÉ over 9 years ago
- Target version changed from 2.10.13 to 2.10.14
Updated by Benoît PECCATTE over 9 years ago
- Assignee changed from Jonathan CLARKE to Nicolas CHARLES
Nicolas ?
Isn't this the bug you are working on ?
Updated by Benoît PECCATTE over 9 years ago
- Status changed from New to Rejected
Bug no longer present in 3.4 and later.
Closing