Project

General

Profile

Actions

Bug #11836

closed

sharedfile_to_node reports repaired even if it fails

Added by Janos Mattyasovszky over 6 years ago. Updated about 6 years ago.

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

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 1 (0 open1 closed)

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

Updated by Nicolas CHARLES over 6 years ago

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

Actions #2

Updated by Janos Mattyasovszky over 6 years ago

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

Actions #3

Updated by Nicolas CHARLES over 6 years ago

  • Target version set to 4.1.9

I can confirm that it is failing on a sles server

Actions #4

Updated by Nicolas CHARLES over 6 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

Actions #5

Updated by Nicolas CHARLES over 6 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)

Actions #6

Updated by Janos Mattyasovszky over 6 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
Actions #7

Updated by Janos Mattyasovszky over 6 years ago

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

Updated by Nicolas CHARLES over 6 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

Actions #10

Updated by Benoît PECCATTE over 6 years ago

  • Effort required set to Small
  • Priority changed from 52 to 67
Actions #11

Updated by Benoît PECCATTE over 6 years ago

  • Assignee set to Benoît PECCATTE
Actions #12

Updated by Benoît PECCATTE about 6 years ago

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

Actions #13

Updated by Benoît PECCATTE about 6 years ago

  • Target version set to 4.1.10
  • Priority changed from 67 to 66
Actions #14

Updated by Benoît PECCATTE about 6 years ago

  • Status changed from New to In progress
Actions #15

Updated by Benoît PECCATTE about 6 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
Actions #16

Updated by Rudder Quality Assistant about 6 years ago

  • Assignee changed from Alexis Mousset to Benoît PECCATTE
Actions #17

Updated by Benoît PECCATTE about 6 years ago

  • Status changed from Pending technical review to Pending release

Applied in changeset ncf:commit:50b515cac9554f8f5fa6de7ec324ab1d28dbff16.

Actions #18

Updated by Vincent MEMBRÉ about 6 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.

Actions

Also available in: Atom PDF