Following an update all my NCF techniques turned out to be invalid, calling the log method log_rudder with two instead of four parameters.

It looked roughly like this:

 

Changing them using sed proved an incomplete solution, since any new NCF technique was again broken.

 

 

So actually it looked like this:

 

 

Ensure you have no leftover ncf.conf.rpmnew from the update.

 

Ensure all your ncf.conf refers only to log_default or log_rudder, not logger_rudder.

[root@rudder rudder]# find / -name ncf.conf -exec grep -E "log.*rudder" {} +
/opt/rudder/share/initial-promises/distributePolicy/ncf/ncf.conf:loggers=_log_default,log_rudder
/var/rudder/cfengine-community/masterfiles/distributePolicy/ncf/ncf.conf:loggers=_log_default,log_rudder
/var/rudder/cfengine-community/inputs/distributePolicy/ncf/ncf.conf:loggers=_log_default,log_rudder
/var/rudder/cfengine-community/inputs.bkp/distributePolicy/ncf/ncf.conf:loggers=_log_default,log_rudder
/var/rudder/configuration-repository/ncf/ncf.conf:loggers=_log_default,log_rudder
/var/rudder/ncf/local/ncf.conf:loggers=_log_default,log_rudder

 

The logging methods are defined in 30_generic_methods of NCF.

Make sure your NCF is current, especially look at the bundle "log_default".

 

 

The NCF backend needs this patch!

diff --git a/tools/ncf_rudder.py b/tools/ncf_rudder.py
index 1b0ddc8..d96922d 100755
--- a/tools/ncf_rudder.py
+++ b/tools/ncf_rudder.py
@@ -324,7 +324,7 @@ def generate_rudder_reporting(technique):
     key_value_canonified = regex.sub("_", key_value)
 
     class_prefix = generic_method["class_prefix"]+"_"+key_value_canonified
-    logger_rudder_call = '"dummy_report" usebundle => log_rudder("' + generic_method['name'] + ' ' + key_value + ' if ' + method_call['class_context'] + '", "' + class_prefix +'")'
+    logger_rudder_call = '"dummy_report" usebundle => log_rudder("' + generic_method['name'] + ' ' + key_value + ' if ' + method_call['class_context'] + '", "' + class_prefix +'", "", "")'
 
     # Always add an empty line for readability
     content.append('')
-- 

 

 

Then run rudderify:

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

 

Commit the changes in ncf_techniques and the changed ncf.conf.cache

cd /var/rudder/configuration-repository
git add techniques/ ncf/
git commit -m "rebuild ncf reporting"

 

Finally, you need to reload your techniques:

 

Try the very comfortable command via CLI first, but it didn't work:

[root@rudder rudder]# rudder server reload-techniques
error: Could not reload techniques from files
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>403 Forbidden</title>
</head><body>
<h1>Forbidden</h1>
<p>You don't have permission to access /rudder/api/techniqueLibrary/reload
on this server.</p>
<hr>
<address>Apache/2.2.15 (CentOS) Server at localhost Port 443</address>
</body></html>

 

Then I tried the one from the hook scripts, this one works:

curl --proxy '' -s -f "http://localhost:8080/rudder/api/techniqueLibrary/reload"

 

But of course you can also reload via GUI (Administration -> Settings)

 

If your install is very broken due to the issue, you can try these three steps:

First try to clear the policy caches -> Does it rebuild OK now?

If that ain't enough, you might need to try a 

rudder agent run -> if this is broken, try this:

rudder agent reset -> Does the local agent run again

 

If that ain't enough,

you need to restore the initial promises:

/opt/rudder/bin/check-rudder-agent should do that automatically.

After that, try rudder agent run, followed by rudder agent update, followed by rudder agent run! 

 

 

Now things look like this again:

 

 

References:

 

http://www.rudder-project.org/redmine/issues/8826