laravel / horizon

Dashboard and code-driven configuration for Laravel queues.
https://laravel.com/docs/horizon
MIT License
3.84k stars 645 forks source link

Creation of dynamic property Illuminate\Foundation\Bus\PendingChain::$chained is deprecated #1363

Closed cyppe closed 8 months ago

cyppe commented 8 months ago

Horizon Version

5.21.4

Laravel Version

10.40.0

PHP Version

8.2.13

Redis Driver

PhpRedis

Redis Version

6.0.2

Database Driver & Version

8.0.31-google

Description

I started to use Bus::chain and chaining Bus::batch, and it works great.

I just noticed now when having the new "artisan pail" command to monitor my application, that I get some deprecation warnings from horizon when visiting the Batch page.

┌ 20:37:26 WARNING ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Creation of dynamic property Illuminate\Foundation\Bus\PendingChain::$chained is deprecated in /home/forge/gen/vendor/lara… │ └──────────────────────────────────────────────────────────────────────────────────────────────────────── GET: /horizon/api/batches • Auth ID: guest ┘ ┌ 20:37:26 WARNING ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Creation of dynamic property Illuminate\Foundation\Bus\PendingChain::$chainConnection is deprecated in /home/forge/gen/ven… │ └──────────────────────────────────────────────────────────────────────────────────────────────────────── GET: /horizon/api/batches • Auth ID: guest ┘ ┌ 20:37:26 WARNING ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Creation of dynamic property Illuminate\Foundation\Bus\PendingChain::$chainQueue is deprecated in /home/forge/gen/vendor/l… │ └──────────────────────────────────────────────────────────────────────────────────────────────────────── GET: /horizon/api/batches • Auth ID: guest ┘ ┌ 20:37:26 WARNING ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Creation of dynamic property Illuminate\Foundation\Bus\PendingChain::$chainCatchCallbacks is deprecated in /home/forge/gen… │ └──────────────────────────────────────────────────────────────────────────────────────────────────────── GET: /horizon/api/batches • Auth ID: guest ┘ ┌ 20:37:26 WARNING ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐

Example what I do when adding batches. Probably not relevant, but just so you know that I combine chain and batch if it matters for getting the deprecation warnings.

Bus::chain([
                Bus::batch($importProductsToRedisJobs),
                ...$importProductsToEsalesJob
            ])->dispatch();

Steps To Reproduce

Dispatch some batches and visit horizon/batches to monitor batches and check output from php artisan pail to get the warnings.

driesvints commented 8 months ago

Hi there. Could you post full stack traces for these? Thanks!

cyppe commented 8 months ago

I think the problem was related to that somehow a package bumped some symfony component to 7.0.2, at least I know event-dispatcher was updated to 7.0.2.

I have not been able to trace how it happened but I managed to downgrade it again to 6.x series supported by Laravel. And when that was done the deprecation warnings is no longer visible.

I am not 100% sure that was the reason, of if I had some php setting enabled for more verbose warnings about deprecations. But I no longer can see the errors. So if you anyone don't have any other idea or if the properties like Illuminate\Foundation\Bus\PendingChain::$chainQueue is indeed being created dynamically, then I guess we can close it.

But I cannot see for example $chainQueue being defined in https://github.com/laravel/framework/blob/10.x/src/Illuminate/Foundation/Bus/PendingChain.php#L155 so maybe there is something missing?

If it's not a real issue I guess you can close this ticket.

driesvints commented 8 months ago

Hi there. Thanks for your insights. If there indeed is no reproducible way at this time we'll have to wait until there is. Thanks