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).

../../_images/FlyIO07.png

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

../../_images/FlyIO06.png

c) Wait until the web terminal is ready.

../../_images/FlyIO08.png

d) A command prompt will open.

../../_images/FlyIO09.png

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)

../../_images/FlyIO00.png

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).

../../_images/FlyT01.png

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

../../_images/FlyT01.png

Delete an app

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

../../_images/FlyT03.png

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

../../_images/FlyT04.png

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

../../_images/FlyIO01.png

b) Navigate to the Nightscout code directory copied locally by typing:

cd cgm-remote-monitor

../../_images/FlyIO02.png

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

flyctl launch

../../_images/FlyIO13.png

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.

../../_images/FlyIO14.png

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

../../_images/FlyIO16.png

d) In the terminal type:

flyctl deploy

You app will deploy. It will take time (about 10 minutes).

../../_images/FlyIO17.png

Do not interrupt the process.


When deploy completes you should see your full Nightscout site name.

../../_images/FlyIO18.png

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

flyctl scale count 1

../../_images/FlyIO19.png

Enter y to confirm.

../../_images/FlyIO20.png

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

../../_images/FlyT08.png

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.

../../_images/FlyT09.png