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

Backend not starting #41

Closed
olegasdo opened this issue Jun 16, 2019 · 11 comments
Closed

Backend not starting #41

olegasdo opened this issue Jun 16, 2019 · 11 comments

Comments

@olegasdo
Copy link

Hello
I've tried running project locally on Windows server (using cookiecutter), but backend is not starting.
docker logs shows:
Checking for script in /app/prestart.sh
Running script /app/prestart.sh
: not foundad.sh: 2: /app/prestart.sh:

@olegasdo
Copy link
Author

Sorry, was using docker logs
"docker-compose logs backend" shows all the texts :)
Attaching to test_project_backend_1
backend_1 | Checking for script in /app/prestart.sh
backend_1 | Running script /app/prestart.sh
: not found | /start-reload.sh: 2: /app/prestart.sh:

@olegasdo
Copy link
Author

there was an issue with backend/app/prestart.sh
when executing directly in container it returned error "/usr/bin/env: ‘bash\r’: No such file or directory"
changing line endings in vscode from "CRLF" to "LF" solved the issue. Project files might need update

@mastacheata
Copy link

I think that's an issue on cookiecutter and not on the files in this repository.

@tiangolo
Copy link
Owner

Indeed, it's probably an issue with Cookiecutter on Windows: cookiecutter/cookiecutter#1159

But still, this should be fixed now with #149 🎉

It fixes the line endings of shell scripts right after generation.

@github-actions
Copy link

Assuming the original issue was solved, it will be automatically closed now. But feel free to add more comments or create new issues.

@rohitkumar93
Copy link

I changed my prestart.sh to "LF" using VScode too, and checked it as well.
But I am getting the same error:
`Checking for script in /app/prestart.sh

Running script /app/prestart.sh

/start-reload.sh: 22: .: Can't open /app/prestart.sh`

@pranjalsrv
Copy link

This is in the output of command docker-compose logs:

backend_1  | There is no script /app/prestart.sh
backend_1  | INFO:     Uvicorn running on http://0.0.0.0:80 (Press CTRL+C to quit)
backend_1  | INFO:     Started reloader process [1] using statreload
backend_1  | ERROR:    Error loading ASGI app. Import string ":app" must be in format "<module>:<attribute>".

This issue still persists on running on Windows.
I tried changing the line endings using both VSCode and then manually by using the command: find . -type f -exec dos2unix {} \;, but the issue still exists.

@danielbf92
Copy link

@pranjalsrv did you manage to solve the problem? Right now it sends me that error.

Checking for script in /app/prestart.sh
There is no script /app/prestart.sh
INFO:     Uvicorn running on http://0.0.0.0:80 (Press CTRL+C to quit)
INFO:     Started reloader process [1] using statreload
ERROR:    Error loading ASGI app. Import string ":app" must be in format "<module>:<attribute>".

@OddBlueDog
Copy link

Have the same issue on macOS I have put the line endings as LF. Any ideas?

@alemengana
Copy link

there was an issue with backend/app/prestart.sh
when executing directly in container it returned error "/usr/bin/env: ‘bash\r’: No such file or directory"
changing line endings in vscode from "CRLF" to "LF" solved the issue. Project files might need update

Thanks my friend !!!!!!

@badr-elmazaz
Copy link

I changed the end of line sequence from CRLF to LF end it worked. I used visual studio code to change this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants