telescope: Base table or view not found: 1146 Table 'homestead.telescope_entries' doesn't exist when trying to composer require the package

Looks like this is trying to record the package:discover command before i have had chance to run the migrations. 😦

[2018-10-29 15:06:05] local.ERROR: SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘homestead.telescope_entries’ doesn’t exist (SQL: insert into telescope_entries (batch_id, content, created_at, type, uuid) values (8c23240c-60f0-4435-8031-9b393766394a, {“command”:“package:discover”,“exit_code”:0,“arguments”:{“command”:“package:discover”},“options”:{“help”:false,“quiet”:false,“verbose”:false,“version”:false,“ansi”:false,“no-ansi”:false,“no-interaction”:false,“env”:null},“output”:“”,“hostname”:“5b3b6f02f219”}, 2018-10-29 15:06:05, command, 8c23240c-6080-402b-92d3-6bc3bf0b3554)) {“exception”:"[object] (Illuminate\Database\QueryException(code: 42S02): SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘homestead.telescope_entries’ doesn’t exist (SQL: insert into telescope_entries (batch_id, content, created_at, type, uuid) values (8c23240c-60f0-4435-8031-9b393766394a, {"command":"package:discover","exit_code":0,"arguments":{"command":"package:discover"},"options":{"help":false,"quiet":false,"verbose":false,"version":false,"ansi":false,"no-ansi":false,"no-interaction":false,"env":null},"output":"","hostname":"5b3b6f02f219"}, 2018-10-29 15:06:05, command, 8c23240c-6080-402b-92d3-6bc3bf0b3554)) at /app/vendor/laravel/framework/src/Illuminate/Database/Connection.php:664, Doctrine\DBAL\Driver\PDOException(code: 42S02): SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘homestead.telescope_entries’ doesn’t exist at /app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:82, PDOException(code: 42S02): SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘homestead.telescope_entries’ doesn’t exist at /app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:80) [stacktrace] #0 /app/vendor/laravel/framework/src/Illuminate/Database/Connection.php(624): Illuminate\Database\Connection->runQueryCallback(‘insert into te...', Array, Object(Closure)) #1 /app/vendor/laravel/framework/src/Illuminate/Database/Connection.php(459): Illuminate\\Database\\Connection->run('insert into te…’, Array, Object(Closure)) #2 /app/vendor/laravel/framework/src/Illuminate/Database/Connection.php(411): Illuminate\Database\Connection->statement(‘insert into te...', Array) #3 /app/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2541): Illuminate\\Database\\Connection->insert('insert into te…’, Array) #4 /app/vendor/laravel/telescope/src/Storage/DatabaseEntriesRepository.php(117): Illuminate\Database\Query\Builder->insert(Array) #5 /app/vendor/laravel/telescope/src/Telescope.php(453): Laravel\Telescope\Storage\DatabaseEntriesRepository->store(Object(Illuminate\Support\Collection)) #6 /app/vendor/laravel/telescope/src/ListensForStorageOpportunities.php(44): Laravel\Telescope\Telescope::store(Object(Laravel\Telescope\Storage\DatabaseEntriesRepository)) #7 [internal function]: Laravel\Telescope\Telescope::Laravel\Telescope\{closure}() #8 /app/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(29): call_user_func_array(Object(Closure), Array) #9 /app/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(75): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}() #10 /app/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(31): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Object(Closure), Object(Closure)) #11 /app/vendor/laravel/framework/src/Illuminate/Container/Container.php(571): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Object(Closure), Array, NULL) #12 /app/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(965): Illuminate\Container\Container->call(Object(Closure)) #13 /app/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(149): Illuminate\Foundation\Application->terminate() #14 /app/artisan(54): Illuminate\Foundation\Console\Kernel->terminate(Object(Symfony\Component\Console\Input\ArgvInput), 0) #15 {main} "}

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 1
  • Comments: 22 (1 by maintainers)

Most upvoted comments

I encountered this issue when running php artisan migrate. As far as I can tell, telescope is trying to log cache hits before there was a cache table in my database. I’m unsure of exactly what the issue is, but this was the error message:

Base' table or view not found: 1146 Table 'x.cache' doesn't exist (SQL: select * from 'cache' where 'key' = x_cachetelescope:dump-watcher limit 1)

On Laravel 5.8, using the database as a cache driver.

I resolved it by changing CACHE_DRIVER=file in .env, running the migration and then changing the CACHE_DRIVER back to database

Hope that helps someone who’s stuck.

Having the same issue (using L5.8). It helped running php artisan migrate first before running php artisan telescope:install to make it install without errors.

If anyone still has this issue, make sure to run:

php artisan optimize composer dump-autoload

php artisan cache:table php artisan migrate

fixed it for me

“Me too” on the CI/docker front. You can reproduce by just doing :

$ laravel new test-telescope
$ cd test-telescope/
$ composer require laravel/telescope

Using version ^1.0 for laravel/telescope
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 2 installs, 0 updates, 0 removals
  - Installing moontoast/math (1.1.2): Loading from cache
  - Installing laravel/telescope (v1.0.1): Loading from cache
Writing lock file
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi

In Connection.php line 664:

  SQLSTATE[HY000] [1049] Unknown database 'homestead' (SQL: select * from inf
  ormation_schema.tables where table_schema = homestead and table_name = tele
  scope_monitoring)

In Connector.php line 70:

  SQLSTATE[HY000] [1049] Unknown database 'homestead'