Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error "general.prune_results_older_than" in docker container logs. #1171

Closed
Magelo opened this issue Feb 20, 2024 · 7 comments
Closed

Error "general.prune_results_older_than" in docker container logs. #1171

Magelo opened this issue Feb 20, 2024 · 7 comments
Assignees
Labels
🐛 bug Something isn't working

Comments

@Magelo
Copy link

Magelo commented Feb 20, 2024

Describe the bug
Speedtest-Tracker latest docker image (0.16.2)

On start these lines are shown in container logs:

production.ERROR: Could not create setting general.prune_results_older_than because it already exists {"exception":"[object] (Spatie\LaravelSettings\Exceptions\SettingAlreadyExists(code: 0): Could not create setting general.prune_results_older_than because it already exists at /app/www/vendor/spatie/laravel-settings/src/Exceptions/SettingAlreadyExists.php:11)
[stacktrace]
#0 /app/www/vendor/spatie/laravel-settings/src/Migrations/SettingsMigrator.php(54): Spatie\LaravelSettings\Exceptions\SettingAlreadyExists::whenAdding()
#1 /app/www/database/settings/2024_02_18_010000_add_prune_results_to_general_settings.php(9): Spatie\LaravelSettings\Migrations\SettingsMigrator->add()
#2 /app/www/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(493): Spatie\LaravelSettings\Migrations\SettingsMigration@anonymous->up()
#3 /app/www/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(410): Illuminate\Database\Migrations\Migrator->runMethod()
#4 /app/www/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(419): Illuminate\Database\Migrations\Migrator->Illuminate\Database\Migrations\{closure}()
#5 /app/www/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(216): Illuminate\Database\Migrations\Migrator->runMigration()
#6 /app/www/vendor/laravel/framework/src/Illuminate/Console/View/Components/Task.php(37): Illuminate\Database\Migrations\Migrator->Illuminate\Database\Migrations\{closure}()
#7 /app/www/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(756): Illuminate\Console\View\Components\Task->render()
#8 /app/www/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(216): Illuminate\Database\Migrations\Migrator->write()
#9 /app/www/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(181): Illuminate\Database\Migrations\Migrator->runUp()
#10 /app/www/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(124): Illuminate\Database\Migrations\Migrator->runPending()
#11 /app/www/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php(90): Illuminate\Database\Migrations\Migrator->run()
#12 /app/www/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(633): Illuminate\Database\Console\Migrations\MigrateCommand->Illuminate\Database\Console\Migrations\{closure}()
#13 /app/www/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php(83): Illuminate\Database\Migrations\Migrator->usingConnection()
#14 /app/www/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Illuminate\Database\Console\Migrations\MigrateCommand->handle()
#15 /app/www/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#16 /app/www/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure()
#17 /app/www/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(35): Illuminate\Container\BoundMethod::callBoundMethod()
#18 /app/www/vendor/laravel/framework/src/Illuminate/Container/Container.php(662): Illuminate\Container\BoundMethod::call()
#19 /app/www/vendor/laravel/framework/src/Illuminate/Console/Command.php(211): Illuminate\Container\Container->call()
#20 /app/www/vendor/symfony/console/Command/Command.php(326): Illuminate\Console\Command->execute()
#21 /app/www/vendor/laravel/framework/src/Illuminate/Console/Command.php(180): Symfony\Component\Console\Command\Command->run()
#22 /app/www/vendor/symfony/console/Application.php(1096): Illuminate\Console\Command->run()
#23 /app/www/vendor/symfony/console/Application.php(324): Symfony\Component\Console\Application->doRunCommand()
#24 /app/www/vendor/symfony/console/Application.php(175): Symfony\Component\Console\Application->doRun()
#25 /app/www/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(201): Symfony\Component\Console\Application->run()
#26 /app/www/artisan(35): Illuminate\Foundation\Console\Kernel->handle()
#27 {main}
"}
In SettingAlreadyExists.php line 11:
Could not create setting general.prune_results_older_than because it already exists

@alexjustesen
Copy link
Owner

alexjustesen commented Feb 20, 2024

If you're familiar with editing records in your database the quick non-code way is to...

  1. Go into your settings table.
  2. Find the record called prune_results_older_than and remove it.
  3. Restart the container and let it do it's missing migrations.

@alexjustesen alexjustesen added the 🐛 bug Something isn't working label Feb 20, 2024
@alexjustesen alexjustesen self-assigned this Feb 20, 2024
@perfectra1n
Copy link

I'm running into the same issue, and my settings table doesn't appear to have a prune_results_older_than value under the name column.

image

@FuadAbdullah
Copy link

FuadAbdullah commented Feb 20, 2024

Hi, I encountered the same error and went through my instance's settings table to look for the prune_results_older_than entry, but I couldn't find it. The screenshot below shows the field name sorted in ascending order where it should've been. I am running PostgreSQL.

image

@Magelo
Copy link
Author

Magelo commented Feb 20, 2024

If you're familiar with editing records in your database the quick non-code way is to...

  1. Go into your settings table.
  2. Find the record called prune_results_older_than and remove it.
  3. Restart the container and let it do it's missing migrations.

I added phpmyadmin to my docker compose (because with 0.16.0 my sqlite was broken, and I decided to try mysql) and was able to delete the record from my settings table. My log is now clean.

@alexjustesen
Copy link
Owner

@perfectra1n @FuadAbdullah make sure you're pulling v0.16.3, this should of been fixed from v0.16.0

@FuadAbdullah
Copy link

FuadAbdullah commented Feb 20, 2024

I have pulled the latest image and have performed the migration. It is fixed now, thank you!

@perfectra1n
Copy link

Yep, version v0.16.3 worked for me as well, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants