Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1, reproduce the problem
- mkdir -p ~/snaphelpers-lp2162621
- cd ~/snaphelpers-lp2162621
- openssl req -x509 -newkey rsa:4096 -nodes \
- -keyout test-ca.key \
- -out test-ca.pem \
- -days 365 \
- -subj '/CN=snaphelpers-lp2162621-test-ca' \
- -addext 'basicConstraints=critical,CA:TRUE' \
- -addext 'keyUsage=critical,keyCertSign,cRLSign'
- openssl x509 -in test-ca.pem -noout -subject -issuer -text | grep -E 'Subject:|Issuer:|CA:TRUE'
- cd ~/snaphelpers-lp2162621
- rm -f large-ca-bundle.pem
- for _ in $(seq 1 40); do
- cat test-ca.pem
- done > large-ca-bundle.pem
- BASE64_BUNDLE="$(base64 -w 0 large-ca-bundle.pem)"
- sunbeam disable tls vault
- sudo snap set cinder-volume "ca.bundle=$BASE64_BUNDLE"
- ubuntu@sunbeam:~/snaphelpers-lp2162621$ sudo snap set cinder-volume "ca.bundle=$BASE64_BUNDLE"
- error: cannot perform the following tasks:
- - Run configure hook of "cinder-volume" snap (run hook "configure": <exceeded maximum runtime of 5m0s>)
- ubuntu@sunbeam:~/snaphelpers-lp2162621$ sudo journalctl -u snapd -f
- ...
- Sep 29 05:26:54 sunbeam snapd[2378]: taskrunner.go:304: Change 11514 task (Run configure hook of "cinder-volume" snap) failed: run hook "configure": <exceeded maximum runtime of 5m0s>
- ubuntu@sunbeam:~/snaphelpers-lp2162621$ juju ssh -m admin/openstack-machines cinder-volume/0 "grep -n -A6 'def run(self, \*args: str)' /snap/cinder-volume/current/lib/python3.12/site-packages/snaphelpers/_ctl.py"
- 263: def run(self, *args: str) -> str:
- 264- """Execute the command and return its output.
- 265-
- 266- :param args: command args.
- 267-
- 268- """
- 269- process = Popen([self._executable, *args], stdout=PIPE, stderr=PIPE)
- Connection to 10.47.122.1 closed.
- ubuntu@sunbeam:~/snaphelpers-lp2162621$ BASE64_BUNDLE="$(base64 -w 0 large-ca-bundle.pem)"
- printf 'raw bundle: %s bytes\n' "$(wc -c < large-ca-bundle.pem)"
- printf 'base64: %s bytes\n' "${#BASE64_BUNDLE}"
- test "${#BASE64_BUNDLE}" -gt 65536
- test "${#BASE64_BUNDLE}" -lt 120000
- raw bundle: 75320 bytes
- base64: 100428 bytes
- 2, build snap to include the fix
- cd /bak/work/sunbeam/snap-cinder-volume
- snapcraft pack
- ls cinder-volume_2024.1-5ffe6246_amd64.snap
- scp -i ~/.ssh/id_rsa_old cinder-volume_2024.1-5ffe6246_amd64.snap [email protected]:/tmp/
- 2, apply for the fix
- sudo snap save cinder-volume
- $ snap saved
- Set Snap Age Version Rev Size Notes
- 1 cinder-volume 5.42s 2024.1-4c94ab3f 137 14.1kB -
- sudo snap remove cinder-volume
- sudo snap install --dangerous /tmp/cinder-volume_2024.1-5ffe6246_amd64.snap
- $ sudo snap install --dangerous /tmp/cinder-volume_2024.1-5ffe6246_amd64.snap
- cinder-volume 2024.1-5ffe6246 installed
- sudo snap restore 1 cinder-volume
- sudo snap restart cinder-volume.cinder-volume
- snap services cinder-volume
- $ grep -nE 'process\.communicate|process\.wait' /snap/cinder-volume/current/lib/python3.12/site-packages/snaphelpers/_ctl.py
- 272: output, error = process.communicate()
- BASE64_BUNDLE="$(base64 -w 0 large-ca-bundle.pem)"
- sudo snap set cinder-volume "ca.bundle=$BASE64_BUNDLE"
- ubuntu@sunbeam:~/snaphelpers-lp2162621$ BASE64_BUNDLE="$(base64 -w 0 large-ca-bundle.pem)"
- sudo snap set cinder-volume "ca.bundle=$BASE64_BUNDLE"
- 2026-09-29T06:18:33Z INFO task ignored
- ubuntu@sunbeam:~/snaphelpers-lp2162621$ snap services cinder-volume
- Service Startup Current Notes
- cinder-volume.cinder-volume enabled active -
- 3, reset the test env
- sudo snap unset cinder-volume ca.bundle
Add Comment
Please, Sign In to add comment