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

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'speedtesttracker.cache' doesn't exist #2014

Open
nzbtuxnews opened this issue Jan 24, 2025 · 3 comments

Comments

@nzbtuxnews
Copy link

nzbtuxnews commented Jan 24, 2025

Describe the bug
Latest container release deployed in docker-compose (via portainer), container starts but errors out with error 500 in webpage.

Container logs shows "Base table or view not found: 1146 Table 'speedtesttracker.cache' doesn't exist" howeverI confirm that remote MariaDB server receives a connection from the container as some tables have been successfully created by he container (migrations, password_resets, users).

Docker compose:

services:
    speedtest-tracker:
        image: lscr.io/linuxserver/speedtest-tracker:latest
        restart: unless-stopped
        container_name: speedtest-tracker
        ports:
            - 8090:80
            - 8443:443
        environment:
            - PUID=1002
            - PGID=1002
            - APP_KEY=base64:***********************************
            - CACHE_DRIVER=database
            - DB_CONNECTION=mariadb
            - DB_HOST=dbserver_IP
            - DB_PORT=3306
            - DB_DATABASE=***********
            - DB_USERNAME=***********
            - DB_PASSWORD=***********
        volumes:
            - /home/speedtesttracker:/config
            - /home/speedtesttracker/keys:/config/keys
volumes:
  speedtest-db:

To Reproduce
Steps to reproduce the behavior:

  1. Install latest docker image
  2. Use the above docker compose script

Environment (please complete the following information):

  • OS: Rocky Linux 8
  • Architecture: amd64
  • Browser Librewolf

Logs

In Connection.php line 825:
                                                                               
  SQLSTATE[42S02]: Base table or view not found: 1146 Table 'speedtesttracker  
  .cache' doesn't exist (Connection: mariadb, SQL: select * from `cache` wher  
  e `key` in (laravel_cache_illuminate:queue:restart))                         
                                                                               
In Connection.php line 407:
                                                                               
  SQLSTATE[42S02]: Base table or view not found: 1146 Table 'speedtesttracker  
  .cache' doesn't exist                                                        
                                                                               
[2025-01-24 00:09:32] production.ERROR: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'speedtesttracker.cache' doesn't exist (Connection: mariadb, SQL: select * from `cache` where `key` in (laravel_cache_illuminate:queue:restart)) {"exception":"[object] (Illuminate\\Database\\QueryException(code: 42S02): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'speedtesttracker.cache' doesn't exist (Connection: mariadb, SQL: select * from `cache` where `key` in (laravel_cache_illuminate:queue:restart)) at /app/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php:825)
[stacktrace]
#0 /app/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php(779): Illuminate\\Database\\Connection->runQueryCallback()
#1 /app/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php(398): Illuminate\\Database\\Connection->run()
#2 /app/www/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(3133): Illuminate\\Database\\Connection->select()
#3 /app/www/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(3118): Illuminate\\Database\\Query\\Builder->runSelect()
#4 /app/www/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(3706): Illuminate\\Database\\Query\\Builder->Illuminate\\Database\\Query\\{closure}()
#5 /app/www/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(3117): Illuminate\\Database\\Query\\Builder->onceWithColumns()
#6 /app/www/vendor/laravel/framework/src/Illuminate/Cache/DatabaseStore.php(130): Illuminate\\Database\\Query\\Builder->get()
#7 /app/www/vendor/laravel/framework/src/Illuminate/Cache/DatabaseStore.php(105): Illuminate\\Cache\\DatabaseStore->many()
#8 /app/www/vendor/laravel/framework/src/Illuminate/Cache/Repository.php(117): Illuminate\\Cache\\DatabaseStore->get()
#9 /app/www/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(714): Illuminate\\Cache\\Repository->get()
#10 /app/www/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(139): Illuminate\\Queue\\Worker->getTimestampOfLastQueueRestart()
#11 /app/www/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(149): Illuminate\\Queue\\Worker->daemon()
#12 /app/www/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(132): Illuminate\\Queue\\Console\\WorkCommand->runWorker()
#13 /app/www/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Illuminate\\Queue\\Console\\WorkCommand->handle()
#14 /app/www/vendor/laravel/framework/src/Illuminate/Container/Util.php(43): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()
#15 /app/www/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(95): Illuminate\\Container\\Util::unwrapIfClosure()
#16 /app/www/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(35): Illuminate\\Container\\BoundMethod::callBoundMethod()
#17 /app/www/vendor/laravel/framework/src/Illuminate/Container/Container.php(694): Illuminate\\Container\\BoundMethod::call()
#18 /app/www/vendor/laravel/framework/src/Illuminate/Console/Command.php(213): Illuminate\\Container\\Container->call()
#19 /app/www/vendor/symfony/console/Command/Command.php(279): Illuminate\\Console\\Command->execute()
#20 /app/www/vendor/laravel/framework/src/Illuminate/Console/Command.php(182): Symfony\\Component\\Console\\Command\\Command->run()
#21 /app/www/vendor/symfony/console/Application.php(1094): Illuminate\\Console\\Command->run()
#22 /app/www/vendor/symfony/console/Application.php(342): Symfony\\Component\\Console\\Application->doRunCommand()
#23 /app/www/vendor/symfony/console/Application.php(193): Symfony\\Component\\Console\\Application->doRun()
#24 /app/www/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(198): Symfony\\Component\\Console\\Application->run()
#25 /app/www/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(1208): Illuminate\\Foundation\\Console\\Kernel->handle()
#26 /app/www/artisan(13): Illuminate\\Foundation\\Application->handleCommand()
#27 {main}
[previous exception] [object] (PDOException(code: 42S02): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'speedtesttracker.cache' doesn't exist at /app/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php:407)
[stacktrace]
#0 /app/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php(407): PDO->prepare()
#1 /app/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php(812): Illuminate\\Database\\Connection->Illuminate\\Database\\{closure}()
#2 /app/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php(779): Illuminate\\Database\\Connection->runQueryCallback()
#3 /app/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php(398): Illuminate\\Database\\Connection->run()
#4 /app/www/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(3133): Illuminate\\Database\\Connection->select()
#5 /app/www/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(3118): Illuminate\\Database\\Query\\Builder->runSelect()
#6 /app/www/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(3706): Illuminate\\Database\\Query\\Builder->Illuminate\\Database\\Query\\{closure}()
#7 /app/www/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(3117): Illuminate\\Database\\Query\\Builder->onceWithColumns()
#8 /app/www/vendor/laravel/framework/src/Illuminate/Cache/DatabaseStore.php(130): Illuminate\\Database\\Query\\Builder->get()
#9 /app/www/vendor/laravel/framework/src/Illuminate/Cache/DatabaseStore.php(105): Illuminate\\Cache\\DatabaseStore->many()
#10 /app/www/vendor/laravel/framework/src/Illuminate/Cache/Repository.php(117): Illuminate\\Cache\\DatabaseStore->get()
#11 /app/www/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(714): Illuminate\\Cache\\Repository->get()
#12 /app/www/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(139): Illuminate\\Queue\\Worker->getTimestampOfLastQueueRestart()
#13 /app/www/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(149): Illuminate\\Queue\\Worker->daemon()
#14 /app/www/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(132): Illuminate\\Queue\\Console\\WorkCommand->runWorker()
#15 /app/www/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Illuminate\\Queue\\Console\\WorkCommand->handle()
#16 /app/www/vendor/laravel/framework/src/Illuminate/Container/Util.php(43): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()
#17 /app/www/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(95): Illuminate\\Container\\Util::unwrapIfClosure()
#18 /app/www/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(35): Illuminate\\Container\\BoundMethod::callBoundMethod()
#19 /app/www/vendor/laravel/framework/src/Illuminate/Container/Container.php(694): Illuminate\\Container\\BoundMethod::call()
#20 /app/www/vendor/laravel/framework/src/Illuminate/Console/Command.php(213): Illuminate\\Container\\Container->call()
#21 /app/www/vendor/symfony/console/Command/Command.php(279): Illuminate\\Console\\Command->execute()
#22 /app/www/vendor/laravel/framework/src/Illuminate/Console/Command.php(182): Symfony\\Component\\Console\\Command\\Command->run()
#23 /app/www/vendor/symfony/console/Application.php(1094): Illuminate\\Console\\Command->run()
#24 /app/www/vendor/symfony/console/Application.php(342): Symfony\\Component\\Console\\Application->doRunCommand()
#25 /app/www/vendor/symfony/console/Application.php(193): Symfony\\Component\\Console\\Application->doRun()
#26 /app/www/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(198): Symfony\\Component\\Console\\Application->run()
#27 /app/www/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(1208): Illuminate\\Foundation\\Console\\Kernel->handle()
#28 /app/www/artisan(13): Illuminate\\Foundation\\Application->handleCommand()
#29 {main}
"} 
In Connection.php line 825:
                                                                               
  SQLSTATE[42S02]: Base table or view not found: 1146 Table 'speedtesttracker  
  .cache' doesn't exist (Connection: mariadb, SQL: select * from `cache` wher  
  e `key` in (laravel_cache_illuminate:queue:restart))                         
                                                                               
In Connection.php line 407:
                                                                               
  SQLSTATE[42S02]: Base table or view not found: 1146 Table 'speedtesttracker  
  .cache' doesn't exist
@svenvg93
Copy link
Contributor

Can you check if the migration run for it. Inside of the container run

cd /app/www/
php artisan migrate:status

They all should have status Ran

@nzbtuxnews
Copy link
Author

Hello! I ran the command and this is the output:


root@16ff98b19c2c:/app/www# php artisan migrate:status

  Migration name .................................................................................................................... Batch / Status  
  2014_10_12_000000_create_users_table ..................................................................................................... [1] Ran  
  2014_10_12_100000_create_password_resets_table ........................................................................................... [1] Ran  
  2018_08_08_100000_create_telescope_entries_table ......................................................................................... Pending  
  2019_08_19_000000_create_failed_jobs_table ............................................................................................... Pending  
  2019_12_14_000001_create_personal_access_tokens_table .................................................................................... Pending  
  2022_08_18_015337_create_jobs_table ...................................................................................................... Pending  
  2022_08_31_202106_create_results_table ................................................................................................... Pending  
  2022_10_20_211143_create_sessions_table .................................................................................................. Pending  
  2022_10_21_104903_create_settings_table .................................................................................................. Pending  
  2022_10_21_130121_create_influxdb_settings ............................................................................................... Pending  
  2022_10_24_152031_create_notifications_table ............................................................................................. Pending  
  2022_10_24_153150_create_database_notifications_settings ................................................................................. Pending  
  2022_10_24_153411_create_thresholds_settings ............................................................................................. Pending  
  2022_11_11_134355_create_mail_notification_settings ...................................................................................... Pending  
  2022_12_22_125055_create_telegram_notification_settings .................................................................................. Pending  
  2023_01_05_205157_create_cache_table ..................................................................................................... Pending  
  2023_02_28_000000_create_one_time_operations_table ....................................................................................... Pending  
  2023_03_06_002044_add_verify_ssl_to_influx_db_settings ................................................................................... Pending  
  2023_05_07_000000_rename_password_resets_table ........................................................................................... Pending  
  2023_09_11_144858_create_webhook_notification_settings ................................................................................... Pending  
  2024_02_07_173217_add_telegram_disable_notification_to_notification_settings ............................................................. Pending  
  2024_02_18_000050_update_locked_default_on_settings_table ................................................................................ Pending  
  2024_02_19_134641_create_job_batches_table ............................................................................................... Pending  
  2024_02_19_134706_create_imports_table ................................................................................................... Pending  
  2024_02_19_134707_create_exports_table ................................................................................................... Pending  
  2024_02_19_134708_create_failed_import_rows_table ........................................................................................ Pending  
  2024_02_22_144620_create_healthcheck_notification_settings ............................................................................... Pending  
  2024_02_22_144650_create_discord_notification_settings ................................................................................... Pending  
  2024_02_22_144650_create_ntfy_notification_settings ...................................................................................... Pending  
  2024_02_22_144650_create_slack_notification_settings ..................................................................................... Pending  
  2024_02_22_144654_create_gotify_notification_settings .................................................................................... Pending  
  2024_02_22_144680_create_pushover_notification_settings .................................................................................. Pending  
  2024_09_11_094357_rename_influxdb_settings ............................................................................................... Pending  
  2024_11_22_235011_add_benchmarks_to_results_table ........................................................................................ Pending  
  2024_11_23_021744_add_healthy_to_results_table ........................................................................................... Pending  

Looks like something is preventing the migration or DB table creation from occuring?

@svenvg93
Copy link
Contributor

Can you try to run them manual with php artisan migrate in the same folder as before. To see what is preventing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants