guix-deploy-failed-to-update-my-guix-server.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <!DOCTYPE html><head><meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" /><meta name="keywords" content="GNU, Emacs, Libre Software, Hurd, Guile, Guix" /><meta name="description" content="GNUcode.me is a website focusing on libre software projects, especially the GNU project." /><link type="application/atom+xml" rel="alternate" title="GNUcode.me -- Feed" href="/feed.xml" /><a rel="me" href="https://fosstodon.org/@thegnuguy"></a><link type="text/css" href="css/footer.min.css" rel="stylesheet"></link><link type="text/css" href="css/header.min.css" rel="stylesheet"></link><link type="text/css" href="css/main.min.css" rel="stylesheet"></link><title>Guix Deploy failed to update my guix server — GNUcode.me</title></head><body><header><nav><ul><li><a href="index.html">GNUcode.me</a></li><li><a href="services.html">Services</a></li><li><a href="about.html">About</a></li><li><a href="business-ideas.html">Business-ideas</a></li></ul></nav></header><h1>Guix Deploy failed to update my guix server</h1><main><section class="basic-section-padding"><article><h3>by Joshua Branson — May 08, 2024</h3><div><p>tl;dr You may run into trouble updating Guix System, if you rarely update it.
  2. You may also discover that using <code>guix deploy</code> to update your server will
  3. silently fail and not tell you. When you use guix deploy…you may want to do
  4. something like this:</p><pre><code>joshua@laptopT400 $ guix deploy gnucode.me-current-config.scm -x -- \
  5. guix describe &amp;&amp; guix system describe; \
  6. sudo herd restart nginx;</code></pre><p>On with the blog post!</p><p>So my server that runs <a href="https://gnucode.me">https://gnucode.me</a> is a guix system linode server!  Woo
  7. hoo! Well lately the server is being a right pain, and it refuses to update.
  8. Most likely my server is lonely and just wants a hug. Let’s see how outdated
  9. the server is eh?</p><pre><code>joshua@gnucode.me $ guix system describe
  10. Generation 20 Aug 17 2023 07:45:06 (current)
  11. file name: /var/guix/profiles/system-20-link
  12. canonical file name: /gnu/store/g10d07ab2hfspvj0wglwlicmphi9ly07-system
  13. label: GNU with Linux-Libre 6.3.13
  14. bootloader: grub
  15. root device: /dev/sda
  16. kernel: /gnu/store/224j20diq0qgxqzmh1hgsp35zi3qn9jc-linux-libre-6.3.13/bzImage
  17. channels:
  18. guix:
  19. repository URL: https://git.savannah.gnu.org/git/guix.git
  20. branch: master
  21. commit: 210bbf9c59355218fec1484a686cc2ecdc218506
  22. guixrus:
  23. repository URL: https://git.sr.ht/~whereiseveryone/guixrus
  24. branch: master
  25. commit: d70a9ea65eba43aba3ec7560d797452c01171b85
  26. nonguix:
  27. repository URL: https://gitlab.com/nonguix/nonguix
  28. branch: master
  29. commit: 1a3082c574077aaf6771ff927e725fc390a2d531
  30. configuration file: /gnu/store/8xi1rqijhlafnrvzrgla7k3qlkl9jsfw-configuration.scm
  31. joshua@gnucode.me $ guix describe
  32. Generation 2 Aug 17 2023 07:11:45 (current)
  33. guix 1b2d43f
  34. repository URL: https://git.savannah.gnu.org/git/guix.git
  35. branch: master
  36. commit: 1b2d43fe016848ea2ec16ff18cbc14340944fc4e</code></pre><p>Yikes! My guix system server is 6 or 7 months outdated! That’s not good!
  37. Let’s fix that!</p><p>I have used guix deploy in the past to update my linode server, which works
  38. super awesomely well! But lately, guix deploy no longer updates my linode
  39. server. Let’s go ahead and try to update my linode server via guix deploy, just
  40. to ensure that guix deploy is not working. :)</p><pre><code>joshua@laptopT400 $ guix deploy gnucode.me-current-config.scm -x -- sudo herd restart nginx
  41. guix deploy: sending 12 store items (133 MiB) to '45.56.66.20'...
  42. guix deploy: copertino: command succeeded
  43. guix deploy: command output on copertino:
  44. Service user-homes has been started.
  45. Service nginx has been started.</code></pre><p>Let’s see if gnucode.me has been updated:</p><pre><code>joshua@gnucode.me $ guix describe
  46. Aug 2023 # (the same date as before)
  47. joshua@gnucode.me $ guix system describe
  48. Aug 2023 # (the same date as before)</code></pre><p>So it appears that guix deploy is not updating my server. I’ve been <code>guix deploying</code> my server for a while now, and I didn’t even realize that the server
  49. was failing to update (because my services all stayed the same between updates).</p><p>Well, I recently fixed a similar issue, where my laptop was really outdated and
  50. <code>guix pull</code> failed. To update my laptop I built guix from source (I even made a
  51. <a href="https://issues.guix.gnu.org/68760">bug report</a> for it). So I might end up
  52. rebuilding guix on my server from source too.</p><p>Well, since <code>guix deploy</code> failed to update my linode server, let’s try
  53. updating with <code>guix pull</code>. First I powered down the linode and updated the vm so
  54. that it had 4GB of RAM (guix really needs at least 2GB of RAM to function well).</p><p>Anyway, at 2pm, I ran <code>guix pull</code>. It started building stuff, and I let it sit.</p><pre><code>joshua@gnucode.me $ guix pull
  55. # more output above
  56. building /gnu/store/lb5b7svdmfj1ijnzrripsjcv0bhqzpwb-Python-3.5.9.tar.xz.drv...
  57. building /gnu/store/z8kqgsx6yh2mpm0n2jhzk1phihdscazf-datefudge_1.23.tar.xz.drv...
  58. building /gnu/store/9cl9w041lwjz607f5l6pzjzgixdl1jjm-Python-3.5.9.tar.xz.drv...
  59. building /gnu/store/8r73jwy621pvmbfyk34w0gqf65sff9di-elfutils-0.187.tar.bz2.drv...
  60. building /gnu/store/0innk69jqi1zadpwyi8p9szdl95l2lk0-expat-2.5.0.tar.xz.drv...
  61. building /gnu/store/3zysg963rlp01rpkjwsi8qzfr84kwd9d-gcc-11.3.0.tar.xz.drv...
  62. building /gnu/store/lpkc0wsvgbfz0qwxn1nckh88n4xrg1kg-gettext-0.19.8.1.tar.gz.drv...
  63. building /gnu/store/g6qb58plai65zdps620ny2rfif1z42s0-gettext-0.21.tar.gz.drv...
  64. building /gnu/store/dc2y0rldz6wadknqz4jl6zjb7l4xsay5-glibc-2.35.tar.xz.drv...
  65. building /gnu/store/gb6lfdzqprh1fmw91kpkclywg8sbrwg3-glibc-mesboot0-2.2.5.drv...
  66. / 'install' phase^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[|
  67. building /gnu/store/5s4cfyc3w6jn958jn1i09g6my4g7l9l4-glibc-2.35.tar.xz.drv...
  68. building /gnu/store/qm63mzpmzriksa9vi0gl977h7qhcmgkg-gcc-mesboot0-2.95.3.drv...
  69. building /gnu/store/1hrskysmxkyblhw8mpkkz1m2jn4g0f8s-gmp-6.0.0a.tar.xz.drv...
  70. building /gnu/store/cfbs6ysgyrqwfgbkd15gkbf7brgfgvk3-binutils-mesboot1-2.20.1a.drv...
  71. building /gnu/store/b4xy58rqb3cqw2wiip8l0ibf9crk13zd-gmp-6.0.0a.tar.xz.drv...
  72. building /gnu/store/1vp4cjnwxr55basnbjr4vfd5l5pmf41c-gnutls-3.8.3.tar.xz.drv...
  73. building /gnu/store/j9vzm9yrkzfsgjpliab737fllq6kkm7q-guile-lib-0.2.8.tar.gz.drv...
  74. building /gnu/store/wh7yqmqk07p7xby179razdbp6ysgqygl-isl-0.24.tar.xz.drv...
  75. building /gnu/store/c3ds6y32xq9xck076apm525qqvp649ia-libffi-3.4.4.tar.gz.drv...
  76. building /gnu/store/nn8hm6242hfwv906v1dy2m7sq3yv3hsh-libunistring-1.0.tar.xz.drv...
  77. building /gnu/store/05nznjzl8qfsdps7wd51852babfvrndw-m4-1.4.19.tar.xz.drv...
  78. building /gnu/store/6hqxh7hlcarn7l3y32pn4l3gkjbpkjia-make-mesboot-3.82.drv...
  79. building /gnu/store/jxg62mw1619fznmnq3b7if5nv08s5q1i-module-import-compiled.drv...
  80. building /gnu/store/gmw2a5zxc6liilr8jwpdw51isfrbrkis-gcc-mesboot1-4.6.4.drv...
  81. - 'build' phas-
  82. \
  83. \ 'build' phas/^C</code></pre><p>I started the guix pull command at 2pm. At 5pm…the server was still trying to
  84. build gcc-mesboot0. That sounds like it’s trying to build guix from source,
  85. which will take a <em>long</em> time. I like my server, and I don’t want to make it
  86. that busy.</p><p>Let’s check guix weather. Maybe I don’t have a lot of substitutes available.</p><pre><code>joshua@gnucode.me $ guix weather
  87. https://ci.guix.gnu.org ☀
  88. 88.0% substitutes available (25,358 out of 28,805)
  89. at least 102,748.6 MiB of nars (compressed)
  90. 177,798.9 MiB on disk (uncompressed)
  91. 0.009 seconds per request (32.5 seconds in total)
  92. 106.0 requests per second
  93. 0.0% (0 out of 3,447) of the missing items are queued
  94. at least 1,000 queued builds
  95. aarch64-linux: 974 (97.4%)
  96. i686-linux: 14 (1.4%)
  97. x86_64-linux: 11 (1.1%)
  98. powerpc64le-linux: 1 (.1%)
  99. build rate: 22.87 builds per hour
  100. powerpc64le-linux: 2.10 builds per hour
  101. i686-linux: 10.75 builds per hour
  102. x86_64-linux: 9.42 builds per hour
  103. aarch64-linux: 0.53 builds per hour
  104. armhf-linux: 0.03 builds per hour
  105. i586-gnu: 0.05 builds per hour
  106. looking for 28,805 store items on https://bordeaux.guix.gnu.org...
  107. https://bordeaux.guix.gnu.org ☀
  108. 96.9% substitutes available (27,923 out of 28,805)
  109. at least 72,788.8 MiB of nars (compressed)
  110. 216,904.7 MiB on disk (uncompressed)
  111. 0.005 seconds per request (135.6 seconds in total)
  112. 191.3 requests per second
  113. (continuous integration information unavailable)</code></pre><p>Ok, I had plenty of substitutes available. It looks like <code>guix pull</code> is not
  114. really going to work.</p><p>Now that the “easy” way to update my server has failed (via <code>guix pull</code>), let’s try to update it by <a href="https://guix.gnu.org/manual/en/html_node/Building-from-Git.html">building guix from
  115. source</a>! Since
  116. my linode server now has 4 GB of RAM, this should work.</p><pre><code>joshua@gnucode.me $ guix package --delete-generations
  117. joshua@gnucode.me $ sudo guix system delete-generations
  118. joshua@gnucode.me $ guix gc
  119. joshua@gnucode.me $ guix shell -D guix help2man git strace -CPW
  120. joshua@gnucode.me $ ./bootstrap
  121. joshua@gnucode.me $ ./configure --localstatedir=/var --sysconfdir=/etc
  122. joshua@gnucode.me $ make
  123. joshua@gnucode.me $ exit # you have to leave the container environment, or
  124. # your substitutes will not work.
  125. joshua@gnucode.me $ sudo -E ./pre-inst-env guix system reconfigure \
  126. ../guix-config/linode-guix-system-configuration/gnucode.me-current-config.scm</code></pre><p>The above command failed a few times, because I had to tweak the
  127. <code>gnucode.me-current-config.scm file</code>. First I had to change <code>dovecot-service</code> to
  128. <code>dovecot-service-type</code>. Then I had to get rid of the deploy stuff in the file.
  129. Then I was able to rerun the command and it started to work:</p><p>Woo hoo! It worked!</p><p>And a new <code>guix pull</code> invocation also worked!</p><p>I should also probably create a <code>gnucode.me-current-config-deploy.scm</code> file. I
  130. should also probably email <code>bug-guix@gnu.org</code> to have <code>guix deploy</code> output the
  131. results of <code>guix describe</code> and <code>guix system describe</code>. Or perhaps before <code>guix deploy</code> deploys the update, it should record the results of <code>guix describe</code> and
  132. <code>guix system describe</code>. If one or both of those are the same after <code>guix deploy</code>, then it should issue a warning to the user. Until next time!</p></div></article></section></main><footer><p>© 2020 Joshua Branson. The text on this site is free culture under the Creative Commons Attribution Share-Alike 4.0 International license.</p><p>This website is build with Haunt, a static site generator written in Guile Scheme. Source code is <a href="https://notabug.org/jbranso/gnucode.me">available.</a></p><p>The color theme of this website is based off of the famous <a href="#3f3f3f" target="_blank">zenburn</a> theme.</p></footer></body>