a year ago
I have a Flask app that I run which uses MYSQL and QDRANT, and it makes LLM calls. Today, I made some changes to the prompts and tried to deploy. However, I encountered an issue where it kept telling me that it could not find the requirements.txt file, even though it was in the correct directory. I attempted to deploy to a staging environment and another project, but encountered the same results. I then switched to using nixpacks and that issue was taken care of, but I then encountered a problem with finding gunicorn. I switched to using waitress, but then it couldn't find JWT. I commented out my import and my function for checking a JWT token since I'm not using it, and then it couldn't find requests! I've double-checked requirements.txt and specified versions and even tried without versions, but to no avail. It seems that the installer is not finding basic packages. Any assistance or advice would be greatly appreciated. It seems pretty strange that it is unable to locate "requests". I unfortunately cannot do a "railway log" because I run into TLS issues on any of the machines in my house (all Windows machines), and I've tried several times over the course of the last few months to resolve that, but cannot. (I'm limited to what GPT or Perplexity can tell me).
36 Replies
a year ago
hi. yes, although I'll confess that in the troubleshooting I ended up just renaming it to Dockerfile.bak, and this is what suddenly allowed the system to find my requirements.txt file. but here are the contents, the only real change is that i added the waitress-serve since it was still pointed to Gunicorn, which the present setup cannot find. this is still renamed.
# Use an official Python runtime as a parent image FROM python:3.10-slim-buster # Set the working directory in the container WORKDIR /app # Copy only requirements.txt first to leverage Docker cache COPY requirements.txt . # Install any needed packages specified in requirements.txt RUN pip install --no-cache-dir -r requirements.txt # Copy the rest of the application code COPY . . # Make port 80 available to the world outside this container EXPOSE 80 # Run waitress when the container launches CMD ["waitress-serve", "--port=80", "main:app"]
a year ago
Please switch back to gunicorn and remove the .bak from the Dockerfile.
Use this to send me the resulting build logs -
a year ago
ok. on reverting to gunicorn i'm getting the error regarding requirements.txt again. :
Retrieving image manifest python:3.10-slim-buster
Jun 19 19:17:29
Retrieving image python:3.10-slim-buster from registry index.docker.io
Jun 19 19:17:30
Returning cached image manifest
Jun 19 19:17:30
Retrieving image manifest python:3.10-slim-buster
Jun 19 19:17:30
Built cross stage deps: map[]
Jun 19 19:17:30
Retrieving image manifest python:3.10-slim-buster
Jun 19 19:17:30
Returning cached image manifest
Jun 19 19:17:30
Retrieving image manifest python:3.10-slim-buster
Jun 19 19:17:30
Returning cached image manifest
Jun 19 19:17:30
Executing 0 build triggers
Jun 19 19:17:30
Building stage 'python:3.10-slim-buster' [idx: '0', base-idx: '-1']
Jun 19 19:17:30
error building image: error building stage: failed to optimize instructions: failed to get files used from context: failed to get fileinfo for /kaniko/snapshots/0e9148ad-4256-49ea-832f-234f1369652b/requirements.txt: lstat /kaniko/snapshots/0e9148ad-4256-49ea-832f-234f1369652b/requirements.txt: no such file or directory
Jun 19 19:17:30
exit status 1 <<--- These are the logs I see in the dashboard.
But these are the logs i see using your tool --->> message="Retrieving image manifest python:3.10-slim-buster" level="info" time="2024-06-20T00:17:29Z"
message="Retrieving image python:3.10-slim-buster from registry index.docker.io" level="info" time="2024-06-20T00:17:29Z"
message="Returning cached image manifest" level="info" time="2024-06-20T00:17:30Z"
message="Retrieving image manifest python:3.10-slim-buster" level="info" time="2024-06-20T00:17:30Z"
message="Built cross stage deps: map[]" level="info" time="2024-06-20T00:17:30Z"
message="Retrieving image manifest python:3.10-slim-buster" level="info" time="2024-06-20T00:17:30Z"
message="Returning cached image manifest" level="info" time="2024-06-20T00:17:30Z"
message="Retrieving image manifest python:3.10-slim-buster" level="info" time="2024-06-20T00:17:30Z"
message="Returning cached image manifest" level="info" time="2024-06-20T00:17:30Z"
message="Executing 0 build triggers" level="info" time="2024-06-20T00:17:30Z"
message="Building stage 'python:3.10-slim-buster' [idx: '0', base-idx: '-1']" level="info" time="2024-06-20T00:17:30Z"
error building image: error building stage: failed to optimize instructions: failed to get files used from context: failed to get fileinfo for /kaniko/snapshots/0e9148ad-4256-49ea-832f-234f1369652b/requirements.txt: lstat /kaniko/snapshots/0e9148ad-4256-49ea-832f-234f1369652b/requirements.txt: no such file or directory
exit status 1
a year ago
I did? this comes from my download directory from a file called "build_logs_railway_17###3etc.log. : message="Retrieving image manifest python:3.10-slim-buster" level="info" time="2024-06-20T00:17:29Z"
message="Retrieving image python:3.10-slim-buster from registry index.docker.io" level="info" time="2024-06-20T00:17:29Z"
message="Returning cached image manifest" level="info" time="2024-06-20T00:17:30Z"
message="Retrieving image manifest python:3.10-slim-buster" level="info" time="2024-06-20T00:17:30Z"
message="Built cross stage deps: map[]" level="info" time="2024-06-20T00:17:30Z"
message="Retrieving image manifest python:3.10-slim-buster" level="info" time="2024-06-20T00:17:30Z"
message="Returning cached image manifest" level="info" time="2024-06-20T00:17:30Z"
message="Retrieving image manifest python:3.10-slim-buster" level="info" time="2024-06-20T00:17:30Z"
message="Returning cached image manifest" level="info" time="2024-06-20T00:17:30Z"
message="Executing 0 build triggers" level="info" time="2024-06-20T00:17:30Z"
message="Building stage 'python:3.10-slim-buster' [idx: '0', base-idx: '-1']" level="info" time="2024-06-20T00:17:30Z"
error building image: error building stage: failed to optimize instructions: failed to get files used from context: failed to get fileinfo for /kaniko/snapshots/0e9148ad-4256-49ea-832f-234f1369652b/requirements.txt: lstat /kaniko/snapshots/0e9148ad-4256-49ea-832f-234f1369652b/requirements.txt: no such file or directory
exit status 1
a year ago
yes its just /
a year ago
Actual forward slash '/'
a year ago
Ok I'll let u know ASAP
a year ago
it doesn't seem to let me leave it blank. i try to delete the / and hit the "checkmark" but it stays the same.
a year ago
By share repo do you mean the files I can zip the main
Py files.
a year ago
yeah. working on it.
a year ago
ok i've got the repo up. I set it as private, though. can i invite you to collaborate to show it? or i can make public but send you the link privately.
a year ago
ok you should get an invite
a year ago
So are you saying you were able to deploy it with no issues?
a year ago
Well I got an error about pywin32 but that means I got further in the build than you have.
You will need to go through your requirements.txt and remove any windows specific modules and any modules that your code doesn't use, this isn't going to fix the current issue but it needs to be done regardless.
a year ago
ok .. looks like i did a pip freeze in the wrong environment at one point. i'm weeding through dependcies. earlier i had actually started a new service in one of my other projects and ran into the same issues. not sure why it can't even find requirements.txt when i don't use nixpacks but use the dockerfile. i'll get back in the morning and try again once i have the requirements.txt cleaned up more
Attachments
a year ago
ok with cleaned requirements i'm unable to railway up through the cli to any service. i can, however (almost) deploy from my github repository. however, I'm getting : "executable file gunicorn not found in $PATH: No such file or directory: OCI runtime attempted to invoke a command that was not found" ... at the end of the whole thing when it's trying to deploy after it seems to have successfully installed everything. last time this was the beginning of not being able to find gunicorn followed by not being able to find requests but this error is more specific. attached logs .,.. update gunicorn was not in the requirements. retrying. mystified as to why i can deploy from github but not cli. i'll let you know how this goes.
Attachments
a year ago
Do you have gunicorn in your requirements.txt file? from your build logs it was never installed.
a year ago
This time I did see your edit, but I don't get notifications for edits, so another comment is best in that case.
a year ago
Ok. At this point I'm up and running in a new service with a cleaned up requirements.txt I don't know enough about how railway works to understand what might have changed or been corrupted, or why doing a "railway up" through the cli causes me to fail on locaiting requirements.txt. that seems to be true regardless what service or environment. i updated my railway cli , i'm on a windows machine. but i'm glad to be running. i appreciate all your asisstance. if you have any tips regarding the cli let me know.
a year ago
So the repo that I'm now a part of fails to build because it can't find a requirements.txt file but only when done through railway up
Is that correct?
a year ago
yes correct.
a year ago
Turns out this repo is too large for Railway up
please stick to GitHub deployments.
Status changed to Solved railway[bot] • 12 months ago