Committed (docker) image with persisted data in /nso/run does not start
I wanted to create a new (Docker) image from a running NSO container that would contain all the packages and the data. When I restart the newly committed image I get the following error in the early stages of startup:
ncs[122]: - Loading file /nso/run/state/packages-in-use/1/testpkg-pyvenv-a/package-meta-data.xml
ncs[122]: - Loading file /nso/run/state/packages-in-use/1/testpkg-python/package-meta-data.xml
ncs[122]: - Loading file /nso/run/state/packages-in-use/1/testpkg-java/package-meta-data.xml
ncs[122]: - Loading file /nso/run/state/packages-in-use/1/testpkg pyvenv b/package-meta-data.xml
ncs[122]: - Loading file /nso/run/state/packages-in-use/1/testpkg/package-meta-data.xml
ncs[122]: - Bad configuration: /etc/ncs/ncs.conf:0: "/nso/run/state/packages-in-use.cur: Failed to rename to /nso/run/state/packages-in-use.old: cross-domain link"
"Bad configuration: /etc/ncs/ncs.conf:0: \"/nso/run/state/packages-in-use.cur: Failed to rename to /nso/run/state/packages-in-use.old: cross-domain link\"\n"
=ERROR REPORT==== 7-Nov-2022::11:00:49.146956 ===
init:boot_msg: "Bad configuration: /etc/ncs/ncs.conf:0: \"/nso/run/state/packages-in-use.cur: Failed to rename to /nso/run/state/packages-in-use.old: cross-domain link\"\n"
Waiting for NSO to start...
run-nso.sh: NSO exited during startup (exit code 21) - exiting container
I should note that I started the first container without volumes - all the data in /nso/run is stored in the container. I found an explanation of the error message here: https://community.cisco.com/t5/nso-developer-hub-discussions/nso-and-doing-a-commit-on-a-docker-container/td-p/4413962 but there was no conclusion as to why this does not work. I also tried squashing the committed image to a single layer with docker-squash.
I extended the existing test suite with two new tests:
-
test-cdb-persistence-container: tests we can stop and then restart the NSO containar (/nso/runis persisted in the container). -
test-cdb-persistence-image: tests we can create a new image from a container with/nso/runpersisted in the image.
Edited by Marko Zagožen