Laravel SQLite config

Hi,

I’ve followed the docs here: Laravel and SQlite · Fly Docs on setting up laravel and SQLite. Whenever the job to run the scheduler starts, it says it cannot find the cache table. Strangely, the app was working fine for months, and after making some changes to the actual job, it is now showing all these errors.

The command works fine locally.

Here is my fly.toml file

app = ‘pr-bot-hidden-fire-3082’
primary_region = ‘lhr’
console_command = ‘php /var/www/html/artisan tinker’

[build]
[build.args]
NODE_VERSION = ‘18’
PHP_VERSION = ‘8.3’

[env]
APP_ENV = ‘production’
LOG_CHANNEL = ‘stderr’
LOG_LEVEL = ‘info’
LOG_STDERR_FORMATTER = ‘Monolog\Formatter\JsonFormatter’
SESSION_DRIVER = ‘cookie’
SESSION_SECURE_COOKIE = ‘true’
DB_CONNECTION=“sqlite”
DB_DATABASE=“/var/www/html/storage/database/database.sqlite”

[processes]
app = ‘’
scheduler = ‘php artisan schedule:work’
worker = ‘php artisan queue:work’

[http_service]
internal_port = 8080
force_https = true
auto_stop_machines = true
auto_start_machines = true
min_machines_running = 0
processes = [‘app’]

[[vm]]
memory = ‘1gb’
cpu_kind = ‘shared’
cpus = 1

[mounts]
source=“storage_vol”
destination=“/var/www/html/storage”

And error:
2024-07-10T11:06:00.394 app[2874deea526098] lhr [info] In Connection.php line 813:

2024-07-10T11:06:00.394 app[2874deea526098] lhr [info] SQLSTATE[HY000]: General error: 1 no such table: cache (Connection: sqlite,

2024-07-10T11:06:00.394 app[2874deea526098] lhr [info] SQL: delete from “cache” where “key” = laravel_cache_illuminate:schedule:i

2024-07-10T11:06:00.394 app[2874deea526098] lhr [info] nterrupt)

2024-07-10T11:06:00.394 app[2874deea526098] lhr [info] In Connection.php line 592:

2024-07-10T11:06:00.394 app[2874deea526098] lhr [info] SQLSTATE[HY000]: General error: 1 no such table: cache

2024-07-10T11:06:00.394 app[2874deea526098] lhr [info] {“message”:“SQLSTATE[HY000]: General error: 1 no such table: cache (Connection: sqlite, SQL: delete from "cache" where "key" = laravel_cache_illuminate:schedule:interrupt)”,“context”:{“exception”:{“class”:“Illuminate\Database\QueryException”,“message”:“SQLSTATE[HY000]: General error: 1 no such table: cache (Connection: sqlite, SQL: delete from "cache" where "key" = laravel_cache_illuminate:schedule:interrupt)”,“code”:0,“file”:“/var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:813”,“previous”:{“class”:“PDOException”,“message”:“SQLSTATE[HY000]: General error: 1 no such table: cache”,“code”:0,“file”:“/var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:592”}}},“level”:400,“level_name”:“ERROR”,“channel”:“production”,“datetime”:“2024-07-10T11:06:00.320631+00:00”,“extra”:{}}

I re-created a new app and for some reason this just worked this time. Not sure what I have done honestly, but this can be closed.

1 Like

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