orchestral/testbench

PDOException: SQLSTATE[HY000]: General error: 1 no such table: pragma_compile_options

Closed this issue · 5 comments

  • Testbench Version: 8.15.0
  • Laravel Version: 10.34.0
  • PHP Version: 8.1.17
  • Database Driver & Version: sqlite v3.7.17

Description:

Tests fail with error:

There was 1 error:

1) Root\LaravelSandbox\Tests\MinimalTest::test_pass
Illuminate\Database\QueryException: SQLSTATE[HY000]: General error: 1 no such table: pragma_compile_options (Connection: testbe
nch, SQL: select exists (select 1 from pragma_compile_options where compile_options = 'ENABLE_DBSTAT_VTAB') as enabled)        

/var/www/onbuy/laravel-sandbox/vendor/laravel/framework/src/Illuminate/Database/Connection.php:822
/var/www/onbuy/laravel-sandbox/vendor/laravel/framework/src/Illuminate/Database/Connection.php:776
/var/www/onbuy/laravel-sandbox/vendor/laravel/framework/src/Illuminate/Database/Connection.php:424
/var/www/onbuy/laravel-sandbox/vendor/laravel/framework/src/Illuminate/Database/Connection.php:353
/var/www/onbuy/laravel-sandbox/vendor/laravel/framework/src/Illuminate/Database/Connection.php:370
/var/www/onbuy/laravel-sandbox/vendor/laravel/framework/src/Illuminate/Database/Schema/SQLiteBuilder.php:40
/var/www/onbuy/laravel-sandbox/vendor/laravel/framework/src/Illuminate/Database/Schema/Builder.php:162
/var/www/onbuy/laravel-sandbox/vendor/laravel/framework/src/Illuminate/Database/Migrations/DatabaseMigrationRepository.php:184 
/var/www/onbuy/laravel-sandbox/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:700
/var/www/onbuy/laravel-sandbox/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php:140      
/var/www/onbuy/laravel-sandbox/vendor/laravel/framework/src/Illuminate/Support/helpers.php:248
/var/www/onbuy/laravel-sandbox/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php:159      
/var/www/onbuy/laravel-sandbox/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php:116      
/var/www/onbuy/laravel-sandbox/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php:84       
/var/www/onbuy/laravel-sandbox/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:633
/var/www/onbuy/laravel-sandbox/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php:104      
/var/www/onbuy/laravel-sandbox/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:36
/var/www/onbuy/laravel-sandbox/vendor/laravel/framework/src/Illuminate/Container/Util.php:41
/var/www/onbuy/laravel-sandbox/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:93
/var/www/onbuy/laravel-sandbox/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:37
/var/www/onbuy/laravel-sandbox/vendor/laravel/framework/src/Illuminate/Container/Container.php:662
/var/www/onbuy/laravel-sandbox/vendor/laravel/framework/src/Illuminate/Console/Command.php:211
/var/www/onbuy/laravel-sandbox/vendor/symfony/console/Command/Command.php:326
/var/www/onbuy/laravel-sandbox/vendor/laravel/framework/src/Illuminate/Console/Command.php:181
/var/www/onbuy/laravel-sandbox/vendor/laravel/framework/src/Illuminate/Console/Concerns/CallsCommands.php:68
/var/www/onbuy/laravel-sandbox/vendor/laravel/framework/src/Illuminate/Console/Concerns/CallsCommands.php:28
/var/www/onbuy/laravel-sandbox/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/FreshCommand.php:59
/var/www/onbuy/laravel-sandbox/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:36
/var/www/onbuy/laravel-sandbox/vendor/laravel/framework/src/Illuminate/Container/Util.php:41
/var/www/onbuy/laravel-sandbox/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:93
/var/www/onbuy/laravel-sandbox/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:37
/var/www/onbuy/laravel-sandbox/vendor/laravel/framework/src/Illuminate/Container/Container.php:662
/var/www/onbuy/laravel-sandbox/vendor/laravel/framework/src/Illuminate/Console/Command.php:211
/var/www/onbuy/laravel-sandbox/vendor/symfony/console/Command/Command.php:326
/var/www/onbuy/laravel-sandbox/vendor/laravel/framework/src/Illuminate/Console/Command.php:181
/var/www/onbuy/laravel-sandbox/vendor/symfony/console/Application.php:1078
/var/www/onbuy/laravel-sandbox/vendor/symfony/console/Application.php:324
/var/www/onbuy/laravel-sandbox/vendor/symfony/console/Application.php:175
/var/www/onbuy/laravel-sandbox/vendor/laravel/framework/src/Illuminate/Console/Application.php:163
/var/www/onbuy/laravel-sandbox/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:400
/var/www/onbuy/laravel-sandbox/vendor/laravel/framework/src/Illuminate/Testing/PendingCommand.php:296
/var/www/onbuy/laravel-sandbox/tests/TestCase.php:26

This does not happen if I change the laravel/framework version to 10.33.0 .

Steps To Reproduce:

I have a very simple composer / phpunit / test setup.

  • run ./vendor/bin/phpunit as it is, and it'll pass.
  • edit composer.json to contain "laravel/framework": "10.34.0", and save
  • run composer update
  • run ./vendor/bin/phpunit and see it fail

Look like this could be caused by laravel/framework#49020

Still need failing tests PR to move things forward.

Hi, sorry for not replying sooner (I see this issue has been closed as "not planned" after a week of inactivity.
If I checkout testbench-core and simply run the existing tests I encounter the same error in 18 of the tests. As such I'm not sure where to go from here. Since the tests already fail, is it just a case of someone with a clue of how to fix this to set up an environment with the relevant versions and have at it?

I cannot replicate the issue in GitHub Actions and locally, you need to submit reproducing code as PR to testbench-core to move forward.

This only happens on legacy SQLite versions prior to 3.16, I sent a PR for this that will come on the next Laravel patch realease. However, you may upgrade your SQLite to a newer version in the meantime, preferably 3.35+ if possible.