fly deploy finishes but app not available at the given URL

I have a Node.js app that I want to deploy on fly.io.

Firstly I use fly launch followed by fly deploy.

I get the message watch your deployment at <URL> but get a 404 error at that URL.

Also the builder finishes with the message Visit your newly deployed app at <URL> but there is no app. When I go to my fly.io homepage the dashboard says You don't have any apps yet.

Where can I find further info on where this falls over?

That’s strange … :thinking:

I guess the most likely explanation would be the build is failing and so the app is not deployed, hence the 404.

You should be able to see some kind of log by running flyctl logs. If the app wasn’t even deployed, it may not recognise that command (since there will be no app name/fly.toml file to look up). In which case … try deploying again and this time watch the output in real-time as it scrolls. See if it complains about anything during the build/deploy e.g a “file not found”, "context deadline exceeded’, or some kind of error.

Thanks for responding.

Below is the output from flyctl logs. Looks like there are two errors (no config space access function defined and Error getting access token). No idea what these mean.

I’d like to add that this code was built and deployed about 6 months ago and could be accessed. I’m coming back to it now.

The only difference between then and now is I added a hobby account subscription as the free subscription seems gone.

Output from flyctl logs

C:\Users\tfmei\Documents\Projects\xero-invoice-app>flyctl logs
2024-03-04T00:09:54Z runner[781112eb990378] syd [info]Pulling container image registry.fly.io/xero-invoice-app-morning:deployment-01HR3CP7NA2G7TA0ESWA5CCDCW
2024-03-04T00:10:00Z runner[781112eb990378] syd [info]Successfully prepared image registry.fly.io/xero-invoice-app-morning:deployment-01HR3CP7NA2G7TA0ESWA5CCDCW (6.347425916s)
2024-03-04T00:10:01Z runner[781112eb990378] syd [info]Configuring firecracker
2024-03-04T00:10:01Z app[781112eb990378] syd [info][    0.047578] PCI: Fatal: No config space access function found
2024-03-04T00:10:01Z app[781112eb990378] syd [info] INFO Starting init (commit: 913ad9c)...
2024-03-04T00:10:01Z app[781112eb990378] syd [info] INFO Preparing to run: `docker-entrypoint.sh node index.js` as root
2024-03-04T00:10:01Z app[781112eb990378] syd [info] INFO [fly api proxy] listening at /.fly/api
2024-03-04T00:10:01Z runner[781112eb990378] syd [info]Machine created and started in 7.665s
2024-03-04T00:10:01Z app[781112eb990378] syd [info]2024/03/04 00:10:01 listening on [fdaa:2:f5a2:a7b:f1:62b2:a0a4:2]:22 (DNS: [fdaa::3]:53)
2024-03-04T00:10:03Z app[781112eb990378] syd [info]Error getting access token: ReferenceError: req is not defined
2024-03-04T00:10:03Z app[781112eb990378] syd [info]    at getAccessToken (/app/index.js:118:23)
2024-03-04T00:10:03Z app[781112eb990378] syd [info]    at Object.<anonymous> (/app/index.js:145:1)
2024-03-04T00:10:03Z app[781112eb990378] syd [info]    at Module._compile (node:internal/modules/cjs/loader:1256:14)
2024-03-04T00:10:03Z app[781112eb990378] syd [info]    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
2024-03-04T00:10:03Z app[781112eb990378] syd [info]    at Module.load (node:internal/modules/cjs/loader:1119:32)
2024-03-04T00:10:03Z app[781112eb990378] syd [info]    at Module._load (node:internal/modules/cjs/loader:960:12)
2024-03-04T00:10:03Z app[781112eb990378] syd [info]    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
2024-03-04T00:10:03Z app[781112eb990378] syd [info]    at node:internal/main/run_main_module:23:47
2024-03-04T00:10:03Z app[781112eb990378] syd [info]Server is running on port 3000
2024-03-04T00:10:06Z runner[d891157a666048] syd [info]Pulling container image registry.fly.io/xero-invoice-app-morning:deployment-01HR3CP7NA2G7TA0ESWA5CCDCW
2024-03-04T00:10:11Z runner[d891157a666048] syd [info]Successfully prepared image registry.fly.io/xero-invoice-app-morning:deployment-01HR3CP7NA2G7TA0ESWA5CCDCW (5.155619088s)
2024-03-04T00:10:12Z runner[d891157a666048] syd [info]Configuring firecracker
2024-03-04T00:10:13Z app[d891157a666048] syd [info][    0.045614] PCI: Fatal: No config space access function found
2024-03-04T00:10:13Z app[d891157a666048] syd [info] INFO Starting init (commit: 913ad9c)...
2024-03-04T00:10:13Z app[d891157a666048] syd [info] WARN Unable to open /dev/ptp0 to sync time: an unhandled IO error occurred: No such file or directory (os error 2)
2024-03-04T00:10:13Z app[d891157a666048] syd [info] INFO Preparing to run: `docker-entrypoint.sh node index.js` as root
2024-03-04T00:10:13Z app[d891157a666048] syd [info] INFO [fly api proxy] listening at /.fly/api
2024-03-04T00:10:13Z app[d891157a666048] syd [info]2024/03/04 00:10:13 listening on [fdaa:2:f5a2:a7b:f5:5310:9b56:2]:22 (DNS: [fdaa::3]:53)
2024-03-04T00:10:13Z runner[d891157a666048] syd [info]Machine created and started in 7.045s
2024-03-04T00:10:14Z app[d891157a666048] syd [info]Error getting access token: ReferenceError: req is not defined
2024-03-04T00:10:14Z app[d891157a666048] syd [info]    at getAccessToken (/app/index.js:118:23)
2024-03-04T00:10:14Z app[d891157a666048] syd [info]    at Object.<anonymous> (/app/index.js:145:1)
2024-03-04T00:10:14Z app[d891157a666048] syd [info]    at Module._compile (node:internal/modules/cjs/loader:1256:14)
2024-03-04T00:10:14Z app[d891157a666048] syd [info]    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
2024-03-04T00:10:14Z app[d891157a666048] syd [info]    at Module.load (node:internal/modules/cjs/loader:1119:32)
2024-03-04T00:10:14Z app[d891157a666048] syd [info]    at Module._load (node:internal/modules/cjs/loader:960:12)
2024-03-04T00:10:14Z app[d891157a666048] syd [info]    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
2024-03-04T00:10:14Z app[d891157a666048] syd [info]    at node:internal/main/run_main_module:23:47
2024-03-04T00:10:14Z app[d891157a666048] syd [info]Server is running on port 3000

No errors as far as I can tell from fly launch and fly deploy.

Output from fly launch

C:\Users\tfmei\Documents\Projects\xero-invoice-app>fly launch
An existing fly.toml file was found for app xero-invoice-app-morning-dream-9284-dark-pine-468
? Would you like to copy its configuration to the new app? Yes
Scanning source code
got port
Detected a NodeJS app
Creating app in C:\Users\tfmei\Documents\Projects\xero-invoice-app
We're about to launch your NodeJS app on Fly.io. Here's what you're getting:

Organization: <organisation>                                                     (fly launch defaults to the personal org)
Name:         xero-invoice-app-morning-dream-9284-dark-pine-468-aged-hill-4986 (from your fly.toml)
Region:       Sydney, Australia                                                (from your fly.toml)
App Machines: shared-cpu-1x, 1GB RAM                                           (from your fly.toml)
Postgres:     <none>                                                           (not requested)
Redis:        <none>                                                           (not requested)

? Do you want to tweak these settings before proceeding? Yes
Opening https://fly.io/cli/launch/fd159f661f5a7350aa516fca956a7dc0 ...

Waiting for launch data... Done
Created app 'xero-invoice-app-morning' in organization 'personal'
Admin URL: https://fly.io/apps/xero-invoice-app-morning
Hostname: xero-invoice-app-morning.fly.dev
Wrote config file fly.toml
Validating C:\Users\tfmei\Documents\Projects\xero-invoice-app\fly.toml
âś“ Configuration is valid

If you need custom packages installed, or have problems with your deployment
build, you may need to edit the Dockerfile for app-specific changes. If you
need help, please post on https://community.fly.io.

Now: run 'fly deploy' to deploy your Node.js app.


C:\Users\tfmei\Documents\Projects\xero-invoice-app>

Output from fly deploy

C:\Users\tfmei\Documents\Projects\xero-invoice-app>fly deploy
==> Verifying app config
Validating C:\Users\tfmei\Documents\Projects\xero-invoice-app\fly.toml
âś“ Configuration is valid
--> Verified app config
==> Building image
Remote builder fly-builder-restless-feather-976 ready
Remote builder fly-builder-restless-feather-976 ready
==> Building image with Docker
--> docker host: 20.10.12 linux x86_64
[+] Building 2.1s (16/16) FINISHED
 => [internal] load build definition from Dockerfile                                                                                                                                                                                    0.0s
 => => transferring dockerfile: 32B                                                                                                                                                                                                     0.0s
 => [internal] load .dockerignore                                                                                                                                                                                                       0.0s
 => => transferring context: 34B                                                                                                                                                                                                        0.0s
 => resolve image config for docker.io/docker/dockerfile:1                                                                                                                                                                              1.3s
 => CACHED docker-image://docker.io/docker/dockerfile:1@sha256:ac85f380a63b13dfcefa89046420e1781752bab202122f8f50032edf31be0021                                                                                                         0.0s
 => [internal] load build definition from Dockerfile                                                                                                                                                                                    0.0s
 => [internal] load metadata for docker.io/library/node:18.17.1-slim                                                                                                                                                                    0.5s
 => [internal] load .dockerignore                                                                                                                                                                                                       0.0s
 => [internal] load build context                                                                                                                                                                                                       0.0s
 => => transferring context: 537B                                                                                                                                                                                                       0.0s
 => [base 1/2] FROM docker.io/library/node:18.17.1-slim@sha256:e5c8c319295f6cbc288e19506a9ac37afa3b330f4e38afb01d1269b579cf6a5b                                                                                                         0.0s
 => CACHED [base 2/2] WORKDIR /app                                                                                                                                                                                                      0.0s
 => CACHED [build 1/4] RUN apt-get update -qq &&     apt-get install -y build-essential pkg-config python-is-python3                                                                                                                    0.0s
 => CACHED [build 2/4] COPY --link package-lock.json package.json ./                                                                                                                                                                    0.0s
 => CACHED [build 3/4] RUN npm ci                                                                                                                                                                                                       0.0s
 => CACHED [build 4/4] COPY --link . .                                                                                                                                                                                                  0.0s
 => CACHED [stage-2 1/1] COPY --from=build /app /app                                                                                                                                                                                    0.0s
 => exporting to image                                                                                                                                                                                                                  0.0s
 => => exporting layers                                                                                                                                                                                                                 0.0s
 => => writing image sha256:aa7d5ee48e2e661fda5e473812aca38a6f5dc261352185c557df70d93f4c8451                                                                                                                                            0.0s
 => => naming to registry.fly.io/xero-invoice-app-morning:deployment-01HR3CP7NA2G7TA0ESWA5CCDCW                                                                                                                                         0.0s
--> Building image done
==> Pushing image to fly
The push refers to repository [registry.fly.io/xero-invoice-app-morning]
596ac3c946f9: Mounted from xero-invoice-app-morning-dream-9284-dark-pine-468
cf6323bbbbe2: Mounted from xero-invoice-app-morning-dream-9284-dark-pine-468
e57eb1f3b589: Mounted from xero-invoice-app-morning-dream-9284-dark-pine-468
a5ad9b920620: Mounted from xero-invoice-app-morning-dream-9284-dark-pine-468
fa1c97f8dfbb: Mounted from xero-invoice-app-morning-dream-9284-dark-pine-468
9a2a56d458ec: Mounted from xero-invoice-app-morning-dream-9284-dark-pine-468
a2d7501dfb35: Mounted from xero-invoice-app-morning-dream-9284-dark-pine-468
deployment-01HR3CP7NA2G7TA0ESWA5CCDCW: digest: sha256:5238b647933b47685ef64809cf2d47567ac1469b0a3e59f4aaf5f39abe7c39c8 size: 1784
--> Pushing image done
image: registry.fly.io/xero-invoice-app-morning:deployment-01HR3CP7NA2G7TA0ESWA5CCDCW
image size: 277 MB

Watch your deployment at https://fly.io/apps/xero-invoice-app-morning/monitoring

Provisioning ips for xero-invoice-app-morning
  Dedicated ipv6: 2a09:8280:1::2c:ba42:0
  Shared ipv4: 66.241.124.114
  Add a dedicated ipv4 with: fly ips allocate-v4

This deployment will:
 * create 2 "app" machines

No machines in group app, launching a new machine
Creating a second machine to increase service availability
Finished launching new machines
-------
NOTE: The machines for [app] have services with 'auto_stop_machines = true' that will be stopped when idling




-------
Checking DNS configuration for xero-invoice-app-morning.fly.dev

Visit your newly deployed app at https://xero-invoice-app-morning.fly.dev/

C:\Users\tfmei\Documents\Projects\xero-invoice-app>

hi @tfmeier

If you had your app on Fly.io 6 months ago, then you should still have a legacy (“free”) Hobby plan and you would not need to sign up for a new plan unless you added a new org.

Is it possible you have more than one Fly.io account with different emails?

What do you see when you run fly apps list?

If you do have more than one account, I suggest logging out of your dashboard and flyctl (fly auth logout then fly auth login) and logging back in with your original account.

If there are issues with authentication or accessing your accounts you can contact billing@fly.io for help.

If you do manage to access an original account, then you can delete your second account (the one with no apps :)).

1 Like

fly apps list shows the project I’m currently working on (Python) and the Node.JS app I posted the log files for above.

All apps are in state suspended.

I have checked on another fly.io account and all apps are there.

I have used the fly commands on windows and my question is how does the local fly command determine which account to use?

On a separate note I noticed the apps name changes every time I rebuild the app. I figure this is for version control. How can I keep the same app name if I want to?

Local fly will use the same account which you have use to login on flyctl while using following command

fly auth login

Once you’ve used fly launch to create your app, you only need to fly deploy after that whenever you make changes. If you run fly launch again in the same directory, it will create a new app each time based on the existing fly.toml file, which is how you might end up with app names like <my-original-app-name-misty-dream-7639>.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.