zhhuabj

Untitled

Sep 29th, 2026
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.46 KB | None | 0 0
  1. 1, reproduce 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. cd ~/snaphelpers-lp2162621
  15. rm -f large-ca-bundle.pem
  16. for _ in $(seq 1 40); do
  17. cat test-ca.pem
  18. done > large-ca-bundle.pem
  19.  
  20. BASE64_BUNDLE="$(base64 -w 0 large-ca-bundle.pem)"
  21.  
  22. sunbeam disable tls vault
  23. sudo snap set cinder-volume "ca.bundle=$BASE64_BUNDLE"
  24.  
  25. ubuntu@sunbeam:~/snaphelpers-lp2162621$ sudo snap set cinder-volume "ca.bundle=$BASE64_BUNDLE"
  26. error: cannot perform the following tasks:
  27. - Run configure hook of "cinder-volume" snap (run hook "configure": <exceeded maximum runtime of 5m0s>)
  28.  
  29. ubuntu@sunbeam:~/snaphelpers-lp2162621$ sudo journalctl -u snapd -f
  30. ...
  31. 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>
  32.  
  33. 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"
  34. 263: def run(self, *args: str) -> str:
  35. 264- """Execute the command and return its output.
  36. 265-
  37. 266- :param args: command args.
  38. 267-
  39. 268- """
  40. 269- process = Popen([self._executable, *args], stdout=PIPE, stderr=PIPE)
  41. Connection to 10.47.122.1 closed.
  42.  
  43. ubuntu@sunbeam:~/snaphelpers-lp2162621$ BASE64_BUNDLE="$(base64 -w 0 large-ca-bundle.pem)"
  44. printf 'raw bundle: %s bytes\n' "$(wc -c < large-ca-bundle.pem)"
  45. printf 'base64: %s bytes\n' "${#BASE64_BUNDLE}"
  46. test "${#BASE64_BUNDLE}" -gt 65536
  47. test "${#BASE64_BUNDLE}" -lt 120000
  48. raw bundle: 75320 bytes
  49. base64: 100428 bytes
  50.  
  51. 2, build snap to include the fix
  52.  
  53. cd /bak/work/sunbeam/snap-cinder-volume
  54. snapcraft pack
  55. ls cinder-volume_2024.1-5ffe6246_amd64.snap
  56. scp -i ~/.ssh/id_rsa_old cinder-volume_2024.1-5ffe6246_amd64.snap [email protected]:/tmp/
  57.  
  58. 2, apply for the fix
  59.  
  60. sudo snap save cinder-volume
  61. $ snap saved
  62. Set Snap Age Version Rev Size Notes
  63. 1 cinder-volume 5.42s 2024.1-4c94ab3f 137 14.1kB -
  64.  
  65. sudo snap remove cinder-volume
  66. sudo snap install --dangerous /tmp/cinder-volume_2024.1-5ffe6246_amd64.snap
  67. $ sudo snap install --dangerous /tmp/cinder-volume_2024.1-5ffe6246_amd64.snap
  68. cinder-volume 2024.1-5ffe6246 installed
  69.  
  70. sudo snap restore 1 cinder-volume
  71. sudo snap restart cinder-volume.cinder-volume
  72. snap services cinder-volume
  73. $ grep -nE 'process\.communicate|process\.wait' /snap/cinder-volume/current/lib/python3.12/site-packages/snaphelpers/_ctl.py
  74. 272: output, error = process.communicate()
  75.  
  76. BASE64_BUNDLE="$(base64 -w 0 large-ca-bundle.pem)"
  77. sudo snap set cinder-volume "ca.bundle=$BASE64_BUNDLE"
  78.  
  79. ubuntu@sunbeam:~/snaphelpers-lp2162621$ BASE64_BUNDLE="$(base64 -w 0 large-ca-bundle.pem)"
  80. sudo snap set cinder-volume "ca.bundle=$BASE64_BUNDLE"
  81. 2026-09-29T06:18:33Z INFO task ignored
  82. ubuntu@sunbeam:~/snaphelpers-lp2162621$ snap services cinder-volume
  83. Service Startup Current Notes
  84. cinder-volume.cinder-volume enabled active -
  85.  
  86.  
  87. 3, reset the test env
  88.  
  89. sudo snap unset cinder-volume ca.bundle
  90.  
Add Comment
Please, Sign In to add comment