Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1, successfully produce 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'
- for _ in $(seq 1 40); do
- cat test-ca.pem
- done > large-ca-bundle.pem
- 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
- sudo snap set cinder-volume "ca.bundle=$BASE64_BUNDLE"
- $ 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>)
- $ sudo journalctl -u snapd -f
- Aug 24 05:30:03 sunbeam-edge snapd[3044]: taskrunner.go:304: Change 231 task (Run configure hook of "cinder-volume" snap) failed: run hook "configure": <exceeded maximum runtime of 5m0s>
- $ 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"_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)
- $ snap tasks 231
- Status Spawn Ready Summary
- Error today at 05:25 UTC today at 05:30 UTC Run configure hook of "cinder-volume" snap
- ......................................................................
- Run configure hook of "cinder-volume" snap
- 2026-08-24T05:30:03Z ERROR run hook "configure": <exceeded maximum runtime of 5m0s>
- 2, restore test env
- $ sudo snap unset cinder-volume ca.bundle
- 2026-08-24T05:38:31Z INFO Waiting for "snap.cinder-volume.cinder-volume.service" to stop.
- 3, build snap to include the fix
- cd /bak/work/sunbeam/snap-cinder-volume
- git fetch origin stable/2024.1
- git checkout -b 2024.1_pip_overflow_lp2162621 origin/stable/2024.1
- mkdir -p snap/patches
- #remember to remove test code from the patch
- cp /bak/work/sunbeam/snap-helpers/0001-fix-avoid-SnapCtl-pipe-deadlock.patch snap/patches/snaphelpers-avoid-pipe-deadlock.patch
- hua@y9000p:/bak/work/sunbeam/snap-cinder-volume$ git diff snap/snapcraft.yaml
- diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml
- index e9a769e..42707c7 100644
- --- a/snap/snapcraft.yaml
- +++ b/snap/snapcraft.yaml
- @@ -59,6 +59,7 @@ parts:
- plugin: nil
- build-packages:
- - git
- + - patch
- override-build: |
- set -eu
- craftctl default
- @@ -124,6 +125,9 @@ parts:
- update-alternatives --install /usr/bin/cargo cargo /usr/bin/cargo-1.91 191
- uv export --frozen --no-hashes --format=requirements-txt -o requirements.txt
- craftctl default
- + patch --batch --forward --strip=1 \
- + --directory="$CRAFT_PART_INSTALL/lib/python3.12/site-packages" \
- + < "$CRAFT_PROJECT_DIR/snap/patches/snaphelpers-avoid-pipe-deadlock.patch"
- cinder-snap-helpers write-hooks
- bin:
- cd /bak/work/sunbeam/snap-cinder-volume
- git add snap/snapcraft.yaml snap/patches/snaphelpers-avoid-pipe-deadlock.patch
- git commit -m "test: apply local SnapCtl pipe deadlock fix"
- tox -e py3
- snapcraft pack
- ls -lh cinder-volume_*.snap
- hua@y9000p:/bak/work/sunbeam/snap-cinder-volume$ unsquashfs -cat cinder-volume_*.snap lib/python3.12/site-packages/snaphelpers/_ctl.py | grep -nE 'process\.communicate|process\.wait'
- 272: output, error = process.communicate()
- scp -i ~/.ssh/id_rsa_old cinder-volume_*.snap [email protected]:/tmp/cinder-volume-lp2162621.snap
- 4, install new snap
- ssh -i ~/.ssh/id_rsa_old [email protected]
- sudo snap save cinder-volume
- snap saved
- sudo snap remove cinder-volume
- sudo snap install --dangerous /tmp/cinder-volume-lp2162621.snap
- 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/_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"
- $ sudo snap set cinder-volume "ca.bundle=$BASE64_BUNDLE"
- 2026-08-24T07:13:24Z INFO Waiting for "snap.cinder-volume.cinder-volume.service" to stop
- $ snap services cinder-volume
- Service Startup Current Notes
- cinder-volume.cinder-volume enabled active -
- $ snap tasks 243
- Status Spawn Ready Summary
- Done today at 07:13 UTC today at 07:13 UTC Run configure hook of "cinder-volume" snap
- Done today at 07:13 UTC today at 07:13 UTC restart of [cinder-volume.cinder-volume]
- Done today at 07:13 UTC today at 07:13 UTC Run service command "restart" for running services of snap "cinder-volume"
- ......................................................................
- restart of [cinder-volume.cinder-volume]
- 2026-08-24T07:13:23Z INFO task ignored
- ......................................................................
- Run service command "restart" for running services of snap "cinder-volume"
- 2026-08-24T07:13:24Z INFO Waiting for "snap.cinder-volume.cinder-volume.service" to stop.
Add Comment
Please, Sign In to add comment