Steps to reproduce
-
Create a new manifest in sapi
sdc-sapi /manifests -X POST -d '{
"name": "chd_test",
"path": "/tmp/test",
"template": "testing"
}'
-
Login to sapi0 zone, and check whether that manifest has been created in /sapi/sapi_manifests
(Spoiler: it hasn’t)
-
Add the manifest to the sapi application, so it gets picked up by config-agent everywhere
sdc-sapi /applications/$(sdc-sapi /applications?name=sdc | json -H 0.uuid) -X PUT -d '
{
"action":"update",
"manifests":{
"chd_test":"'$(sdc-sapi /manifests | json -H -c 'name=="chd_test"' 0.uuid)'"
}
}'
-
Trigger a sapi sync to make it refresh the local cache
Expected result
- sapi0 caches the manifest in local storage, along with the application change
- config-agent pushes out the changes everywhere
- sapi service can be restarted happily (& the hourly local storage refresh happens successfully)
Actual Result
-
sapi0 local storage doesn't contain the new manifest
[root@052ffb5b-353e-4de5-95d0-47c8509ca4ca (dc1:sapi0) ~]# ls -l /sapi/sapi_manifests/9c563244-7467-443d-a34b-67e59d49191f
ls: cannot access /sapi/sapi_manifests/9c563244-7467-443d-a34b-67e59d49191f: No such file or directory
-
sapi service hourly refresh causes a core dump, due to the manifest not being on disk
[2017-05-11T20:05:26.092Z] INFO: sapi/16519 on 052ffb5b-353e-4de5-95d0-47c8509ca4ca: refreshing local stor from moray...
[2017-05-11T20:05:26.405Z] WARN: sapi/16519 on 052ffb5b-353e-4de5-95d0-47c8509ca4ca: object 9c563244-7467-443d-a34b-67e59d49191f doesn't exist
Uncaught TypeError: Cannot read property 'value' of null
FROM
/opt/smartdc/sapi/lib/server/stor/moray_local.js:199:30
/opt/smartdc/sapi/lib/server/stor/moray_local.js:198:45
/opt/smartdc/sapi/node_modules/vasync/lib/vasync.js:84:5
/opt/smartdc/sapi/lib/server/stor/local.js:155:17
fs.js:266:14
Object.oncomplete (fs.js:107:15)
It looks from testing like creating a manifest through sdc-sapi on the headnode, that doesn't get written out to the local storage on sapi0 zone. This then has the knock-on effect of causing the local storage refresh (either hourly or at startup) to bail out, due to the manifest not being found in local storage.
Steps to reproduce
Create a new manifest in sapi
Login to sapi0 zone, and check whether that manifest has been created in
/sapi/sapi_manifests(Spoiler: it hasn’t)
Add the manifest to the sapi application, so it gets picked up by config-agent everywhere
Trigger a sapi sync to make it refresh the local cache
Expected result
Actual Result
sapi0 local storage doesn't contain the new manifest
sapi service hourly refresh causes a core dump, due to the manifest not being on disk
It looks from testing like creating a manifest through
sdc-sapion the headnode, that doesn't get written out to the local storage onsapi0zone. This then has the knock-on effect of causing the local storage refresh (either hourly or at startup) to bail out, due to the manifest not being found in local storage.