You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So I though I'd give that a try. I ran fly launch --from https://github.com/fly-apps/hello-fastapi --into fastapi-app. It failed with this error output:
Created app 'fastapi-app-crimson-feather-2138' in organization 'personal'
Admin URL: https://fly.io/apps/fastapi-app-crimson-feather-2138
Hostname: fastapi-app-crimson-feather-2138.fly.dev
Run `fly tokens create deploy -x 999999h` to create a token and set it as the FLY_API_TOKEN secret in your GitHub repository settings
See https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions
Wrote config file fly.toml
Validating /Users/kellen.mace/Downloads/fastapi-app/fly.toml
✓ Configuration is valid
==> Building image
==> Building image with Depot
--> build: ()
[+] Building 6.4s (13/15)
=> [internal] load build definition from Dockerfile 0.2s
=> => transferring dockerfile: 380B 0.2s
=> [internal] load metadata for docker.io/library/python:3.10-slim 0.3s
=> [internal] load metadata for docker.io/library/python:3.10 0.3s
=> [internal] load .dockerignore 0.1s
=> => transferring context: 82B 0.1s
=> [internal] load build context 0.3s
=> => transferring context: 105.53kB 0.3s
=> [stage-1 1/4] FROM docker.io/library/python:3.10-slim@sha256:f680fc3f447366d9be2ae53dc7a6 0.0s
=> => resolve docker.io/library/python:3.10-slim@sha256:f680fc3f447366d9be2ae53dc7a6447fe9b3 0.0s
=> [builder 1/6] FROM docker.io/library/python:3.10@sha256:e70cd7b54564482c0dee8cd6d8e314450 0.0s
=> => resolve docker.io/library/python:3.10@sha256:e70cd7b54564482c0dee8cd6d8e314450aac59ea0 0.0s
=> CACHED [stage-1 2/4] WORKDIR /app 0.0s
=> CACHED [builder 2/6] WORKDIR /app 0.0s
=> CACHED [builder 3/6] RUN pip install poetry 0.0s
=> CACHED [builder 4/6] RUN poetry config virtualenvs.in-project true 0.0s
=> CACHED [builder 5/6] COPY pyproject.toml poetry.lock ./ 0.0s
=> ERROR [builder 6/6] RUN poetry install 5.4s
------
> [builder 6/6] RUN poetry install:
2.412 Creating virtualenv fastapi-app in /app/.venv
3.074 Installing dependencies from lock file
3.396
3.396 Package operations: 36 installs, 0 updates, 0 removals
3.396
3.397 - Installing mdurl (0.1.2)
3.451 - Installing exceptiongroup (1.2.1)
3.451 - Installing idna (3.7)
3.454 - Installing markdown-it-py (3.0.0)
3.455 - Installing pygments (2.18.0)
3.458 - Installing sniffio (1.3.1)
3.460 - Installing typing-extensions (4.12.2)
3.732 - Installing anyio (4.4.0)
3.732 - Installing certifi (2024.6.2)
3.733 - Installing click (8.1.7)
3.735 - Installing h11 (0.14.0)
3.737 - Installing rich (13.7.1)
3.738 - Installing shellingham (1.5.4)
3.914 - Installing annotated-types (0.7.0)
3.915 - Installing dnspython (2.6.1)
3.915 - Installing httpcore (1.0.5)
3.916 - Installing httptools (0.6.1)
3.917 - Installing markupsafe (2.1.5)
3.920 - Installing pydantic-core (2.18.4)
3.921 - Installing python-dotenv (1.0.1)
3.921 - Installing pyyaml (6.0.1)
3.922 - Installing typer (0.12.3)
3.926 - Installing uvloop (0.19.0)
3.927 - Installing watchfiles (0.22.0)
3.931 - Installing websockets (12.0)
4.657 - Installing email-validator (2.1.1)
4.657 - Installing fastapi-cli (0.0.4)
4.658 - Installing httpx (0.27.0)
4.661 - Installing jinja2 (3.1.4)
4.662 - Installing orjson (3.10.4)
4.663 - Installing pydantic (2.7.3)
4.664 - Installing python-multipart (0.0.9)
4.665 - Installing starlette (0.37.2)
4.667 - Installing ujson (5.10.0)
4.668 - Installing uvicorn (0.30.1)
4.958 - Installing fastapi (0.111.0)
4.998
4.998 Installing the current project: fastapi-app (0.1.0)
5.000
5.000 Error: The current project could not be installed: Readme path `/app/README.md` does not exist.
5.000 If you do not want to install the current project use --no-root.
5.000 If you want to use Poetry only for dependency management but not for packaging, you can disable package mode by setting package-mode = false in your pyproject.toml file.
5.000 If you did intend to install the current project, you may need to set `packages` in your pyproject.toml file.
5.000
------
==> Building image
==> Building image with Depot
--> build: ()
[+] Building 5.4s (13/15)
=> [internal] load build definition from Dockerfile 0.1s
=> => transferring dockerfile: 380B 0.1s
=> [internal] load metadata for docker.io/library/python:3.10-slim 0.1s
=> [internal] load metadata for docker.io/library/python:3.10 0.2s
=> [internal] load .dockerignore 0.1s
=> => transferring context: 82B 0.1s
=> [builder 1/6] FROM docker.io/library/python:3.10@sha256:e70cd7b54564482c0dee8cd6d8e314450 0.0s
=> => resolve docker.io/library/python:3.10@sha256:e70cd7b54564482c0dee8cd6d8e314450aac59ea0 0.0s
=> [internal] load build context 0.1s
=> => transferring context: 328B 0.1s
=> [stage-1 1/4] FROM docker.io/library/python:3.10-slim@sha256:f680fc3f447366d9be2ae53dc7a6 0.0s
=> => resolve docker.io/library/python:3.10-slim@sha256:f680fc3f447366d9be2ae53dc7a6447fe9b3 0.0s
=> CACHED [stage-1 2/4] WORKDIR /app 0.0s
=> CACHED [builder 2/6] WORKDIR /app 0.0s
=> CACHED [builder 3/6] RUN pip install poetry 0.0s
=> CACHED [builder 4/6] RUN poetry config virtualenvs.in-project true 0.0s
=> CACHED [builder 5/6] COPY pyproject.toml poetry.lock ./ 0.0s
=> ERROR [builder 6/6] RUN poetry install 4.8s
------
> [builder 6/6] RUN poetry install:
1.913 Creating virtualenv fastapi-app in /app/.venv
2.451 Installing dependencies from lock file
2.739
2.739 Package operations: 36 installs, 0 updates, 0 removals
2.739
2.740 - Installing mdurl (0.1.2)
2.790 - Installing exceptiongroup (1.2.1)
2.790 - Installing idna (3.7)
2.793 - Installing markdown-it-py (3.0.0)
2.795 - Installing pygments (2.18.0)
2.798 - Installing sniffio (1.3.1)
2.802 - Installing typing-extensions (4.12.2)
3.075 - Installing anyio (4.4.0)
3.076 - Installing certifi (2024.6.2)
3.078 - Installing click (8.1.7)
3.079 - Installing h11 (0.14.0)
3.080 - Installing rich (13.7.1)
3.082 - Installing shellingham (1.5.4)
3.252 - Installing annotated-types (0.7.0)
3.252 - Installing dnspython (2.6.1)
3.253 - Installing httpcore (1.0.5)
3.255 - Installing httptools (0.6.1)
3.256 - Installing markupsafe (2.1.5)
3.257 - Installing pydantic-core (2.18.4)
3.259 - Installing python-dotenv (1.0.1)
3.264 - Installing pyyaml (6.0.1)
3.268 - Installing typer (0.12.3)
3.270 - Installing uvloop (0.19.0)
3.270 - Installing watchfiles (0.22.0)
3.275 - Installing websockets (12.0)
4.010 - Installing email-validator (2.1.1)
4.010 - Installing fastapi-cli (0.0.4)
4.011 - Installing httpx (0.27.0)
4.012 - Installing jinja2 (3.1.4)
4.014 - Installing orjson (3.10.4)
4.016 - Installing pydantic (2.7.3)
4.018 - Installing python-multipart (0.0.9)
4.020 - Installing starlette (0.37.2)
4.021 - Installing ujson (5.10.0)
4.024 - Installing uvicorn (0.30.1)
4.312 - Installing fastapi (0.111.0)
4.344
4.344 Installing the current project: fastapi-app (0.1.0)
4.345
4.345 Error: The current project could not be installed: Readme path `/app/README.md` does not exist.
4.345 If you do not want to install the current project use --no-root.
4.345 If you want to use Poetry only for dependency management but not for packaging, you can disable package mode by setting package-mode = false in your pyproject.toml file.
4.345 If you did intend to install the current project, you may need to set `packages` in your pyproject.toml file.
4.345
------
Error: failed to fetch an image or build from source: error building: failed to solve: process "/bin/sh -c poetry install" did not complete successfully: exit code: 1
Summary
So since both the Speedrun instructions and repo readme instructions failed, I guess I have to to a bunch of manual debugging and try to figure out why "Readme path /app/README.md does not exist" and fix that issue.
Maybe running the launch command with --no-deploy first, then updating the COPY pyproject.toml poetry.lock ./ line in the Dockerfile to COPY pyproject.toml poetry.lock README.md ./ so that the readme file gets copied over, then finally deploying the app is the solution? Not sure what solution you'd recommend.
I feel like it shouldn't be this hard to get a simple "hello world" FastAPI server set up on Fly. The Speedrun instructions should "just work" and so should the fly launch 1-liner in the readme. Can you please fix those, or provide additional instructions to devs know what do to differently to get them to work on the first try? Thanks.
The text was updated successfully, but these errors were encountered:
Instructions in the "Run a FastAPI app" speedrun differ from those in the repo's readme and neither of them work. Details are below.
Title: Run a FastAPI app
Location: https://fly.io/docs/python/frameworks/fastapi/
Source: https://github.com/superfly/docs/blob/main/python/frameworks/fastapi.html.markerb
Attempt #1 using Speedrun instructions
The Speedrun instructions for setting up a basic FastAPI server instruct the reader to run these commands:
When I ran
fly launch --generate-name
, it errored out with this output:Attempt #2 using readme instructions
I then noticed that the readme for the repo shows this command (albeit with no context whatsoever):
So I though I'd give that a try. I ran
fly launch --from https://github.com/fly-apps/hello-fastapi --into fastapi-app
. It failed with this error output:Summary
So since both the Speedrun instructions and repo readme instructions failed, I guess I have to to a bunch of manual debugging and try to figure out why "Readme path
/app/README.md
does not exist" and fix that issue.Maybe running the launch command with
--no-deploy
first, then updating theCOPY pyproject.toml poetry.lock ./
line in theDockerfile
toCOPY pyproject.toml poetry.lock README.md ./
so that the readme file gets copied over, then finally deploying the app is the solution? Not sure what solution you'd recommend.I feel like it shouldn't be this hard to get a simple "hello world" FastAPI server set up on Fly. The Speedrun instructions should "just work" and so should the
fly launch
1-liner in the readme. Can you please fix those, or provide additional instructions to devs know what do to differently to get them to work on the first try? Thanks.The text was updated successfully, but these errors were encountered: