zhhuabj

Untitled

Aug 24th, 2026
34
0
273 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.59 KB | None | 0 0
  1. 1, successfully produce the problem
  2.  
  3. mkdir -p ~/snaphelpers-lp2162621
  4. cd ~/snaphelpers-lp2162621
  5. openssl req -x509 -newkey rsa:4096 -nodes \
  6. -keyout test-ca.key \
  7. -out test-ca.pem \
  8. -days 365 \
  9. -subj '/CN=snaphelpers-lp2162621-test-ca' \
  10. -addext 'basicConstraints=critical,CA:TRUE' \
  11. -addext 'keyUsage=critical,keyCertSign,cRLSign'
  12. openssl x509 -in test-ca.pem -noout -subject -issuer -text | grep -E 'Subject:|Issuer:|CA:TRUE'
  13.  
  14. for _ in $(seq 1 40); do
  15. cat test-ca.pem
  16. done > large-ca-bundle.pem
  17. BASE64_BUNDLE="$(base64 -w 0 large-ca-bundle.pem)"
  18. printf 'raw bundle: %s bytes\n' "$(wc -c < large-ca-bundle.pem)"
  19. printf 'base64: %s bytes\n' "${#BASE64_BUNDLE}"
  20. test "${#BASE64_BUNDLE}" -gt 65536
  21. test "${#BASE64_BUNDLE}" -lt 120000
  22. sudo snap set cinder-volume "ca.bundle=$BASE64_BUNDLE"
  23.  
  24. $ sudo snap set cinder-volume "ca.bundle=$BASE64_BUNDLE"
  25. error: cannot perform the following tasks:
  26. - Run configure hook of "cinder-volume" snap (run hook "configure": <exceeded maximum runtime of 5m0s>)
  27. $ sudo journalctl -u snapd -f
  28. 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>
  29. $ 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"
  30. 263: def run(self, *args: str) -> str:
  31. 264- """Execute the command and return its output.
  32. 265-
  33. 266- :param args: command args.
  34. 267-
  35. 268- """
  36. 269- process = Popen([self._executable, *args], stdout=PIPE, stderr=PIPE)
  37.  
  38. $ snap tasks 231
  39. Status Spawn Ready Summary
  40. Error today at 05:25 UTC today at 05:30 UTC Run configure hook of "cinder-volume" snap
  41.  
  42. ......................................................................
  43. Run configure hook of "cinder-volume" snap
  44.  
  45. 2026-08-24T05:30:03Z ERROR run hook "configure": <exceeded maximum runtime of 5m0s>
  46.  
  47.  
  48. 2, restore test env
  49.  
  50. $ sudo snap unset cinder-volume ca.bundle
  51. 2026-08-24T05:38:31Z INFO Waiting for "snap.cinder-volume.cinder-volume.service" to stop.
  52.  
  53.  
  54. 3, build snap to include the fix
  55.  
  56. cd /bak/work/sunbeam/snap-cinder-volume
  57. git fetch origin stable/2024.1
  58. git checkout -b 2024.1_pip_overflow_lp2162621 origin/stable/2024.1
  59.  
  60. mkdir -p snap/patches
  61. #remember to remove test code from the patch
  62. cp /bak/work/sunbeam/snap-helpers/0001-fix-avoid-SnapCtl-pipe-deadlock.patch snap/patches/snaphelpers-avoid-pipe-deadlock.patch
  63.  
  64. hua@y9000p:/bak/work/sunbeam/snap-cinder-volume$ git diff snap/snapcraft.yaml
  65. diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml
  66. index e9a769e..42707c7 100644
  67. --- a/snap/snapcraft.yaml
  68. +++ b/snap/snapcraft.yaml
  69. @@ -59,6 +59,7 @@ parts:
  70. plugin: nil
  71. build-packages:
  72. - git
  73. + - patch
  74. override-build: |
  75. set -eu
  76. craftctl default
  77. @@ -124,6 +125,9 @@ parts:
  78. update-alternatives --install /usr/bin/cargo cargo /usr/bin/cargo-1.91 191
  79. uv export --frozen --no-hashes --format=requirements-txt -o requirements.txt
  80. craftctl default
  81. + patch --batch --forward --strip=1 \
  82. + --directory="$CRAFT_PART_INSTALL/lib/python3.12/site-packages" \
  83. + < "$CRAFT_PROJECT_DIR/snap/patches/snaphelpers-avoid-pipe-deadlock.patch"
  84. cinder-snap-helpers write-hooks
  85.  
  86. bin:
  87.  
  88. cd /bak/work/sunbeam/snap-cinder-volume
  89. git add snap/snapcraft.yaml snap/patches/snaphelpers-avoid-pipe-deadlock.patch
  90. git commit -m "test: apply local SnapCtl pipe deadlock fix"
  91.  
  92. tox -e py3
  93. snapcraft pack
  94. ls -lh cinder-volume_*.snap
  95. 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'
  96. 272: output, error = process.communicate()
  97. scp -i ~/.ssh/id_rsa_old cinder-volume_*.snap [email protected]:/tmp/cinder-volume-lp2162621.snap
  98.  
  99. 4, install new snap
  100.  
  101. ssh -i ~/.ssh/id_rsa_old [email protected]
  102. sudo snap save cinder-volume
  103. snap saved
  104. sudo snap remove cinder-volume
  105. sudo snap install --dangerous /tmp/cinder-volume-lp2162621.snap
  106. sudo snap restore 1 cinder-volume
  107. sudo snap restart cinder-volume.cinder-volume
  108. snap services cinder-volume
  109. $ grep -nE 'process\.communicate|process\.wait' /snap/cinder-volume/current/lib/python3.12/site-packages/snaphelpers/_ctl.py/_ctl.py
  110. 272: output, error = process.communicate()
  111.  
  112. BASE64_BUNDLE="$(base64 -w 0 large-ca-bundle.pem)"
  113. sudo snap set cinder-volume "ca.bundle=$BASE64_BUNDLE"
  114. $ sudo snap set cinder-volume "ca.bundle=$BASE64_BUNDLE"
  115. 2026-08-24T07:13:24Z INFO Waiting for "snap.cinder-volume.cinder-volume.service" to stop
  116. $ snap services cinder-volume
  117. Service Startup Current Notes
  118. cinder-volume.cinder-volume enabled active -
  119.  
  120.  
  121. $ snap tasks 243
  122. Status Spawn Ready Summary
  123. Done today at 07:13 UTC today at 07:13 UTC Run configure hook of "cinder-volume" snap
  124. Done today at 07:13 UTC today at 07:13 UTC restart of [cinder-volume.cinder-volume]
  125. Done today at 07:13 UTC today at 07:13 UTC Run service command "restart" for running services of snap "cinder-volume"
  126.  
  127. ......................................................................
  128. restart of [cinder-volume.cinder-volume]
  129.  
  130. 2026-08-24T07:13:23Z INFO task ignored
  131.  
  132. ......................................................................
  133. Run service command "restart" for running services of snap "cinder-volume"
  134.  
  135. 2026-08-24T07:13:24Z INFO Waiting for "snap.cinder-volume.cinder-volume.service" to stop.
Add Comment
Please, Sign In to add comment