Project

General

Profile

Actions

Bug #12482

closed

Error when upgrading from 4.1.11 to 4.2.5 on Debian 9

Added by Nicolas CHARLES over 6 years ago. Updated about 6 years ago.

Status:
Rejected
Priority:
N/A
Assignee:
-
Category:
Packaging
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:
Small
Priority:
51
Name check:
Fix check:
Regression:

Description

Reason and workround:

The reason for this is that it may happens that your `/usr/share/ncf/tools/ncf.pyc` is more recent than the installed `/usr/share/ncf/tools/ncf.py`.
Python is just too stupid a language / vm to be used in production.

Workaround

Before installation, or when the problem occures and before `apt-get install -f`, just remove `/usr/share/ncf/tools/ncf.pyc`

Symptoms

During upgrade, you will see:

Setting up rudder-jetty (4.2.5-stretch0) ...
Setting up ncf (4.2.5-stretch0) ...
Setting up rudder-techniques (4.2.5-stretch0) ...
Setting up rudder-inventory-ldap (4.2.5-stretch0) ...
INFO: Restarting syslogd... Done
INFO: Restarting rudder-slapd... Done
Processing triggers for systemd (232-25+deb9u1) ...
Setting up rudder-agent (4.2.5-stretch0) ...
ok: Rudder agent is now disabled.
ok: stop service rudder-agent succeeded
INFO: Ensuring correct permissions on the keys directory... Done.
ok: Rudder agent has been enabled but not started, wait for next cron run.
ok: start service rudder-agent succeeded
INFO: Scheduling an inventory during next run...
Setting up rudder-reports (4.2.5-stretch0) ...
INFO: Waiting for PostgreSQL to be up... Done
Processing triggers for rsyslog (8.24.0-1) ...
Setting up ncf-api-virtualenv (4.2.5-stretch0) ...
Conf ncf-api-virtualenv already enabled
INFO: Restarting Apache HTTPd... Done
Setting up rudder-server-relay (4.2.5-stretch0) ...
INFO: Creating group rudder-policy-reader... Done
INFO: Restarting Apache HTTPd... Done
INFO: rudder-server-relay setup complete.
Setting up rudder-inventory-endpoint (4.2.5-stretch0) ...
INFO: Launching script to check if a migration is needed
INFO: End of migration script
Setting up rudder-webapp (4.2.5-stretch0) ...
INFO: Restarting syslog...Done
INFO: Restarting Apache HTTPd... Done
INFO: Launching script to check if a migration is needed
INFO: Checking if rudder-web.properties database access credentials are all right... LDAP OK,  SQL OK
INFO: Checking if inventory-web.properties database access credentials are all right... LDAP OK,  SQL skipped
INFO: A Technique library reload is needed and has been scheduled.
[master b62f833] Update technique editor hook "ncf-hooks.d/post.write_technique.10_commit.sh" 
 1 file changed, 53 insertions(+)
 create mode 100755 ncf/ncf-hooks.d/post.write_technique.10_commit.sh
[master 6d27271] Update technique editor hook "ncf-hooks.d/post.write_technique.50_rudderify.sh" 
 1 file changed, 72 insertions(+)
 create mode 100755 ncf/ncf-hooks.d/post.write_technique.50_rudderify.sh
INFO: The /var/rudder/configuration-repository/techniques/ncf_techniques/category.xml file already exists. Not updating.
INFO: Alternative source path added: /var/rudder/configuration-repository/ncf
Error: Unable to create Rudder Technique files related to ncf Technique trux, skipping... ('agent_support')
Traceback (most recent call last):
  File "/usr/share/ncf/tools/ncf_rudder.py", line 32, in write_all_techniques_for_rudder
    write_technique_for_rudder(root_path, metadata)
  File "/usr/share/ncf/tools/ncf_rudder.py", line 133, in write_technique_for_rudder
    "cfengine-community" in generic_methods[method_call['method_name']]["agent_support"] for method_call in technique["method_calls"])
  File "/usr/share/ncf/tools/ncf_rudder.py", line 133, in <genexpr>
    "cfengine-community" in generic_methods[method_call['method_name']]["agent_support"] for method_call in technique["method_calls"])
KeyError: 'agent_support'
dpkg: error processing package rudder-webapp (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of rudder-server-root:
 rudder-server-root depends on rudder-webapp (= 4.2.5-stretch0); however:
  Package rudder-webapp is not configured yet.

dpkg: error processing package rudder-server-root (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 rudder-webapp
 rudder-server-root
E: Sub-process /usr/bin/dpkg returned an error code (1)

Files

metadata.xml (768 Bytes) metadata.xml Nicolas CHARLES, 2018-04-18 10:39
test.cf (265 Bytes) test.cf Nicolas CHARLES, 2018-04-18 10:40

Related issues 2 (0 open2 closed)

Related to Rudder - Architecture #11211: Add an agent_support tag to generic methodsReleasedAlexis MoussetActions
Is duplicate of Rudder - Bug #12634: .pyc file are not cleand up during postinstReleasedBenoît PECCATTEActions
Actions #1

Updated by Nicolas CHARLES over 6 years ago

it fails when executing the command:

/usr/share/ncf/tools/ncf_rudder.py rudderify_techniques /var/rudder/configuration-repository/techniques/ncf_techniques

With:

root@server:/home/vagrant# /usr/share/ncf/tools/ncf_rudder.py rudderify_techniques /var/rudder/configuration-repository/techniques/ncf_techniques
INFO: The /var/rudder/configuration-repository/techniques/ncf_techniques/category.xml file already exists. Not updating.
INFO: Alternative source path added: /var/rudder/configuration-repository/ncf
Error: Unable to create Rudder Technique files related to ncf Technique install_vim, skipping... ('agent_support')
Traceback (most recent call last):
  File "/usr/share/ncf/tools/ncf_rudder.py", line 32, in write_all_techniques_for_rudder
    write_technique_for_rudder(root_path, metadata)
  File "/usr/share/ncf/tools/ncf_rudder.py", line 133, in write_technique_for_rudder
    "cfengine-community" in generic_methods[method_call['method_name']]["agent_support"] for method_call in technique["method_calls"])
  File "/usr/share/ncf/tools/ncf_rudder.py", line 133, in <genexpr>
    "cfengine-community" in generic_methods[method_call['method_name']]["agent_support"] for method_call in technique["method_calls"])
KeyError: 'agent_support'

Updated by Nicolas CHARLES over 6 years ago

Attaching failing files

Actions #3

Updated by François ARMAND over 6 years ago

With the same ncf technique, everything seems to go fine on CentOS 7 from 4.1.11 -> 4.2.5:

Stopping Jetty: OK
  Updating   : 1398866025:rudder-webapp-4.2.5.release-1.EL.7.noarch                                                                                                                                               9/20
INFO: Setting Apache HTTPd as a boot service... Done
INFO: Restarting syslog... Done
INFO: Stopping Apache HTTPd... Done
INFO: Starting Apache HTTPd... Done
INFO: Launching script to check if a migration is needed
INFO: Checking if rudder-web.properties database access credentials are all right... LDAP OK,  SQL OK
INFO: Checking if inventory-web.properties database access credentials are all right... LDAP OK,  SQL skipped
INFO: A Technique library reload is needed and has been scheduled.
rm 'ncf/ncf-hooks.d/post.write_technique.commit.sh'
[master ee28b8a] Remove technique editor hook "ncf-hooks.d/post.write_technique.commit.sh" 
 1 file changed, 53 deletions(-)
 delete mode 100755 ncf/ncf-hooks.d/post.write_technique.commit.sh
rm 'ncf/ncf-hooks.d/post.write_technique.rudderify.sh'
[master 4427da4] Remove technique editor hook "ncf-hooks.d/post.write_technique.rudderify.sh" 
 1 file changed, 75 deletions(-)
 delete mode 100755 ncf/ncf-hooks.d/post.write_technique.rudderify.sh
[master ba09503] Update technique editor hook "ncf-hooks.d/post.write_technique.10_commit.sh" 
 1 file changed, 53 insertions(+)
 create mode 100755 ncf/ncf-hooks.d/post.write_technique.10_commit.sh
[master 3b8a81e] Update technique editor hook "ncf-hooks.d/post.write_technique.50_rudderify.sh" 
 1 file changed, 72 insertions(+)
 create mode 100755 ncf/ncf-hooks.d/post.write_technique.50_rudderify.sh
INFO: Alternative source path added: /var/rudder/configuration-repository/ncf
INFO: The /var/rudder/configuration-repository/techniques/ncf_techniques/category.xml file already exists. Not updating.
INFO: Checking PostgreSQL service status... OK
INFO: Checking LDAP service status... OK

INFO: The migration has completed successfully.
INFO: End of migration script
[master d30e431] Add ncf hooks to repository
Setting umask to 0007
Starting Jetty: . . OK Wed Apr 18 09:38:48 UTC 2018
  Updating   : 1398866025:rudder-server-root-4.2.5.release-1.EL.7.noarch                                                                                                                                         10/20
  Cleanup    : 1398866025:rudder-server-root-4.1.11.release-1.EL.7.noarch                                                                                                                                        11/20
  Cleanup    : 1398866025:rudder-webapp-4.1.11.release-1.EL.7.noarch                                                                                                                                             12/20
warning: file /var/rudder/configuration-repository/ncf/ncf-hooks.d/post.write_technique.rudderify.sh: remove failed: No such file or directory
warning: file /var/rudder/configuration-repository/ncf/ncf-hooks.d/post.write_technique.commit.sh: remove failed: No such file or directory
  Cleanup    : 1398866025:rudder-inventory-endpoint-4.1.11.release-1.EL.7.noarch                                                                                                                                 13/20
  Cleanup    : 1398866025:ncf-api-virtualenv-4.1.11.release-1.EL.7.noarch                                                                                                                                        14/20
  Cleanup    : 1398866025:rudder-techniques-4.1.11.release-1.EL.7.noarch                                                                                                                                         15/20
  Cleanup    : 1398866025:ncf-4.1.11.release-1.EL.7.noarch                                                                                                                                                       16/20
  Cleanup    : 1398866025:rudder-jetty-4.1.11.release-1.EL.7.noarch                                                                                                                                              17/20
  Cleanup    : 1398866025:rudder-inventory-ldap-4.1.11.release-1.EL.7.x86_64                                                                                                                                     18/20
  Cleanup    : 1398866025:rudder-server-relay-4.1.11.release-1.EL.7.x86_64                                                                                                                                       19/20
  Cleanup    : 1398866025:rudder-reports-4.1.11.release-1.EL.7.noarch                                                                                                                                            20/20
  Verifying  : 1398866025:ncf-4.2.5.release-1.EL.7.noarch                                                                                                                                                         1/20
  Verifying  : 1398866025:rudder-server-relay-4.2.5.release-1.EL.7.x86_64                                                                                                                                         2/20
  Verifying  : 1398866025:rudder-inventory-endpoint-4.2.5.release-1.EL.7.noarch                                                                                                                                   3/20
  Verifying  : 1398866025:rudder-webapp-4.2.5.release-1.EL.7.noarch                                                                                                                                               4/20
  Verifying  : 1398866025:rudder-techniques-4.2.5.release-1.EL.7.noarch                                                                                                                                           5/20
  Verifying  : 1398866025:rudder-inventory-ldap-4.2.5.release-1.EL.7.x86_64                                                                                                                                       6/20
  Verifying  : 1398866025:ncf-api-virtualenv-4.2.5.release-1.EL.7.noarch                                                                                                                                          7/20
  Verifying  : 1398866025:rudder-server-root-4.2.5.release-1.EL.7.noarch                                                                                                                                          8/20
  Verifying  : 1398866025:rudder-reports-4.2.5.release-1.EL.7.noarch                                                                                                                                              9/20
  Verifying  : 1398866025:rudder-jetty-4.2.5.release-1.EL.7.noarch                                                                                                                                               10/20
  Verifying  : 1398866025:ncf-api-virtualenv-4.1.11.release-1.EL.7.noarch                                                                                                                                        11/20
  Verifying  : 1398866025:rudder-reports-4.1.11.release-1.EL.7.noarch                                                                                                                                            12/20
  Verifying  : 1398866025:rudder-inventory-ldap-4.1.11.release-1.EL.7.x86_64                                                                                                                                     13/20
  Verifying  : 1398866025:rudder-webapp-4.1.11.release-1.EL.7.noarch                                                                                                                                             14/20
  Verifying  : 1398866025:rudder-techniques-4.1.11.release-1.EL.7.noarch                                                                                                                                         15/20
  Verifying  : 1398866025:rudder-jetty-4.1.11.release-1.EL.7.noarch                                                                                                                                              16/20
  Verifying  : 1398866025:rudder-inventory-endpoint-4.1.11.release-1.EL.7.noarch                                                                                                                                 17/20
  Verifying  : 1398866025:rudder-server-relay-4.1.11.release-1.EL.7.x86_64                                                                                                                                       18/20
  Verifying  : 1398866025:ncf-4.1.11.release-1.EL.7.noarch                                                                                                                                                       19/20
  Verifying  : 1398866025:rudder-server-root-4.1.11.release-1.EL.7.noarch                                                                                                                                        20/20

Updated:
  ncf.noarch 1398866025:4.2.5.release-1.EL.7                   ncf-api-virtualenv.noarch 1398866025:4.2.5.release-1.EL.7                   rudder-server-root.noarch 1398866025:4.2.5.release-1.EL.7

Dependency Updated:
  rudder-inventory-endpoint.noarch 1398866025:4.2.5.release-1.EL.7           rudder-inventory-ldap.x86_64 1398866025:4.2.5.release-1.EL.7           rudder-jetty.noarch 1398866025:4.2.5.release-1.EL.7
  rudder-reports.noarch 1398866025:4.2.5.release-1.EL.7                      rudder-server-relay.x86_64 1398866025:4.2.5.release-1.EL.7             rudder-techniques.noarch 1398866025:4.2.5.release-1.EL.7
  rudder-webapp.noarch 1398866025:4.2.5.release-1.EL.7

Complete!
Actions #4

Updated by François ARMAND over 6 years ago

Actions #5

Updated by François ARMAND over 6 years ago

  • Description updated (diff)
  • Severity set to Minor - inconvenience | misleading | easy workaround
  • User visibility set to Infrequent - complex configurations | third party integrations
  • Priority changed from 0 to 22

I'm setting it in "infrequent", because it needs to have a install of 4.1 more recent than the version of 4.2 that will be use for upgrade. It is very frequent when testing upgrade, but almost no user should be in that case.

Actions #6

Updated by Vincent MEMBRÉ over 6 years ago

  • Target version changed from 4.2.6 to 4.2.7
Actions #7

Updated by Benoît PECCATTE over 6 years ago

  • Severity changed from Minor - inconvenience | misleading | easy workaround to Major - prevents use of part of Rudder | no simple workaround
  • Priority changed from 22 to 41
Actions #8

Updated by Vincent MEMBRÉ over 6 years ago

  • Target version changed from 4.2.7 to 414
  • Priority changed from 41 to 40
Actions #9

Updated by Nicolas CHARLES over 6 years ago

I had it again :/

Actions #10

Updated by Nicolas CHARLES over 6 years ago

ok, i did apt-get install rudder-server-root, and it failed to find that ncf-api-virtualenv was to be updated

Actions #11

Updated by Vincent MEMBRÉ over 6 years ago

  • Target version changed from 414 to 4.3.4
Actions #12

Updated by Benoît PECCATTE over 6 years ago

  • Target version changed from 4.3.4 to 4.3.5
  • Priority changed from 40 to 39
Actions #13

Updated by Benoît PECCATTE about 6 years ago

  • Effort required set to Small
  • Priority changed from 39 to 52

we should remove pyc during postinst

Actions #14

Updated by Vincent MEMBRÉ about 6 years ago

  • Target version changed from 4.3.5 to 4.3.6
Actions #15

Updated by Vincent MEMBRÉ about 6 years ago

  • Target version changed from 4.3.6 to 4.3.7
Actions #16

Updated by Alexis Mousset about 6 years ago

  • Priority changed from 52 to 51

Done in #12634, closing.

Actions #17

Updated by Alexis Mousset about 6 years ago

  • Is duplicate of Bug #12634: .pyc file are not cleand up during postinst added
Actions #18

Updated by François ARMAND about 6 years ago

  • Status changed from New to Rejected

We now delete '/usr/share/ncf/tools/ncf.pyc' on update to avoid that case. Closing.

Actions

Also available in: Atom PDF