alexjustesen / speedtest-tracker

Speedtest Tracker is a self-hosted internet performance tracking application that runs speedtest checks against Ookla's Speedtest service.
https://speedtest-tracker.dev/
MIT License
2.62k stars 98 forks source link

0.16 results change break the app #1154

Closed Churator closed 6 months ago

Churator commented 6 months ago

upgraded to 0.16, failed to start the app

🚛 Migrating the database... [2024-02-19 17:23:00] production.ERROR: Tried loading settings 'App\Settings\GeneralSettings', and following properties were missing: prune_results_older_than {"exception":"[object] (Spatie\LaravelSettings\Exceptions\MissingSettings(code: 0): Tried loading settings 'App\Settings\GeneralSettings', and following properties were missing: prune_results_older_than at /var/www/html/vendor/spatie/laravel-settings/src/Exceptions/MissingSettings.php:13) [stacktrace]

0 /var/www/html/vendor/spatie/laravel-settings/src/SettingsMapper.php(118): Spatie\LaravelSettings\Exceptions\MissingSettings::create()

1 /var/www/html/vendor/spatie/laravel-settings/src/SettingsMapper.php(42): Spatie\LaravelSettings\SettingsMapper->ensureNoMissingSettings()

2 /var/www/html/vendor/spatie/laravel-settings/src/Settings.php(266): Spatie\LaravelSettings\SettingsMapper->load()

3 /var/www/html/vendor/spatie/laravel-settings/src/Settings.php(97): Spatie\LaravelSettings\Settings->loadValues()

4 /var/www/html/database/migrations/2024_02_18_100000_results_bad_json_table.php(60): Spatie\LaravelSettings\Settings->__set()

5 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(493): Illuminate\Database\Migrations\Migration@anonymous->up()

6 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(410): Illuminate\Database\Migrations\Migrator->runMethod()

7 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(419): Illuminate\Database\Migrations\Migrator->Illuminate\Database\Migrations\{closure}()

8 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(216): Illuminate\Database\Migrations\Migrator->runMigration()

9 /var/www/html/vendor/laravel/framework/src/Illuminate/Console/View/Components/Task.php(37): Illuminate\Database\Migrations\Migrator->Illuminate\Database\Migrations\{closure}()

10 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(756): Illuminate\Console\View\Components\Task->render()

11 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(216): Illuminate\Database\Migrations\Migrator->write()

12 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(181): Illuminate\Database\Migrations\Migrator->runUp()

13 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(124): Illuminate\Database\Migrations\Migrator->runPending()

14 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php(90): Illuminate\Database\Migrations\Migrator->run()

15 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(633): Illuminate\Database\Console\Migrations\MigrateCommand->Illuminate\Database\Console\Migrations\{closure}()

16 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php(83): Illuminate\Database\Migrations\Migrator->usingConnection()

17 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Illuminate\Database\Console\Migrations\MigrateCommand->handle()

18 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()

19 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure()

20 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(35): Illuminate\Container\BoundMethod::callBoundMethod()

21 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(662): Illuminate\Container\BoundMethod::call()

22 /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Command.php(211): Illuminate\Container\Container->call()

23 /var/www/html/vendor/symfony/console/Command/Command.php(326): Illuminate\Console\Command->execute()

24 /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Command.php(180): Symfony\Component\Console\Command\Command->run()

25 /var/www/html/vendor/symfony/console/Application.php(1096): Illuminate\Console\Command->run()

26 /var/www/html/vendor/symfony/console/Application.php(324): Symfony\Component\Console\Application->doRunCommand()

27 /var/www/html/vendor/symfony/console/Application.php(175): Symfony\Component\Console\Application->doRun()

28 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(201): Symfony\Component\Console\Application->run()

29 /var/www/html/artisan(35): Illuminate\Foundation\Console\Kernel->handle()

30 {main}

"}

In MissingSettings.php line 13:

Tried loading settings 'App\Settings\GeneralSettings', and following proper ties were missing: prune_results_older_than

s6-rc: warning: unable to start service laravel-automations: command exited 1 /run/s6/basedir/scripts/rc.init: warning: s6-rc failed to properly bring all the services up! Check your logs (in /run/uncaught-logs/current if you have in-container logging) for more information. prog: fatal: stopping the container. usermod: no changes

and now after reboot [2024-02-19 17:23:07] production.ERROR: SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'results_bad_json' already exists (Connection: mysql, SQL: rename table results to results_bad_json) {"exception":"[object] (Illuminate\Database\QueryException(code: 42S01): SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'results_bad_json' already exists (Connection: mysql, SQL: rename table results to results_bad_json) at /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:829)

OddSquirrel commented 6 months ago

Same here, no idea why it expects prune_results_older_than, when I cannot set it before this version is installed.

EDIT: Going back to 0.15.5 brings everything right back up for me, no data lost.

spupuz commented 6 months ago

Same problem for me

AleksCee commented 6 months ago

Same

lfac76 commented 6 months ago

Some for me, but I use sqlite and when I went to v0.15.5 I "lost" everything. Looking the database.sqlite the results table is empty but the results_bad_json is ok. When I try to run the latest version this error occour:

I removed the results table and renamed the results_bad_json to results and now the v0.15.5 it's showing the results.

speedtest-tracker  | 🚛  Migrating the database...
speedtest-tracker  | [2024-02-19 18:50:33] production.ERROR: SQLSTATE[HY000]: General error: 1 there is already another table or index with this name: results_bad_json (Connection: sqlite, SQL: alter table "results" rename to "results_bad_json") {"exception":"[object] (Illuminate\\Database\\QueryException(code: HY000): SQLSTATE[HY000]: General error: 1 there is already another table or index with this name: results_bad_json (Connection: sqlite, SQL: alter table \"results\" rename to \"results_bad_json\") at /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:829)
speedtest-tracker  | [stacktrace]
speedtest-tracker  | #0 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php(783): Illuminate\\Database\\Connection->runQueryCallback()
speedtest-tracker  | #1 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php(576): Illuminate\\Database\\Connection->run()
speedtest-tracker  | #2 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Schema/Blueprint.php(110): Illuminate\\Database\\Connection->statement()
speedtest-tracker  | #3 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Schema/Builder.php(602): Illuminate\\Database\\Schema\\Blueprint->build()
speedtest-tracker  | #4 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Schema/Builder.php(548): Illuminate\\Database\\Schema\\Builder->build()
speedtest-tracker  | #5 /var/www/html/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(355): Illuminate\\Database\\Schema\\Builder->rename()
speedtest-tracker  | 
speedtest-tracker  | #6 /var/www/html/database/migrations/2024_02_18_100000_results_bad_json_table.php(24): Illuminate\\Support\\Facades\\Facade::__callStatic()
speedtest-tracker  | #7 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(493): Illuminate\\Database\\Migrations\\Migration@anonymous->up()
speedtest-tracker  | #8 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(410): Illuminate\\Database\\Migrations\\Migrator->runMethod()
speedtest-tracker  | #9 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(419): Illuminate\\Database\\Migrations\\Migrator->Illuminate\\Database\\Migrations\\{closure}()
speedtest-tracker  | #10 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(216): Illuminate\\Database\\Migrations\\Migrator->runMigration()
speedtest-tracker  | #11 /var/www/html/vendor/laravel/framework/src/Illuminate/Console/View/Components/Task.php(37): Illuminate\\Database\\Migrations\\Migrator->Illuminate\\Database\\Migrations\\{closure}()
speedtest-tracker  | #12 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(756): Illuminate\\Console\\View\\Components\\Task->render()
speedtest-tracker  | #13 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(216): Illuminate\\Database\\Migrations\\Migrator->write()
speedtest-tracker  | #14 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(181): Illuminate\\Database\\Migrations\\Migrator->runUp()
speedtest-tracker  | #15 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(124): Illuminate\\Database\\Migrations\\Migrator->runPending()
speedtest-tracker  | #16 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php(90): Illuminate\\Database\\Migrations\\Migrator->run()
speedtest-tracker  | #17 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(633): Illuminate\\Database\\Console\\Migrations\\MigrateCommand->Illuminate\\Database\\Console\\Migrations\\{closure}()
speedtest-tracker  | #18 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php(83): Illuminate\\Database\\Migrations\\Migrator->usingConnection()
speedtest-tracker  | #19 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Illuminate\\Database\\Console\\Migrations\\MigrateCommand->handle()
speedtest-tracker  | #20 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()
speedtest-tracker  | #21 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\\Container\\Util::unwrapIfClosure()
speedtest-tracker  | #22 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(35): Illuminate\\Container\\BoundMethod::callBoundMethod()
speedtest-tracker  | #23 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(662): Illuminate\\Container\\BoundMethod::call()
speedtest-tracker  | #24 /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Command.php(211): Illuminate\\Container\\Container->call()
speedtest-tracker  | #25 /var/www/html/vendor/symfony/console/Command/Command.php(326): Illuminate\\Console\\Command->execute()
speedtest-tracker  | #26 /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Command.php(180): Symfony\\Component\\Console\\Command\\Command->run()
speedtest-tracker  | #27 /var/www/html/vendor/symfony/console/Application.php(1096): Illuminate\\Console\\Command->run()
speedtest-tracker  | #28 /var/www/html/vendor/symfony/console/Application.php(324): Symfony\\Component\\Console\\Application->doRunCommand()
speedtest-tracker  | #29 /var/www/html/vendor/symfony/console/Application.php(175): Symfony\\Component\\Console\\Application->doRun()
speedtest-tracker  | #30 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(201): Symfony\\Component\\Console\\Application->run()
speedtest-tracker  | #31 /var/www/html/artisan(35): Illuminate\\Foundation\\Console\\Kernel->handle()
speedtest-tracker  | #32 {main}
speedtest-tracker  | 
speedtest-tracker  | [previous exception] [object] (PDOException(code: HY000): SQLSTATE[HY000]: General error: 1 there is already another table or index with this name: results_bad_json at /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:581)
speedtest-tracker  | [stacktrace]
speedtest-tracker  | #0 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php(581): PDO->prepare()
speedtest-tracker  | #1 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php(816): Illuminate\\Database\\Connection->Illuminate\\Database\\{closure}()
speedtest-tracker  | #2 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php(783): Illuminate\\Database\\Connection->runQueryCallback()
speedtest-tracker  | #3 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php(576): Illuminate\\Database\\Connection->run()
speedtest-tracker  | #4 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Schema/Blueprint.php(110): Illuminate\\Database\\Connection->statement()
speedtest-tracker  | #5 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Schema/Builder.php(602): Illuminate\\Database\\Schema\\Blueprint->build()
speedtest-tracker  | #6 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Schema/Builder.php(548): Illuminate\\Database\\Schema\\Builder->build()
speedtest-tracker  | #7 /var/www/html/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(355): Illuminate\\Database\\Schema\\Builder->rename()
speedtest-tracker  | #8 /var/www/html/database/migrations/2024_02_18_100000_results_bad_json_table.php(24): Illuminate\\Support\\Facades\\Facade::__callStatic()
speedtest-tracker  | #9 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(493): Illuminate\\Database\\Migrations\\Migration@anonymous->up()
speedtest-tracker  | #10 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(410): Illuminate\\Database\\Migrations\\Migrator->runMethod()
speedtest-tracker  | #11 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(419): Illuminate\\Database\\Migrations\\Migrator->Illuminate\\Database\\Migrations\\{closure}()
speedtest-tracker  | #12 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(216): Illuminate\\Database\\Migrations\\Migrator->runMigration()
speedtest-tracker  | #13 /var/www/html/vendor/laravel/framework/src/Illuminate/Console/View/Components/Task.php(37): Illuminate\\Database\\Migrations\\Migrator->Illuminate\\Database\\Migrations\\{closure}()
speedtest-tracker  | #14 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(756): Illuminate\\Console\\View\\Components\\Task->render()
speedtest-tracker  | #15 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(216): Illuminate\\Database\\Migrations\\Migrator->write()
speedtest-tracker  | #16 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(181): Illuminate\\Database\\Migrations\\Migrator->runUp()
speedtest-tracker  | #17 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(124): Illuminate\\Database\\Migrations\\Migrator->runPending()
speedtest-tracker  | #18 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php(90): Illuminate\\Database\\Migrations\\Migrator->run()
speedtest-tracker  | #19 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(633): Illuminate\\Database\\Console\\Migrations\\MigrateCommand->Illuminate\\Database\\Console\\Migrations\\{closure}()
speedtest-tracker  | #20 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php(83): Illuminate\\Database\\Migrations\\Migrator->usingConnection()
speedtest-tracker  | #21 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Illuminate\\Database\\Console\\Migrations\\MigrateCommand->handle()
speedtest-tracker  | #22 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()
speedtest-tracker  | #23 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\\Container\\Util::unwrapIfClosure()
speedtest-tracker  | #24 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(35): Illuminate\\Container\\BoundMethod::callBoundMethod()
speedtest-tracker  | #25 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(662): Illuminate\\Container\\BoundMethod::call()
speedtest-tracker  | #26 /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Command.php(211): Illuminate\\Container\\Container->call()
speedtest-tracker  | #27 /var/www/html/vendor/symfony/console/Command/Command.php(326): Illuminate\\Console\\Command->execute()
speedtest-tracker  | #28 /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Command.php(180): Symfony\\Component\\Console\\Command\\Command->run()
speedtest-tracker  | #29 /var/www/html/vendor/symfony/console/Application.php(1096): Illuminate\\Console\\Command->run()
speedtest-tracker  | #30 /var/www/html/vendor/symfony/console/Application.php(324): Symfony\\Component\\Console\\Application->doRunCommand()
speedtest-tracker  | #31 /var/www/html/vendor/symfony/console/Application.php(175): Symfony\\Component\\Console\\Application->doRun()
speedtest-tracker  | #32 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(201): Symfony\\Component\\Console\\Application->run()
speedtest-tracker  | #33 /var/www/html/artisan(35): Illuminate\\Foundation\\Console\\Kernel->handle()
speedtest-tracker  | #34 {main}
speedtest-tracker  | "} 
speedtest-tracker  | In Connection.php line 829:
speedtest-tracker  |                                                                                
speedtest-tracker  |   SQLSTATE[HY000]: General error: 1 there is already another table or index w  
speedtest-tracker  |   ith this name: results_bad_json (Connection: sqlite, SQL: alter table "resu  
speedtest-tracker  |   lts" rename to "results_bad_json")                                           
speedtest-tracker  |                                                                                
speedtest-tracker  | 
speedtest-tracker  | In Connection.php line 581:
speedtest-tracker  |                                                                                
speedtest-tracker  |   SQLSTATE[HY000]: General error: 1 there is already another table or index w  
speedtest-tracker  |   ith this name: results_bad_json                                              
speedtest-tracker  |                                                                                
speedtest-tracker  | 
speedtest-tracker  | s6-rc: warning: unable to start service laravel-automations: command exited 1
speedtest-tracker  | /run/s6/basedir/scripts/rc.init: warning: s6-rc failed to properly bring all the services up! Check your logs (in /run/uncaught-logs/current if you have in-container logging) for more information.
speedtest-tracker  | prog: fatal: stopping the container.
speedtest-tracker exited with code 0
ReVoLt112 commented 6 months ago

Workaround:

i stopped the container, renamed the table "results_bad_json" to "bak_results_bad_json", started the container an it works. Then stop again. Delete the new "results_bad_json" and renamed "bak_results_bad_json" back.

then you need to change the value for "bad_json_migrated" in the settings table from true to false.

Start the container and migrate your data.

alexjustesen commented 6 months ago

For those having an issue can you confirm if you're using my image or the LSIO one?

spupuz commented 6 months ago

I'm Using your image

mmomjian commented 6 months ago

I got this issue with both your image and the LSIO one. Reverting to 0.15.5 fixed it with both versions. Using Postgres.

Churator commented 6 months ago

I used yours Switched to linuxserver and its the same.

On Mon, 19 Feb 2024 at 22:36 Alex Justesen @.***> wrote:

For those having an issue can you confirm if you're using my image or the LSIO one?

— Reply to this email directly, view it on GitHub https://github.com/alexjustesen/speedtest-tracker/issues/1154#issuecomment-1953129923, or unsubscribe https://github.com/notifications/unsubscribe-auth/AO5ATMH4HZ3PVFIVQOYBKTTYUOZVJAVCNFSM6AAAAABDP2TSKCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNJTGEZDSOJSGM . You are receiving this because you authored the thread.Message ID: @.***>

jacotec commented 6 months ago

Same here with the official repo. Going back to 0.15.5 solved it here as well.