Troubleshoot Fly.io
If you’ve got IT knowledge you can install the flyctl
utility on your computer.
If it’s too complex for you the web terminal is an easy alternative.
Use a web terminal
a) In a new browser tab, sign-in with your fly.io account,then open a web terminal. If you just closed the terminal, you might need to wait some time (20 minutes) before you can open a new session (the message below appears).

b) Click on the image with code (Launch Web CLI
).

c) Wait until the web terminal is ready.

d) A command prompt will open.

Cleanup
After several failed attempts to deploy or migrate, you might need to delete some apps.
Log into Fly.io https://fly.io/app/sign-in (GitHub recommended)

In normal running condition you will see only two apps on your dashboard:
The first one is your Nightscout site and the second one the builder (necessary).
If you used the migration wizard you will see another builder (three apps).

Clicking on your site you will see if it’s healthy and running. This is where you go to open your site.

Delete an app
Select an app from the dashboard. Then click Settings
.
Click Delete app
.

Confirm copying the app name below, then click Yes, delete it
.

You have deleted your app.
If you delete the builder (like in the picture above) you won’t be able to deploy anymore.
Delete your local repository
If you deployed with your own computer (old method).
You can delete the cgm-remote-monitor
folder on your computer and fork it again.
If you run PowerShell in Windows, exit the folder before deleting it, in task manager end the flyctl.exe
task.
If you deployed from the web terminal.
You don’t have a local repository.
Make your migrated app maintainable
If you migrated Nightscout from Heroku using Fly.io migration utility you need to fix your deployment to update it.
Open a web terminal.
a) Type (or copy and paste) the following command in the terminal:
curl https://nightscout.github.io/_static/flyboot.sh | bash

b) Navigate to the Nightscout code directory copied locally by typing:
cd cgm-remote-monitor

c) Deploy your site with Fly.io.
Type the following command:
flyctl launch

To the question Would you like to copy its configuration to the new app?
answer Y
(yes).
To the question: App Name (leave blank to use an auto-generated name):
answer with the name of your current Nightscout app.

The app should already exist, confirm you want to launch into it.

d) In the terminal type:
flyctl deploy
You app will deploy. It will take time (about 10 minutes).

Do not interrupt the process.
When deploy completes you should see your full Nightscout site name.

e) Last but not least: make sure to downscale your app with the following command:
flyctl scale count 1

Enter y
to confirm.

f) Exit the terminal typing exit
or pressing Ctrl D
(⌘ D
with a Mac).
Keep in mind you’ll need some time to reopen it if you need to (as explained in step 2 above).
Close the browser tab.
Downscale your app
March 31st 2023, apps deploy in V2 and V1 apps are automatically migrated too.
This causes some issues as V2 automatically deploys in a more than one machine, your Nightscout site might not work correctly.
Type the following command in a web terminal (replace app_name
with your own app name):
flyctl scale --app
app_name
count 1

Your app should now only be running on one machine. Check here.
Note: the builder app is normal, it is stopped: don’t worry about it.
