I currently have Django code that compiles a LaTeX file using lualatex. It works locally in my virtual environment, but when I deploy my project to Railway, I am getting the following error:

PANIC: unprotected error in call to Lua API (zlib library version does not match - header: 1.2.11, library: 1.3)

I attempted to install zlib version 1.3 (and I also tried 1.2.11) manually with nixpacks in a railway.json file, but the error still persists when I try to compile a LaTeX file on my deployed web app. Here is my railway.json file:

{
  "$schema": "https://schema.up.railway.app/railway.schema.json",
  "build": {
    "builder": "NIXPACKS",
    "nixpacksPlan": {
      "phases": {
        "setup": {
          "aptPkgs": ["...", "texlive-full", "wget"],
          "cmds": [
            "wget https://zlib.net/current/zlib.tar.gz && tar -xzf zlib.tar.gz && cd zlib-1.3 && ./configure && make && sudo make install"
          ]
        }
      }
    }
  },
  "deploy": {
    "startCommand": "python manage.py migrate && python manage.py collectstatic --noinput && gunicorn layoutGenerator.wsgi",
    "restartPolicyType": "ON_FAILURE",
    "restartPolicyMaxRetries": 10
  }
}

and here is my requirements.txt created from my virtual environment:

asgiref==3.7.2
Django==5.0
et-xmlfile==1.1.0
gunicorn==21.2.0
numpy==1.26.2
openpyxl==3.1.2
packaging==23.2
pandas==2.1.3
pdf2image==1.16.3
Pillow==10.1.0
python-dateutil==2.8.2
pytz==2023.3.post1
six==1.16.0
sqlparse==0.4.4
tzdata==2023.3

Everything else seems to work on the web app other than this LaTeX compilation. Any help would be much appreciated!

0

There are 0 best solutions below