Project

General

Profile

Bug #11836

sharedfile_to_node reports repaired even if it fails

Added by Janos Mattyasovszky about 1 year ago. Updated 10 months ago.

Status:
Released
Priority:
N/A
Category:
Techniques
Target version:
Severity:
Major - prevents use of part of Rudder | no simple workaround
User visibility:
Operational - other Techniques | Technique editor | Rudder settings
Effort required:
Small
Priority:
65

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? :-/


Subtasks

Bug #12077: In some cases the shared-file API returns 405 instead of 404ReleasedVincent MEMBRÉ

Associated revisions

Revision 50b515ca (diff)
Added by Benoît PECCATTE 10 months ago

Fixes #11836: sharedfile_to_node reports repaired even if it fails

History

#1 Updated by Nicolas CHARLES about 1 year ago

I tested this with a Debian server, and it did work. I'm spanning a Sles11 server to check the behaviour

#2 Updated by Janos Mattyasovszky about 1 year ago

Setup is:
Rudder root 4.1.8 on sles11 (sp4) <-- Rudder node 4.1.8 on sles11 (sp4)

#3 Updated by Nicolas CHARLES about 1 year ago

  • Target version set to 4.1.9

I can confirm that it is failing on a sles server

#4 Updated by Nicolas CHARLES about 1 year 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

#5 Updated by Nicolas CHARLES about 1 year 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)

#6 Updated by Janos Mattyasovszky about 1 year 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

#7 Updated by Janos Mattyasovszky about 1 year ago

  • Subject changed from sharedfile_to_node broken in 4.1 to sharedfile_to_node reports repaired even if it fails

#8 Updated by Nicolas CHARLES about 1 year 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

#10 Updated by Benoît PECCATTE about 1 year ago

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

#11 Updated by Benoît PECCATTE 12 months ago

  • Assignee set to Benoît PECCATTE

#12 Updated by Benoît PECCATTE 11 months ago

Let's fix the curl pb to be aware of the delay

#13 Updated by Benoît PECCATTE 11 months ago

  • Target version set to 4.1.10
  • Priority changed from 67 to 66

#14 Updated by Benoît PECCATTE 11 months ago

  • Status changed from New to In progress

#15 Updated by Benoît PECCATTE 11 months 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

#16 Updated by Normation Quality Assistant 10 months ago

  • Assignee changed from Alexis MOUSSET to Benoît PECCATTE

#17 Updated by Benoît PECCATTE 10 months ago

  • Status changed from Pending technical review to Pending release

#18 Updated by Vincent MEMBRÉ 10 months 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.

Also available in: Atom PDF