Having some trouble setting up flask backend on Railway
zerkia
TRIALOP

a year ago

Hello Railway

I am trying to host my backend (and later frontend) on Railway, but seem to be having some trouble. The repo has a root directory specified to ensure the backend is what's being deployed.

However it seems that despite there being a Procfile, requirements.txt and that the root has a runtime.txt with the specific Python version needed, that it does not see it properly.

Anyone know what could be causing the issue ? Or is able to help

Solved

138 Replies

zerkia
TRIALOP

a year ago

4cd0f196-cd60-4ec1-bf0d-51e5ec7fdf63


uxuz
MODERATOR

a year ago

Your issue is with the Python version, right?


zerkia
TRIALOP

a year ago

I got a feeling that it's moreso the repository. I'm told it cannot read gunicorn, but that IS in the requirements.txt so I'm not sure what is going wrong


uxuz
MODERATOR

a year ago

Can you show the build and deploy logs?


zerkia
TRIALOP

a year ago

Sure, how do I copy the logs from there though, don't seem to see a copy button


zerkia
TRIALOP

a year ago

Guess I can just mark it:

[Region: us-west1]

==============

Using Nixpacks

==============


context: 0081f12fc1ce8a5c234af1269728346f

╔═════════════════════════ Nixpacks v1.31.0 ═════════════════════════╗

║ setup      │ nodejs_18, npm-8_x                                    ║

║────────────────────────────────────────────────────────────────────║

║ install    │ npm ci                                                ║

║────────────────────────────────────────────────────────────────────║

║ start      │ gunicorn --access-logfile - --error-logfile - run:app ║

╚════════════════════════════════════════════════════════════════════╝

[internal] load build definition from Dockerfile

[internal] load build definition from Dockerfile

[internal] load build definition from Dockerfile  ✔ 0ms

[internal] load build definition from Dockerfile

[internal] load build definition from Dockerfile  ✔ 11ms

[internal] load metadata for ghcr.io/railwayapp/nixpacks:ubuntu-1736208272

[internal] load metadata for ghcr.io/railwayapp/nixpacks:ubuntu-1736208272101ms

[internal] load .dockerignore

[internal] load .dockerignore  ✔ 0ms

[internal] load .dockerignore

[internal] load .dockerignore  ✔ 9ms

[stage-0 8/8] COPY . /app

[stage-0 7/8] RUN printf '\nPATH=/app/node_modules/.bin:$PATH' >> /root/.profile

[internal] load build context  ✔ 0ms

[internal] load build context

[internal] load build context  ✔ 475ms

[stage-0 3/8] COPY .nixpacks/nixpkgs-5624e1334b26ddc18da37e132b6fa8e93b481468.nix .nixpacks/nixpkgs-5624e1334b26ddc18da37e132b6fa8e93b481468.nix  ✔ 0ms – CACHED

[stage-0 4/8] RUN nix-env -if .nixpacks/nixpkgs-5624e1334b26ddc18da37e132b6fa8e93b481468.nix && nix-collect-garbage -d  ✔ 0ms – CACHED

[stage-0 5/8] COPY . /app/.

[stage-0 5/8] COPY . /app/.  ✔ 332ms

[stage-0 6/8] RUN --mount=type=cache,id=s/0d3c87d4-0b8e-4709-b1a1-f5b6127f16be-/root/npm,target=/root/.npm npm ci

npm warn config production Use `--omit=dev` instead.


up to date, audited 1 package in 392ms


found 0 vulnerabilities

[stage-0 6/8] RUN --mount=type=cache,id=s/0d3c87d4-0b8e-4709-b1a1-f5b6127f16be-/root/npm,target=/root/.npm npm ci  ✔ 864ms

[stage-0 7/8] RUN printf '\nPATH=/app/node_modules/.bin:$PATH' >> /root/.profile

[stage-0 7/8] RUN printf '\nPATH=/app/node_modules/.bin:$PATH' >> /root/.profile  ✔ 136ms

[stage-0 8/8] COPY . /app

[stage-0 8/8] COPY . /app  ✔ 224ms

[auth] sharing credentials for us-west1.registry.rlwy.net

[auth] sharing credentials for us-west1.registry.rlwy.net  ✔ 0ms

=== Successfully Built! ===

Run:

docker run -it us-west1.registry.rlwy.net/0d3c87d4-0b8e-4709-b1a1-f5b6127f16be:87752f75-561e-48f8-a2d2-f782d9381696

Build time: 7.72 seconds

zerkia
TRIALOP

a year ago

build seems to "work", but idk if it's cause it just doesn't seem to read the files needed


zerkia
TRIALOP

a year ago

Not gonna act like an expert, I'm a student so this is new to me in terms of hosting via Railway


uxuz
MODERATOR

a year ago

Don't worry, I am also a student and not an expert.


uxuz
MODERATOR

a year ago

The build logs seems to only install node v18, how is your project structured?


zerkia
TRIALOP

a year ago

my project is a repo with a frontend and backend folder. The project itself is owned by a company I intern for, but my exam suddenly required having the project hosted, so I am trying to get it hosted with Railway as it seemed to be able to host the areas needed



zerkia
TRIALOP

a year ago

I already told it what root directory to go for. I however did not mention a start command. CGPT told me it would find the files needed itself and run through Procfile but maybe I set it up wrong, since the deploy logs complains about gunicorn, signaling maybe a lack of requirements.txt being run through


uxuz
MODERATOR

a year ago

You can try putting python as a provider under providers and see if that helps.

1330240842329493800


uxuz
MODERATOR

a year ago

Since the build logs don't show anything Python related


uxuz
MODERATOR

a year ago

maybe this will help, but no guarantees


zerkia
TRIALOP

a year ago

Wonder if I can specify a version on that, since I need a specific version, though the root directory's runtime.txt has that specified


uxuz
MODERATOR

a year ago

You can set the Python version via the NIXPACKS_PYTHON_VERSION env https://nixpacks.com/docs/providers/python


brody
EMPLOYEE

a year ago

-# version in runtime.txt also works


zerkia
TRIALOP

a year ago

added python, seems to do something in the build now so that's hopeful


zerkia
TRIALOP

a year ago

seems to run through requirements now


zerkia
TRIALOP

a year ago

✕ [stage-0 10/13] RUN --mount=type=cache,id=s/0d3c87d4-0b8e-4709-b1a1-f5b6127f16be-/root/cache/pip,target=/root/.cache/pip python -m venv --copies /opt/venv && . /opt/venv/bin/activate && pip install -r requirements.txt 
process "/bin/bash -ol pipefail -c python -m venv --copies /opt/venv && . /opt/venv/bin/activate && pip install -r requirements.txt" did not complete successfully: exit code: 2


Dockerfile:30

-------------------

28 |     ENV NIXPACKS_PATH=/opt/venv/bin:$NIXPACKS_PATH

29 |     COPY . /app/.

30 | >>> RUN --mount=type=cache,id=s/0d3c87d4-0b8e-4709-b1a1-f5b6127f16be-/root/cache/pip,target=/root/.cache/pip python -m venv --copies /opt/venv && . /opt/venv/bin/activate && pip install -r requirements.txt

31 |

32 |     # build phase

-------------------

ERROR: failed to solve: process "/bin/bash -ol pipefail -c python -m venv --copies /opt/venv && . /opt/venv/bin/activate && pip install -r requirements.txt" did not complete successfully: exit code: 2

Error: Docker build failed

zerkia
TRIALOP

a year ago

says no module named distutils, can't say I remember using that


brody
EMPLOYEE

a year ago

-# set a service variable NIXPACKS_VERSION=1.29.1


zerkia
TRIALOP

a year ago

when you say service variable, do you mean I should set this into my .env file ? Sorry if that's a bad question


brody
EMPLOYEE

a year ago


brody
EMPLOYEE

a year ago

-# uxuz shall continue from here


zerkia
TRIALOP

a year ago

Is there a way to check exactly what version of python the railway service installs? I assume it installed the version I needed, but I'm getting an error that there was no suitable python version for the pandas-stubs.

The company's system runs on Python 3.8.4. and runtime.txt in the root of the repository (not the backend directory), mentions that version exactly


uxuz
MODERATOR

a year ago

It's stated in the build logs


zerkia
TRIALOP

a year ago

Did try looking through them, but there is a lot of rows of text so kinda hard to find specifically


uxuz
MODERATOR

a year ago

It's in the table which is like one of the first things it prints out


zerkia
TRIALOP

a year ago

Based on this, it seems it runs python 3.11.9 or am I reading it wrong?

  /nix/store/k7j3cmdpjc23cxd7axkc8j0yvq5cfhw5-postgresql-15.6-man
  /nix/store/xzmgdglbldim3k39pjn16vrgxb3i72as-publicsuffix-list-0-unstable-2024-01-07
  /nix/store/k3701zl6gmx3la7y4dnflcvf3xfy88kh-python3-3.11.9
  /nix/store/95qcp9a6c8kk1aahclj2g7kjzrvzix49-qrencode-4.1.1

uxuz
MODERATOR

a year ago

3.11 is the default



zerkia
TRIALOP

a year ago

Seems the runtime.txt in the repo root might not be read. For safety I think I'll try adding the variable you mentioned earlier. Couldn't hurt I imagine


zerkia
TRIALOP

a year ago

✕ [stage-0  6/13] RUN nix-env -if .nixpacks/nixpkgs-e05605ec414618eab4a7a6aea8b38f6fbbcc8f08.nix && nix-collect-garbage -d 
process "/bin/bash -ol pipefail -c nix-env -if .nixpacks/nixpkgs-e05605ec414618eab4a7a6aea8b38f6fbbcc8f08.nix && nix-collect-garbage -d" did not complete successfully: exit code: 1


Dockerfile:10

-------------------

8 |     RUN nix-env -if .nixpacks/nixpkgs-5148520bfab61f99fd25fb9ff7bfbb50dad3c9db.nix && nix-collect-garbage -d

9 |     COPY .nixpacks/nixpkgs-e05605ec414618eab4a7a6aea8b38f6fbbcc8f08.nix .nixpacks/nixpkgs-e05605ec414618eab4a7a6aea8b38f6fbbcc8f08.nix

10 | >>> RUN nix-env -if .nixpacks/nixpkgs-e05605ec414618eab4a7a6aea8b38f6fbbcc8f08.nix && nix-collect-garbage -d

11 |

12 |

-------------------

ERROR: failed to solve: process "/bin/bash -ol pipefail -c nix-env -if .nixpacks/nixpkgs-e05605ec414618eab4a7a6aea8b38f6fbbcc8f08.nix && nix-collect-garbage -d" did not complete successfully: exit code: 1

Error: Docker build failed

Not exactly sure what went wrong here, I assume it didn't accept the version of python ?


uxuz
MODERATOR

a year ago

Can you show the first few lines from your build logs?

e.g.

[Region: us-west1]
==============
Using Nixpacks
==============
context: 502e3d7d84f9e67f22cc31deb908355f

╔══════ Nixpacks v1.29.1 ══════╗
║ setup      │ go              ║
║──────────────────────────────║
║ install    │ go mod download ║
║──────────────────────────────║
║ build      │ go build -o out ║
║──────────────────────────────║
║ start      │ ./out           ║
╚══════════════════════════════╝

zerkia
TRIALOP

a year ago

Sorry it took a bit, was not at the computer

1330261963930079500


zerkia
TRIALOP

a year ago

did re-check variables, and I did write it correctly with NIXPACKSPYTHONVERSION equaling 3.8.4


uxuz
MODERATOR

a year ago

the Python version seems to be right according to the python:setup (python38), I have no idea why postgresql is there tho


zerkia
TRIALOP

a year ago

I have some other variables as I inserted my full backend .env to ensure the backend is as close to my local one as possible when trying to deploy


zerkia
TRIALOP

a year ago

1330263104399085600


uxuz
MODERATOR

a year ago

<:mildpanic:804271964587819059>


zerkia
TRIALOP

a year ago

Like I said, it's a company server that I need to host non-locally for my exam…it's not very well made by them 🙃


zerkia
TRIALOP

a year ago

But yeah, overall, the python version made it crash before getting to the requirements so I'm confused on what to do from here I will admit


uxuz
MODERATOR

a year ago

Interesting, so it did work with 3.11?


zerkia
TRIALOP

a year ago

well it got to the requirements, where it failed on pandas-stubs due to a lack of a proper python version for what it wanted


uxuz
MODERATOR

a year ago

Can you paste the full build logs for the latest build (the one where you specified Python 3.8)?


zerkia
TRIALOP

a year ago


zerkia
TRIALOP

a year ago

If it helps with a vc call with screen share, let me know


uxuz
MODERATOR

a year ago

well, I am kinda lost on why it doesn't work so I don't think that will help <:mildpanic:804271964587819059>


uxuz
MODERATOR

a year ago

if you have the time, please wait for someone that is smarter than me to help you


zerkia
TRIALOP

a year ago

No worries, thanks for your help, I appreciate it <:amyzH:898576092384866345>


brody
EMPLOYEE

a year ago

are you able to share the repo?


zerkia
TRIALOP

a year ago

It's a private company repo, so I'm not sure I'm really "allowed" to


zerkia
TRIALOP

a year ago

But I can share the requirements and what not if that's what you're looking at


brody
EMPLOYEE

a year ago

have you ran this project locally?


zerkia
TRIALOP

a year ago

Yes, over the last 10 weeks, I've worked on my exam project on it. I just need to host it as the final requirement


brody
EMPLOYEE

a year ago

do you need node when running it locally?


zerkia
TRIALOP

a year ago

I ran it through 2 git node terminals in Cursor / VS Code, one for frontend running npm run start and one running flask through a virtual environment with flask run


brody
EMPLOYEE

a year ago

lets focus on the backend only for now please


brody
EMPLOYEE

a year ago

do you need node to run the backend


zerkia
TRIALOP

a year ago

I do not believe I do no. I don't remember using any node commands to run it, but just venv and flask


brody
EMPLOYEE

a year ago

can you start by removing the node provider then


zerkia
TRIALOP

a year ago

Sure, one moment


zerkia
TRIALOP

a year ago

Should I try deploying ?


brody
EMPLOYEE

a year ago

yes you would want to click the deploy button after making that change


zerkia
TRIALOP

a year ago

Alright, just wanted to be sure in case of other requested changes


zerkia
TRIALOP

a year ago

Trying now


zerkia
TRIALOP

a year ago

I added a new git commit to reflect a requirement removal from the .txt, but how do I attempt another deploy with this git commit in mind? I don't see a deploy with latest commit or similar anywhere, only the last deploy and it having a "Redeploy" button


uxuz
MODERATOR

a year ago

CMD + K > Deploy latest commit


zerkia
TRIALOP

a year ago

Seems the build is successfully running now, but the deploy fails pretty much immediately

1330273054022172742


brody
EMPLOYEE

a year ago

ah its wants the firebase json file


brody
EMPLOYEE

a year ago

you have that locally right?


zerkia
TRIALOP

a year ago

I should have, though I feel like I had it in the .env I posted in there, but give me a moment


brody
EMPLOYEE

a year ago

you dont put json files into .env


zerkia
TRIALOP

a year ago

Nono I know that, but the firebase details I meant. It's a recent addition, not made by me, as I've not worked with firebase before, so I could've missed a file I needed to put in


brody
EMPLOYEE

a year ago

you would want to base64 encode the json file, and then put the base64 string into a service variables, then have some code that runs on start to read that environment variable, decrypt it, and write it to the appropriate file, so that the firebase library can read from the file


zerkia
TRIALOP

a year ago

I do have a pwa_key.json file which has some firebase data in it, which is ignored by git on commit.

I honestly have no clue how to do what you suggested, but I assume the file is already being read somehow by the system since firebase works with that file locally


brody
EMPLOYEE

a year ago

the file is not being uploaded to railway, thats a good thing, but you'll need to do what i suggested


zerkia
TRIALOP

a year ago

Well I will have to figure out how to do that then, cause at the moment I don't know how to, as it is not something I've developed, someone else did


zerkia
TRIALOP

a year ago

Thank you for your help 🙂 Appreciate it


brody
EMPLOYEE

a year ago

few Google searches away and you'll be good


zerkia
TRIALOP

a year ago

Slight update on this issue:

It seems to run now after changing some firebase thing, however I am unable to connect the Redis service I've also created to this. Again I am a student and I've not worked with Redis before so could easily just be me being a goof, but if someone could help me take a quick look at my setup, I'd greatly appreciate it 🙂

I've currently set up the redis service, and have changed the redis_url variable to reflect this new url, but it does not seem to like it. the code that runs the worker itself is not static so it should in theory work, but maybe I forgot to do something.

Any help is appreciated <:widepeepohappy:585535359505399824>


zerkia
TRIALOP

a year ago

Not gonna ping you due to rules, but I saw another thread regarding python-magic that you helped with some time ago Brody, which seems to be my issue as well, despite it being installed via my requirements.txt, so if you're able, I'd greatly appreciate it


brody
EMPLOYEE

a year ago

happy to help but I'd need you to send me the errors you are getting


zerkia
TRIALOP

a year ago

Of course, it mainly seems that libmagic is not being read properly, the error being the following:

Starting Container [2025-01-19 17:06:33 +0000] [1] [INFO] Starting gunicorn 20.1.0 [2025-01-19 17:06:33 +0000] [1] [INFO] Listening at: http://0.0.0.0:39453 (1) [2025-01-19 17:06:33 +0000] [1] [INFO] Using worker: sync [2025-01-19 17:06:33 +0000] [5] [INFO] Booting worker with pid: 5 Temporary folder 'tmp' has been created. Firebase app initialized [2025-01-19 17:06:37 +0000] [5] [ERROR] Exception in worker process File "", line 975, in _find_and_load_unlocked Traceback (most recent call last): File "", line 671, in _load_unlocked File "", line 843, in exec_module File "/opt/venv/lib/python3.8/site-packages/gunicorn/arbiter.py", line 589, in spawn_worker File "", line 219, in _call_with_frames_removed worker.init_process() File "/app/run.py", line 5, in app = create_app(config("CONFIG_NAME")) File "/opt/venv/lib/python3.8/site-packages/gunicorn/workers/base.py", line 134, in init_process File "/app/api/app.py", line 123, in create_app from api.blueprints.fake import fake self.load_wsgi() File "/app/api/blueprints/fake.py", line 34, in File "/opt/venv/lib/python3.8/site-packages/gunicorn/workers/base.py", line 146, in load_wsgi from api.services.openai_api import generete_tutor_bio, TutorBioResponse self.wsgi = self.app.wsgi() File "/app/api/services/openai_api.py", line 20, in from api.langchain.rag import ( File "/opt/venv/lib/python3.8/site-packages/gunicorn/app/base.py", line 67, in wsgi File "/app/api/langchain/rag.py", line 3, in self.callable = self.load() import magic File "/opt/venv/lib/python3.8/site-packages/magic/__init__.py", line 209, in libmagic = loader.load_lib() File "/opt/venv/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 58, in load File "/opt/venv/lib/python3.8/site-packages/magic/loader.py", line 49, in load_lib return self.load_wsgiapp() raise ImportError('failed to find libmagic. Check your installation') ImportError: failed to find libmagic. Check your installation File "/opt/venv/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp return util.import_app(self.app_uri) File "/opt/venv/lib/python3.8/site-packages/gunicorn/util.py", line 359, in import_app mod = importlib.import_module(module) File "/root/.nix-profile/lib/python3.8/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1014, in _gcd_import File "", line 991, in _find_and_load [2025-01-19 17:06:37 +0000] [5] [INFO] Worker exiting (pid: 5) [2025-01-19 17:06:39 +0000] [1] [INFO] Shutting down: Master [2025-01-19 17:06:39 +0000] [1] [INFO] Reason: Worker failed to boot.


brody
EMPLOYEE

a year ago

you said that you saw me help with this In a thread before, did that thread get solved?


zerkia
TRIALOP

a year ago

Let me see if I can find it again



zerkia
TRIALOP

a year ago

Was a different version of python but it seems a dockerfile was used, which I have also tried, but to no success


brody
EMPLOYEE

a year ago

can you define no success?


zerkia
TRIALOP

a year ago

Deployment giving that error


zerkia
TRIALOP

a year ago

This is the dockerfile so far:

FROM python:3.8.4-slim

ENV PYTHONUNBUFFERED=1 \
    PYTHONDONTWRITEBYTECODE=1

RUN apt-get update && apt-get install -y \
    libmagic-dev \
    file \
    build-essential \
    && rm -rf /var/lib/apt/lists/*

WORKDIR /app

COPY . /app

RUN pip install --no-cache-dir -r requirements.txt

RUN python -c "import magic; print(magic.Magic)"

EXPOSE 5000

CMD ["gunicorn", "run:app", "--bind", "0.0.0.0:5000"]

zerkia
TRIALOP

a year ago

basically just been trying with help from CGPT


zerkia
TRIALOP

a year ago

As it has been a few years since I last used docker


zerkia
TRIALOP

a year ago

libmagic 1.0 and python-magic 0.4.27 are specified in my requirements.txt already, but I'm not sure why exactly, but my guess is that one of them doesn't seem to get properly recognized


zerkia
TRIALOP

a year ago

the build logs does mention their installations though


brody
EMPLOYEE

a year ago

so with that Dockerfile you get the error you sent above?


zerkia
TRIALOP

a year ago

with the dockerfile added to the repository, yes


brody
EMPLOYEE

a year ago

how do you know the Dockerfile is being used to do the build?


zerkia
TRIALOP

a year ago

I assume it is from seeing libmagic being installed 2 seperate places, one of which using the .gz file as shown in the pic

1330595386192298000


zerkia
TRIALOP

a year ago

Honestly though, maybe it's not, but I assume it is


brody
EMPLOYEE

a year ago

check the very top of the logs


zerkia
TRIALOP

a year ago

What am I looking for exactly?


brody
EMPLOYEE

a year ago

you'll know when you see it


brody
EMPLOYEE

a year ago

it will tell you what the build was done with


zerkia
TRIALOP

a year ago

I do have this that mentions the dockerfile

1330595934773448700


brody
EMPLOYEE

a year ago

it says nixpacks haha


brody
EMPLOYEE

a year ago

your Dockerfile isn't being used


zerkia
TRIALOP

a year ago

Oh, how do I ensure it does then ?


brody
EMPLOYEE

a year ago

Do you have your Dockerfile named Dockerfile? capital D and all, and do you have it placed into the same folder as you've set for your root directory


zerkia
TRIALOP

a year ago

it's in the backend folder but with a small d


zerkia
TRIALOP

a year ago

I can change it to capital and try again


brody
EMPLOYEE

a year ago

capital D is needed


zerkia
TRIALOP

a year ago

Alright, will try that, one moment


zerkia
TRIALOP

a year ago

It seems to detect my dockerfile now, however, I don't see the nixpacks stuff now, with the setup, install and start commands. Is that something I should be worried about ?


brody
EMPLOYEE

a year ago

no, Dockerfile and nixpacks are different, you only use one or the other


zerkia
TRIALOP

a year ago

Alright.

It seems now this happens in the build

Collecting psycopg2==2.9.9
  Downloading psycopg2-2.9.9.tar.gz (384 kB)
    ERROR: Command errored out with exit status 1:
     command: /usr/local/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-omwe95rq/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-omwe95rq/psycopg2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-q5cw91q1
         cwd: /tmp/pip-install-omwe95rq/psycopg2/
    Complete output (23 lines):
    running egg_info
    creating /tmp/pip-pip-egg-info-q5cw91q1/psycopg2.egg-info
    writing /tmp/pip-pip-egg-info-q5cw91q1/psycopg2.egg-info/PKG-INFO
    writing dependency_links to /tmp/pip-pip-egg-info-q5cw91q1/psycopg2.egg-info/dependency_links.txt
    writing top-level names to /tmp/pip-pip-egg-info-q5cw91q1/psycopg2.egg-info/top_level.txt
    writing manifest file '/tmp/pip-pip-egg-info-q5cw91q1/psycopg2.egg-info/SOURCES.txt'

    Error: pg_config executable not found.

    pg_config is required to build psycopg2 from source.  Please add the directory
    containing pg_config to the $PATH or specify the full executable path with the
    option:

        python setup.py build_ext --pg-config /path/to/pg_config build ...

    or with the pg_config option in 'setup.cfg'.

    If you prefer to avoid building psycopg2 from source, please install the PyPI
    'psycopg2-binary' package instead.

    For further information please check the 'doc/src/install.rst' file (also at
    ;).

    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
WARNING: You are using pip version 20.1.1; however, version 24.3.1 is available.
You should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command.
✕ [5/6] RUN pip install --no-cache-dir -r requirements.txt 
process "/bin/sh -c pip install --no-cache-dir -r requirements.txt" did not complete successfully: exit code: 1

Dockerfile:22
-------------------
20 |
21 |     # Install Python dependencies
22 | &gt;&gt;&gt; RUN pip install --no-cache-dir -r requirements.txt
23 |
24 |     # Verify libmagic is installed correctly
-------------------
ERROR: failed to solve: process "/bin/sh -c pip install --no-cache-dir -r requirements.txt" did not complete successfully: exit code: 1

I imagine it's still related to libmagic despite it failing on psycopg2's installation, but I am not really sure, as neither were installed by me


zerkia
TRIALOP

a year ago

By installed I mean added to the requirements.txt file


brody
EMPLOYEE

a year ago

can you replace it with the binary version as it suggests?


zerkia
TRIALOP

a year ago

right, will try


zerkia
TRIALOP

a year ago

tried commenting out the psycopg2 installation and using the psycopg2-binary installation that was also in the requirements.txt, which leads to the build succeeding again, but the deploy giving that same error about failing to locate libmagic and being asked to check for installation


zerkia
TRIALOP

a year ago

Doesn't seem to be found while building either from the dockerfile checking the installation

[6/6] RUN python -c "import magic; print(magic.Magic)"



[6/6] RUN python -c "import magic; print(magic.Magic)"  ✔ 2s

brody
EMPLOYEE

a year ago

not sure why you are mentioning libmagic, your latest error is something about jwt, when looking at logs please carefully read them


zerkia
TRIALOP

a year ago

Ah so it is, I was looking at an earlier deploy somehow, sorry about that


zerkia
TRIALOP

a year ago

It seems to be running now, but is there a console or similar I can use to test it ?

1330609574394466600


brody
EMPLOYEE

a year ago

no console, isnt this a web app?


zerkia
TRIALOP

a year ago

It is, but the frontend is not yet deployed


zerkia
TRIALOP

a year ago

that was what I wanted to do after I got the backend up and running


brody
EMPLOYEE

a year ago


zerkia
TRIALOP

a year ago

oh


zerkia
TRIALOP

a year ago

Yeah that works for me


zerkia
TRIALOP

a year ago

Didn't know that was the url either honestly


zerkia
TRIALOP

a year ago

Well I appreciate all the help greatly, it's taken a load off the mental for the exam coming soon <:amyzH:898576092384866345> I have some CORS to work through before the url is allowed for my application but that should hopefully not be too hard to manage on my own


brody
EMPLOYEE

a year ago

sounds good, am i good to mark as solved?


zerkia
TRIALOP

a year ago

Yes you are 🙂


brody
EMPLOYEE

a year ago

!s


Status changed to Solved brody about 1 year ago


Loading...