SamR1/FitTrackee

Failed to find Flask application

Closed this issue · 12 comments

Hello,

when I try to run my containers, I get following error in the fittrackee container:

Usage: flask run [OPTIONS]
Try 'flask run --help' for help.
Error: Failed to find Flask application or factory in module '__main__'. Use '__main__:name' to specify one.

Hi,

what is the value of the environment variable FLASK_APP in the .env file?

Hi, it is FLASK_APP=fittrackee/__main__.py.

Hi,

Thanks for your answer. The value is correct.

Have any changes been made to the configuration?
The container should start up without having to make any changes to the .env file after copying it from .env.docker.

Hi,

No, I haven't changed any configuration in the env file, I only changed the volumes and ports in the docker-compose. Regarding the .env.docker file, I haven't copied it to .env - the docker-compose contains this:

env_file:
  - .env.docker

Hi,

can you try with .env instead (see documentation)?
Some shell scripts source the .env file.

Hi,

I followed the documentation:

  • git clone https://github.com/SamR1/FitTrackee.git
  • cd FitTrackee
  • cp .env.docker .env
  • make docker-build
  • I updated the docker-compose-dev.yml (the volumes and ports)
  • make docker-init

But I got this error: OCI runtime exec failed: exec failed: unable to start container process: exec: "docker/init-database.sh": stat docker/init-database.sh: no such file or directory: unknown make: *** [Makefile:64: docker-init-db] Error 126 but I can see the init-database.sh file in the docker subdirectory. In the logs in fittrackee container I can still see the error: Error: Failed to find Flask application or factory in module '__main__'. Use '__main__:name' to specify one.

I am trying to run it on Raspberry Pi and I also can see the terminal ...platform (linux/amd64) does not match the detected host platform (linux/arm64/v8)... - not sure if this can be a problem.

Hi,

does adding the platform in docker-compose-dev.yml solve the issue?

Hi,

I tried this:

  fittrackee:
    container_name: fittrackee
    platform: "linux/arm64"
    build:
      context: "."
      platforms:
        - "linux/arm64"

... but the same issue.

Hi,

Is it the same error?
Python image should exist for linux/arm64/v8.

Hi,

yes, it was the same error.

Hi,

3.10 tag corresponds to 3.10.14-bookworm . Perhaps another python image may work. Or additional modifications may also be required in the Docker file.

I'm sorry I can't find an immediate solution, and I don't have a Raspberry Pi available with Raspbian to investigate the issue :/.
I'll try to find one.

I was not able to fix the issue.