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 does not start #90

Closed
monatis opened this issue Dec 20, 2019 · 11 comments
Closed

backend does not start #90

monatis opened this issue Dec 20, 2019 · 11 comments

Comments

@monatis
Copy link

monatis commented Dec 20, 2019

docker-compose up -d starts each one of the services, but backend service fails with the following:

docker-compose logs backend

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

I tried to get into the backend's bash to try debugging, but it also fails:

docker-compose exec backend bash

ERROR: No container found for backend_1

@monatis
Copy link
Author

monatis commented Dec 21, 2019

I commented and uncommented commands in docker-compose.dev.command.yml so that backend should be able to run indefinitely, and now could get into that container with docker-compose exec backend bash. The problem is that /app directory is empty in the container. Something prevents it from mounting volumes on the host machine. What might be the reason for that? A permission issue?

@monatis
Copy link
Author

monatis commented Dec 24, 2019

It seems that this error relates to WSL, not to any particular Docker image / container. I resolved it, closing the issue.

@monatis monatis closed this as completed Dec 24, 2019
@daddydrac
Copy link

Problem persists:

Request URL: http://localhost/docs
Request Method: GET
Status Code: 404 Not Found

AND

Request URL: http://localhost/api/v1/login/access-token
Request Method: POST
Status Code: 404 Not Found
Remote Address: [::1]:80

@monatis
Copy link
Author

monatis commented Jan 2, 2020

Hi @joehoeller, in my case it was an issue related to Windows Subsystem for Linux. It seems that WSL doesn't properly handle volumes, so I moved my project to regular Windows and it works now. Please try to make sure that ./backend/app is properly mounted as a volume inside the container.

@daddydrac
Copy link

daddydrac commented Jan 2, 2020 via email

@daddydrac
Copy link

daddydrac commented Jan 3, 2020 via email

@robido
Copy link

robido commented Feb 20, 2020

I struggled with this issue a while... tried to mount files in a seperate drive away from Windows C, tried running Docker in Windows mode, tried all the fixes offered here, none worked.

What worked for me was to do the same as in this issue:
#41

I know the solution says its a cookie cutter issue, but the line endings are still wrong in the source of this repo. Should I do a PR?

@akashvibhute
Copy link

I had the same issue on windows.
Fixed with running find . -type f -exec dos2unix {} \; in git bash under the project root.
https://stackoverflow.com/questions/7068179/convert-line-endings-for-whole-directory-tree-git
This will convert all files to LF.

@tiangolo
Copy link
Member

tiangolo commented Apr 7, 2020

Thanks @monatis for reporting back and closing the issue 👍

Thanks @AkashV10 for the tip. If anyone else is still having problems, please create a new issue (unless you already did 😅 )

@danielbf92
Copy link

Hello, I will need your help, I am having the problem you had from the beginning in api send me this:

ERROR: Error loading ASGI app. Import string ": app" must be in format "<module>: <attribute>".

@danielbf92
Copy link

@tiangolo

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

6 participants