SamR1 / FitTrackee

Self-hosted outdoor activity tracker :bicyclist:
https://samr1.github.io/FitTrackee
GNU Affero General Public License v3.0
627 stars 37 forks source link

Failed to find Flask application #549

Open lukasheinz92 opened 1 month ago

lukasheinz92 commented 1 month ago

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.
SamR1 commented 1 month ago

Hi,

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

lukasheinz92 commented 1 month ago

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

SamR1 commented 1 month ago

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.

lukasheinz92 commented 1 month ago

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
SamR1 commented 4 weeks ago

Hi,

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

lukasheinz92 commented 3 weeks ago

Hi,

I followed the documentation:

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.

SamR1 commented 3 weeks ago

Hi,

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

lukasheinz92 commented 2 weeks ago

Hi,

I tried this:

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

... but the same issue.

SamR1 commented 2 weeks ago

Hi,

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

lukasheinz92 commented 6 days ago

Hi,

yes, it was the same error.

SamR1 commented 5 days ago

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.