Bug #11836
closedsharedfile_to_node reports repaired even if it fails
Description
NCF sharedfile_to_node not working on cleanly installed 4.1.8 on SLES11.
See this trivial example:
testclient:/var/rudder/cfengine-community/inputs # cat test/1.0/test.cf # @name test # @description # @version 1.0 bundle agent test { vars: "class_prefix" string => canonify(join("_", "this.callers_promisers")); methods: "method_call" usebundle => sharedfile_to_node("${g.uuid}", "rootfile", "/root/file", "365d"), ifvarclass => concat("any"); "method_call" usebundle => sharedfile_from_node("${g.uuid}", "rootfile", "/root/file.2"), ifvarclass => concat("any"); }
Apache error logs show:
[Wed Dec 06 13:15:35 2017] [error] [client testclient] client denied by server configuration: /srv/www/shared-files [Wed Dec 06 13:15:36 2017] [error] [client testclient] client denied by server configuration: /srv/www/shared-files [Wed Dec 06 13:15:37 2017] [error] [client testclient] client denied by server configuration: /srv/www/shared-files [Wed Dec 06 13:15:37 2017] [error] [client testclient] client denied by server configuration: /srv/www/shared-files [Wed Dec 06 13:15:41 2017] [error] [client testclient] client denied by server configuration: /srv/www/shared-files [Wed Dec 06 13:15:41 2017] [error] [client testclient] client denied by server configuration: /srv/www/shared-files [Wed Dec 06 13:15:47 2017] [error] [client testclient] client denied by server configuration: /srv/www/shared-files [Wed Dec 06 13:15:47 2017] [error] [client testclient] client denied by server configuration: /srv/www/shared-files
Apparently this is due to the Documentroot it has:
testserver:/opt/rudder/etc # grep srv/www * rudder-apache-relay-common.conf:DocumentRoot /srv/www
Could you please check if you could reproduce it? :-/
Updated by Nicolas CHARLES about 7 years ago
I tested this with a Debian server, and it did work. I'm spanning a Sles11 server to check the behaviour
Updated by Janos Mattyasovszky about 7 years ago
Setup is:
Rudder root 4.1.8 on sles11 (sp4) <-- Rudder node 4.1.8 on sles11 (sp4)
Updated by Nicolas CHARLES about 7 years ago
- Target version set to 4.1.9
I can confirm that it is failing on a sles server
Updated by Nicolas CHARLES about 7 years ago
- Target version deleted (
4.1.9)
This is more complex than that.
It failed on the sles11 for less than 5 minutes, and then it worked
Logs still exhibits [Wed Dec 06 13:15:35 2017] [error] [client testclient] client denied by server configuration: /srv/www/shared-files but it works
It seems to be related to the absence of file /opt/rudder/etc/nodeslist.json
Updated by Nicolas CHARLES about 7 years ago
nodeslist.json file is generated by the rudder server, within the rudder server policies
when the agent runs, it will copy the nodeslist.json to its final destinatin /opt/rudder/etc/nodeslist.json , so there's a time windows where it can fail (while file is not yet there)
Updated by Janos Mattyasovszky about 7 years ago
Another "bug" (misbehavior) is that the sharefile_to_node is reporting "repaired" even if apache http/500 errors out, and you only know that it did fail because you cannot retrieve that you have just shared :-(
[2017-12-06 13:15:36+0100] N: de844039-c8f0-4cfd-9e3f-a75661ba990b [testclient] S: [result_repaired] R: 772d7d75-ef4f-4119-a981-f2e1b9720db9 [test] D: dc1dd59c-8940-40c8-9b31-dbda979449f8 [test] T: test/1.0 C: [Sharedfile to node] V: [rootfile] Sharing /root/file with de844039-c8f0-4cfd-9e3f-a75661ba990b under the name rootfile for 365d was repaired [2017-12-06 13:15:36+0100] N: de844039-c8f0-4cfd-9e3f-a75661ba990b [testclient] S: [result_error] R: 772d7d75-ef4f-4119-a981-f2e1b9720db9 [test] D: dc1dd59c-8940-40c8-9b31-dbda979449f8 [test] T: test/1.0 C: [Sharedfile from node] V: [rootfile] Retrieving rootfile from de844039-c8f0-4cfd-9e3f-a75661ba990b into /root/file.2 could not be repaired [2017-12-06 13:15:38+0100] N: de844039-c8f0-4cfd-9e3f-a75661ba990b [testclient] S: [result_repaired] R: 772d7d75-ef4f-4119-a981-f2e1b9720db9 [test] D: dc1dd59c-8940-40c8-9b31-dbda979449f8 [test] T: test/1.0 C: [Sharedfile to node] V: [rootfile] Sharing /root/file with de844039-c8f0-4cfd-9e3f-a75661ba990b under the name rootfile for 365d was repaired [2017-12-06 13:15:38+0100] N: de844039-c8f0-4cfd-9e3f-a75661ba990b [testclient] S: [result_error] R: 772d7d75-ef4f-4119-a981-f2e1b9720db9 [test] D: dc1dd59c-8940-40c8-9b31-dbda979449f8 [test] T: test/1.0 C: [Sharedfile from node] V: [rootfile] Retrieving rootfile from de844039-c8f0-4cfd-9e3f-a75661ba990b into /root/file.2 could not be repaired [2017-12-06 13:15:42+0100] N: de844039-c8f0-4cfd-9e3f-a75661ba990b [testclient] S: [result_repaired] R: 772d7d75-ef4f-4119-a981-f2e1b9720db9 [test] D: dc1dd59c-8940-40c8-9b31-dbda979449f8 [test] T: test/1.0 C: [Sharedfile to node] V: [rootfile] Sharing /root/file with de844039-c8f0-4cfd-9e3f-a75661ba990b under the name rootfile for 365d was repaired [2017-12-06 13:15:42+0100] N: de844039-c8f0-4cfd-9e3f-a75661ba990b [testclient] S: [result_error] R: 772d7d75-ef4f-4119-a981-f2e1b9720db9 [test] D: dc1dd59c-8940-40c8-9b31-dbda979449f8 [test] T: test/1.0 C: [Sharedfile from node] V: [rootfile] Retrieving rootfile from de844039-c8f0-4cfd-9e3f-a75661ba990b into /root/file.2 could not be repaired [2017-12-06 13:15:47+0100] N: de844039-c8f0-4cfd-9e3f-a75661ba990b [testclient] S: [result_repaired] R: 772d7d75-ef4f-4119-a981-f2e1b9720db9 [test] D: dc1dd59c-8940-40c8-9b31-dbda979449f8 [test] T: test/1.0 C: [Sharedfile to node] V: [rootfile] Sharing /root/file with de844039-c8f0-4cfd-9e3f-a75661ba990b under the name rootfile for 365d was repaired [2017-12-06 13:15:47+0100] N: de844039-c8f0-4cfd-9e3f-a75661ba990b [testclient] S: [result_error] R: 772d7d75-ef4f-4119-a981-f2e1b9720db9 [test] D: dc1dd59c-8940-40c8-9b31-dbda979449f8 [test] T: test/1.0 C: [Sharedfile from node] V: [rootfile] Retrieving rootfile from de844039-c8f0-4cfd-9e3f-a75661ba990b into /root/file.2 could not be repaired [2017-12-06 13:20:53+0100] N: de844039-c8f0-4cfd-9e3f-a75661ba990b [testclient] S: [result_repaired] R: 772d7d75-ef4f-4119-a981-f2e1b9720db9 [test] D: dc1dd59c-8940-40c8-9b31-dbda979449f8 [test] T: test/1.0 C: [Sharedfile to node] V: [rootfile] Sharing /root/file with de844039-c8f0-4cfd-9e3f-a75661ba990b under the name rootfile for 365d was repaired [2017-12-06 13:20:53+0100] N: de844039-c8f0-4cfd-9e3f-a75661ba990b [testclient] S: [result_repaired] R: 772d7d75-ef4f-4119-a981-f2e1b9720db9 [test] D: dc1dd59c-8940-40c8-9b31-dbda979449f8 [test] T: test/1.0 C: [Sharedfile from node] V: [rootfile] Retrieving rootfile from de844039-c8f0-4cfd-9e3f-a75661ba990b into /root/file.2 was repaired
Updated by Janos Mattyasovszky about 7 years ago
- Subject changed from sharedfile_to_node broken in 4.1 to sharedfile_to_node reports repaired even if it fails
Updated by Nicolas CHARLES about 7 years ago
curl exits 22 in case of 404 or 500
we should have a wrapper around curl to get the actual http code, and in case of 50X return an error rather than repaired
Updated by Benoît PECCATTE about 7 years ago
- Effort required set to Small
- Priority changed from 52 to 67
Updated by Benoît PECCATTE almost 7 years ago
Let's fix the curl pb to be aware of the delay
Updated by Benoît PECCATTE almost 7 years ago
- Target version set to 4.1.10
- Priority changed from 67 to 66
Updated by Benoît PECCATTE almost 7 years ago
- Status changed from New to In progress
Updated by Benoît PECCATTE almost 7 years ago
- Status changed from In progress to Pending technical review
- Assignee changed from Benoît PECCATTE to Alexis Mousset
- Pull Request set to https://github.com/Normation/ncf/pull/692
Updated by Rudder Quality Assistant almost 7 years ago
- Assignee changed from Alexis Mousset to Benoît PECCATTE
Updated by Benoît PECCATTE almost 7 years ago
- Status changed from Pending technical review to Pending release
Applied in changeset ncf:commit:50b515cac9554f8f5fa6de7ec324ab1d28dbff16.
Updated by Vincent MEMBRÉ almost 7 years ago
- Status changed from Pending release to Released
- Priority changed from 66 to 65
This bug has been fixed in Rudder 4.1.10 and 4.2.4 which were released today.
- 4.1.10: Announce Changelog
- 4.2.4: Announce Changelog
- Download: https://www.rudder-project.org/site/get-rudder/downloads/