shopify app using remix. database sqlite. but when restart app, database reset

I am using fly io for my shopify apps, I used remix and sqlite. but when restart the app I see database reset. How can i fix this problem?

Added sqlite

From General to Questions / Help

In your schema.prisma file, what do you have for datasource db?

Do you have a [mounts] section in your fly.toml?

datasource db {
provider = “sqlite”
url = “file:dev.sqlite”
I have also but there is no [mounts]section

You are going to want something like the following in your schema.prisma:

datasource db {
  provider = "sqlite"
  url      = "file://data/dev.sqlite"

And then in your fly.toml:


After you make these changes, rerun fly deploy.

You can find more information here: Fly Volumes overview · Fly Docs

after run fly deploy
Error: Process group ‘app’ needs volumes with name ‘data’ to fullfill mounts defined in fly.toml; Run fly volume create data -r REGION -n COUNT for the following regions and counts: lax=2

then when run ─ fly volume create data -r REGION -n COUNT

fly volumes create [flags]

-a, --app string Application name
-c, --config string Path to application configuration file
-n, --count int The number of volumes to create (default 1)
-h, --help help for create
–host-dedication-id string The dedication id of the reserved hosts for your organization
(if any)
-j, --json JSON output
–no-encryption Do not encrypt the volume contents. Volume contents are
encrypted by default.
-r, --region string The target region (see ‘flyctl platform regions’)
–require-unique-zone Place the volume in a separate hardware zone from existing
volumes. This is the default. (default true)
-s, --size int The size of volume in gigabytes (default 1)
–snapshot-id string Create the volume from the specified snapshot
–snapshot-retention int Snapshot retention in days (min 5) (default 5)
–vm-cpu-kind string The kind of CPU to use (‘shared’ or ‘performance’)
–vm-cpus int Number of CPUs
–vm-gpu-kind string If set, the GPU model to attach (a100-pcie-40gb,
a100-sxm4-80gb, l40s, a10)
–vm-gpus int Number of GPUs. Must also choose the GPU model with
–vm-gpu-kind flag
–vm-memory string Memory (in megabytes) to attribute to the VM
–vm-size string The VM size to set machines to. See “fly platform vm-sizes”
for valid values
-y, --yes Accept all confirmations

Global Flags:
-t, --access-token string Fly API Access Token
–debug Print additional logs and traces
–verbose Verbose output

Error: invalid argument “COUNT” for “-n, --count” flag: strconv.ParseInt: parsing “COUNT”: invalid syntax

WARN Failed to start remote builder heartbeat: failed building options: failed probing “appaza”: context deadline exceeded

Error: failed to fetch an image or build from source: error connecting to docker: failed building options: failed probing “appaza”: context deadline exceeded

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