Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

celeryworker.dockerfile exiting with code: 1 #25

Closed
aidancahill opened this issue Feb 19, 2024 · 7 comments
Closed

celeryworker.dockerfile exiting with code: 1 #25

aidancahill opened this issue Feb 19, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@aidancahill
Copy link

aidancahill commented Feb 19, 2024

Docker compose build command exits with code: 1, line 17 - 20 in the celeryworker.dockerfile in the backend directory. Getting this response in the terminal "23.63 Environment production is not defined by project config
23.65 chmod: cannot access '/app/worker-start.sh'$'\r': No such file or directory

failed to solve: process "/bin/sh -c python -m pip install --no-cache-dir --upgrade pip "pipx==$PIPX_VERSION"\r\npipx install "hatch==$HATCH_VERSION"\r\nhatch env prune && hatch env create production\r\nchmod +x /app/worker-start.sh\r\n" did not complete successfully: exit code: 1"

Am I doing something wrong here? I definitely can be making a dumb config mistake. Default configuration to localhost.

@Jibola
Copy link
Collaborator

Jibola commented Feb 26, 2024

Hey @aidancahill, thanks for your patience on this issue.

To start, could you share if you have the file /app/worker-start.sh in your backend directory? In your generated app the pathname should look like this {project_name}/backend/app/worker-start.sh? If not that may be the root issue. It may have been accidentally deleted or removed. Let me know if that helps. If not, we can follow up with this in a formal JIRA ticket.

@aidancahill
Copy link
Author

Hey @Jibola,

Thanks for taking the time,

Yes in the directory {project_name}/backend/app/, I have a worker-start.sh. I was pretty sparse with the amount of context I provided in the original post, happy to provide any additional generated files to replicate the bug.

(The content of worker-start.sh)

#! /usr/bin/env bash
set -e

hatch run python /app/app/celeryworker_pre_start.py
hatch run celery -A app.worker worker -l info -Q main-queue -c 1

@shouari
Copy link

shouari commented Apr 5, 2024

I have the same issue.

@csouflis
Copy link

csouflis commented Apr 9, 2024

I am also getting this issue.

@csouflis
Copy link

csouflis commented Apr 9, 2024

Hey guys I solved the issue by separating out the RUN commands in the celeryworker.dockerfile, like this:

RUN python -m pip install --no-cache-dir --upgrade pip "pipx==$PIPX_VERSION"
RUN pipx install "hatch==$HATCH_VERSION"
RUN hatch env prune && hatch env create production
RUN chmod +x /app/worker-start.sh

@blink1073
Copy link
Member

Thanks @csouflis! I opened https://jira.mongodb.org/browse/PYTHON-4351 to track this bug.

@blink1073 blink1073 added bug Something isn't working and removed waiting-for-author labels Apr 10, 2024
@blink1073
Copy link
Member

I applied the change in #38.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants