Bug #12482
Updated by François ARMAND over 6 years ago
h3. 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.
h3. Workaround
Before installation, or when the problem occures and before `apt-get install -f`, just remove `/usr/share/ncf/tools/ncf.pyc`
h3. Symptoms
During upgrade, you will see:
<pre>
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)
</pre>