laravel / reverb

Laravel Reverb provides a real-time WebSocket communication backend for Laravel applications.
https://reverb.laravel.com
MIT License
942 stars 63 forks source link

An error occurs very often EntriesRepository #175

Closed devexchanger closed 2 months ago

devexchanger commented 2 months ago

Reverb Version

1.1

Laravel Version

10.4

PHP Version

8.2

Description

Every minute this error appears in production

I think there are problems in the file: StartServer.php method ensureTelescopeEntriesAreCollected()

       if (! class_exists(\Laravel\Telescope\Telescope::class)) {
            return;
        }

        $loop->addPeriodicTimer($interval, function () {
            \Laravel\Telescope\Telescope::store($this->laravel->make(\Laravel\Telescope\Contracts\EntriesRepository::class));
        });

Sometimes it may be that in development mode we use “Telescope”, and in production we disable it, but there are assumptions that there is no check here

The solution to the problem could be:

       if ($this->laravel['config']['reverb.telescope'] == false) {
            return;
        }

Steps To Reproduce

production.ERROR: Target [Laravel\Telescope\Contracts\EntriesRepository] is not instantiable while building [Laravel\Reverb\Servers\Reverb\Console\Commands\StartServer]. {"exception":"[object] (Illuminate\Contracts\Container\BindingResolutionException(code: 0): Target [Laravel\Telescope\Contracts\EntriesRepository] is not instantiable while building [Laravel\Reverb\Servers\Reverb\Console\Commands\StartServer]. at /var/www/marketcoin_i_usr/data/www/marketcoin.io/vendor/laravel/framework/src/Illuminate/Container/Container.php:1118)

devexchanger commented 2 months ago

The problem has already been solved in your update (I didn't see it)