I was about to apply your patch, though reading it, I realized that even if the 
compress fails 5 times, the postinst will continue to execute instead of 
returning an error. That's not what we want... So I cannot apply the patch 
as-is.

Ok, revised patch attached.


Regarding the way to properly debug this, since I modified my setup to be able
to build either modified packages or packages using modified build-dependencies,
I was thinking about something like this in postinst:

# Compress the JS and CSS with python-compressor and python-lesscpy
- take a btrfs snapshot before compress
- try compress
- if compress fails, email me about it and sleep for 24 hours, I would
then give you ssh access to the machine, as the bug would be 100%
reproducible then.

Would you be willing to debug it properly if I gave you ssh access
to a machine where we know the compress operation will fail?

(If not, I will probably not bother, but if yes, maybe we could try it,
this bug has become a real challenge).

Thanks.
diff --git a/debian/changelog b/debian/changelog
index fde99ffd7..52c0003aa 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+horizon (3:25.1.0-6) unstable; urgency=medium
+
+  * Drop extra semicolon and add missing newline at the end
+    of serial_console.scss.
+  * Make openstack-dashboard postinst to try the compress operation several
+    times, as it seems to fail in a purely random way. Closes: #1069097.
+
+ -- Thomas Goirand <z...@debian.org>  Fri, 03 Jan 2025 10:45:00 +0100
+
 horizon (3:25.1.0-5) unstable; urgency=medium
 
   * Switch to pybuild (Closes: #1090420).
diff --git a/debian/openstack-dashboard.postinst 
b/debian/openstack-dashboard.postinst
index d24971322..cf3199e7e 100644
--- a/debian/openstack-dashboard.postinst
+++ b/debian/openstack-dashboard.postinst
@@ -10,7 +10,19 @@ rebuild_static() {
        # Compress the JS and CSS with python-compressor and python-lesscpy
        if [ -x /usr/share/openstack-dashboard/manage.py ] ; then
                /usr/share/openstack-dashboard/manage.py collectstatic 
--noinput --clear
-               /usr/share/openstack-dashboard/manage.py compress --force
+               compress_ok="false"
+               for a in 1 2 3 4 5; do
+                       if /usr/share/openstack-dashboard/manage.py compress 
--force; then
+                               compress_ok="true"
+                               break
+                       else
+                               echo "attempt ${a} failed"
+                       fi
+               done
+               if [ "$compress_ok" = "false" ]; then
+                       echo "The compress operation failed after 5 attempts."
+                       exit 1
+               fi
        fi
 
        if [ -f /var/lib/openstack-dashboard/secret-key/.secret_key_store ]; 
then
diff --git a/debian/patches/fix-serial_console.scss.patch 
b/debian/patches/fix-serial_console.scss.patch
index d755a892a..7d92d5cff 100644
--- a/debian/patches/fix-serial_console.scss.patch
+++ b/debian/patches/fix-serial_console.scss.patch
@@ -15,3 +15,10 @@ Last-Update: 2024-11-18
  }
  
  .terminal {
+@@ -16,4 +16,4 @@
+ .terminal-cursor {
+   color: black;
+   background: white;
+-};
+\ No newline at end of file
++}

Reply via email to