quattor / ncm-cdispd

Node Configuration Manager Configuration Dispatch Daemon
www.quattor.org
Other
2 stars 5 forks source link

ncm-cdispd crash when CID is 0 #51

Open ned21 opened 7 years ago

ned21 commented 7 years ago

ccm-fetch log:

2017/06/05-14:48:01 [INFO] Fetched profile unchanged, latest CID 20 name [redacted]
2017/06/05-14:57:05 [VERB] world_readable set
2017/06/05-14:57:05 [VERB] world_readable set
2017/06/05-14:57:05 [VERB] Opening file /var/lib/ccm/global.lock
2017/06/05-14:57:05 [VERB] File /var/lib/ccm/global.lock was not modified
2017/06/05-14:57:05 [VERB] Opening file /var/lib/ccm/latest.cid
2017/06/05-14:57:05 [VERB] Opening file /var/lib/ccm/profile.0/profile.url
2017/06/05-14:57:05 [VERB] Not saving file /var/lib/ccm/profile.0/profile.url
2017/06/05-14:57:05 [VERB] Opening file /var/lib/ccm/profile.0/profile.xml
2017/06/05-14:57:05 [VERB] Not saving file /var/lib/ccm/profile.0/profile.xml
2017/06/05-14:57:05 [VERB] FORCE set, not setting if_modified_since in request
2017/06/05-14:57:05 [VERB] Opening file /var/lib/ccm/data/aHR0cDovL255YXFkMS5tcy
5jb20vZW5jcnlwdGVkcHJvZmlsZT9pdmFwcDExMzI5MTMuZGV2aW4xLm1zLmNvbS54bWw=
2017/06/05-14:57:05 [VERB] File /var/lib/ccm/data/aHR0cDovL255YXFkMS5tcy5jb20vZW
5jcnlwdGVkcHJvZmlsZT9pdmFwcDExMzI5MTMuZGV2aW4xLm1zLmNvbS54bWw= was modified
2017/06/05-14:57:05 [VERB] Opening file /var/lib/ccm/data/aHR0cDovL255YXFkMS5tcy
5jb20vZW5jcnlwdGVkcHJvZmlsZT9pdmFwcDExMzI5MTMuZGV2aW4xLm1zLmNvbS54bWw=
2017/06/05-14:57:05 [VERB] Not saving file /var/lib/ccm/data/aHR0cDovL255YXFkMS5
tcy5jb20vZW5jcnlwdGVkcHJvZmlsZT9pdmFwcDExMzI5MTMuZGV2aW4xLm1zLmNvbS54bWw=
2017/06/05-14:57:05 [VERB] Downloaded new profile
2017/06/05-14:57:05 [VERB] Going to create/modify paths: /var/lib/ccm /var/lib/c
cm/data /var/lib/ccm/tmp /var/lib/ccm/profile.1
2017/06/05-14:57:05 [VERB] Opening file /var/lib/ccm/profile.1/profile.url
2017/06/05-14:57:05 [VERB] Writing the database to /var/lib/ccm/profile.1/path2eid.db using CDB_File
2017/06/05-14:57:05 [VERB] Writing the database format CDB_File to /var/lib/ccm/profile.1/path2eid.fmt
2017/06/05-14:57:05 [VERB] Opening file /var/lib/ccm/profile.1/path2eid.fmt
2017/06/05-14:57:05 [VERB] File /var/lib/ccm/profile.1/path2eid.fmt was modified
2017/06/05-14:57:05 [VERB] Writing the database to /var/lib/ccm/profile.1/eid2data.db using CDB_File
2017/06/05-14:57:05 [VERB] Writing the database format CDB_File to /var/lib/ccm/profile.1/eid2data.fmt
2017/06/05-14:57:05 [VERB] Opening file /var/lib/ccm/profile.1/eid2data.fmt
2017/06/05-14:57:05 [VERB] File /var/lib/ccm/profile.1/eid2data.fmt was modified
2017/06/05-14:57:05 [VERB] File /var/lib/ccm/current.cid was modified
2017/06/05-14:57:05 [VERB] File /var/lib/ccm/profile.1/profile.xml was modified
2017/06/05-14:57:05 [VERB] File /var/lib/ccm/profile.1/profile.url was modified
2017/06/05-14:57:05 [VERB] File /var/lib/ccm/latest.cid was modified
2017/06/05-14:57:07 [VERB] Opening file /var/lib/ccm/profile.1/tabcompletion
2017/06/05-14:57:07 [VERB] File /var/lib/ccm/profile.1/tabcompletion was modified
2017/06/05-14:57:07 [INFO] Profile updated, new latest CID 1 name [redacted]

So CCM goes from a CID of 20 to mentioning 0 but actually creates profile.1.

This is happening during boot so ncm-cdispd comes up and crashes because of an invalid CID:

2017/06/05-14:57:05 [INFO] ncm-cdispd version 16.12.0 started by root at: Mon Jun  5 14:57:05 2017 pid: 983
2017/06/05-14:57:05 [INFO] initalization of components
2017/06/05-14:57:05 [ERROR] fatal exception:
2017/06/05-14:57:05 [ERROR] CID '' must be a number
2017/06/05-14:57:05 [ERROR] exiting ncm-cdispd...

I see a reference to CIDs being 0 requiring a unit test change so was this a known bug in 16.12 that was fixed later?

This is RHEL7, running 16.12 of ccm and ncm-cdispd.

stdweird commented 7 years ago

@ned21 odd thing number one: going from cid 20 to 0. was there a ccm-purge that left some files lying around?

the changes in the unittests were not related to any bugs, they are related to https://github.com/quattor/maven-tools/pull/160/commits/5bb90a3cdf27842700dd4b48413fe27b9f525b8b (for some reason, the unittest CID started at 1 instead of 0)