App suddenly broke due to "Error installing requirements"

  1. https://rhev-subtyping.streamlit.app/
  2. GitHub - sxh1136/rHEV-subtype-webapp
  3. Unpacking r-doc-html (4.2.2.20221110-2) ...
    
    Selecting previously unselected package va-driver-all:amd64.
    
    Preparing to unpack .../819-va-driver-all_2.17.0-1_amd64.deb ...
    
    Unpacking va-driver-all:amd64 (2.17.0-1) ...
    
    Selecting previously unselected package vdpau-driver-all:amd64.
    
    Preparing to unpack .../820-vdpau-driver-all_1.5-2_amd64.deb ...
    
    Unpacking vdpau-driver-all:amd64 (1.5-2) ...
    
    Selecting previously unselected package x11-utils.
    
    Preparing to unpack .../821-x11-utils_7.7+5_amd64.deb ...
    
    Unpacking x11-utils (7.7+5) ...
    
    Selecting previously unselected package x11-xserver-utils.
    
    Preparing to unpack .../822-x11-xserver-utils_7.7+9+b1_amd64.deb ...
    
    Unpacking x11-xserver-utils (7.7+9+b1) ...
    
    Selecting previously unselected package libegl1:amd64.
    
    Preparing to unpack .../823-libegl1_1.6.0-1_amd64.deb ...
    
    Unpacking libegl1:amd64 (1.6.0-1) ...
    
    Selecting previously unselected package zutty.
    
    Preparing to unpack .../824-zutty_0.14.0.20230218+dfsg1-1_amd64.deb ...
    
    Unpacking zutty (0.14.0.20230218+dfsg1-1) ...
    
    Errors were encountered while processing:
    
     /tmp/apt-dpkg-install-h8eVny/218-libodbc2_2.3.11-2+deb12u1_amd64.deb
    
     /tmp/apt-dpkg-install-h8eVny/219-unixodbc-common_2.3.11-2+deb12u1_all.deb
    
     /tmp/apt-dpkg-install-h8eVny/220-libodbcinst2_2.3.11-2+deb12u1_amd64.deb
    
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    
    [03:22:51] ❗️ installer returned a non-zero exit code
    
    [03:22:51] ❗️ Error during processing dependencies! Please fix the error and push an update, or try restarting the app.
    

Python version = 3.12, streamlit version = 1.50

App has been working fine for months but has recently stopped working with the above error. I have tried updating the streamlit version, rebooting the app, as well as remaking the app entirely but the error continues to persist. The app works well when run locally.

Thanks for you help in advance.

Found the actual error code in the logs:

Preparing to unpack …/218-libodbc2_2.3.11-2+deb12u1_amd64.deb …
Unpacking libodbc2:amd64 (2.3.11-2+deb12u1) …
dpkg: error processing archive /tmp/apt-dpkg-install-X2t9MC/218-libodbc2_2.3.11-2+deb12u1_amd64.deb (–unpack):
trying to overwrite ‘/usr/lib/x86_64-linux-gnu/libodbc.so.2.0.0’, which is also in package libodbc1:amd64 2.3.11-3
Selecting previously unselected package unixodbc-common.
Preparing to unpack …/219-unixodbc-common_2.3.11-2+deb12u1_all.deb …
Unpacking unixodbc-common (2.3.11-2+deb12u1) …
dpkg: error processing archive /tmp/apt-dpkg-install-X2t9MC/219-unixodbc-common_2.3.11-2+deb12u1_all.deb (–unpack):
trying to overwrite ‘/etc/odbc.ini’, which is also in package odbcinst 2.3.11-3
Selecting previously unselected package libodbcinst2:amd64.
Preparing to unpack …/220-libodbcinst2_2.3.11-2+deb12u1_amd64.deb …
Unpacking libodbcinst2:amd64 (2.3.11-2+deb12u1) …
dpkg: error processing archive /tmp/apt-dpkg-install-X2t9MC/220-libodbcinst2_2.3.11-2+deb12u1_amd64.deb (–unpack):
trying to overwrite ‘/usr/lib/x86_64-linux-gnu/libodbcinst.so.2.0.0’, which is also in package odbcinst1debian2:amd64 2.3.11-3

Seems like there are some package conflicts but as far as I know these packages are not related to anything in my requirements.txt or packages.txt. Would really appreciate any help or insight.

Having gone through the dependencies one by one it appears the issue arises from conflicts when installing packages from CRAN - r-cran-ape and r-cran-phangorn.

This boils down to libodbc2installation falling because it conflicts with the preinstalled libodbc1. Actually these packages don’t conflict in Debian Bookworm, but this specific version of libodbc1 doesn’t come from Debian but from a Microsoft repository and causes the problem.

Here is a reddit post from an user that was able to solve this issue in its own machine:

Unfortunately I don’t know how (or even if) repositories can be deactivated in Streamlit Cloud, and I guess it must be there for a reason anyway. So you are going to need somebody with better knowledge of how Streamlit Cloud VMs are set up to chip in. If that doesn’t happen, maybe file a bug report.

Don’t bother, I did it for you.

Thanks for doing that. In the mean time I’ve tried to implement the R code calculation in python using Biopython. The result isn’t identical but will do in the mean time whilst the streamlit team look into the issue.