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

Laravel Horizon pop params wrong #53063

Closed
bbashy opened this issue Oct 8, 2024 · 3 comments
Closed

Laravel Horizon pop params wrong #53063

bbashy opened this issue Oct 8, 2024 · 3 comments

Comments

@bbashy
Copy link
Contributor

bbashy commented Oct 8, 2024

Laravel Version

11.27.0

PHP Version

8.3.12

Database Driver & Version

No response

Description

After upgrading from 11.26.0 to 11.27.0 this error happens for php artisan horizon

 INFO  Shutting down.


   Symfony\Component\ErrorHandler\Error\FatalError

  Declaration of Laravel\Horizon\RedisQueue::pop($queue = null) must be compatible with Illuminate\Queue\RedisQueue::pop($queue = null, $index = 0)

  at vendor/laravel/horizon/src/RedisQueue.php:131
    127▕      *
    128▕      * @param  string  $queue
    129▕      * @return \Illuminate\Contracts\Queue\Job|null
    130▕      */
  ➜ 131▕     public function pop($queue = null)
    132▕     {
    133▕         return tap(parent::pop($queue), function ($result) use ($queue) {
    134▕             if ($result) {
    135▕                 $this->event($this->getQueue($queue), new JobReserved($result->getReservedJob()));


   Whoops\Exception\ErrorException

  Declaration of Laravel\Horizon\RedisQueue::pop($queue = null) must be compatible with Illuminate\Queue\RedisQueue::pop($queue = null, $index = 0)

  at vendor/laravel/horizon/src/RedisQueue.php:131
    127▕      *
    128▕      * @param  string  $queue
    129▕      * @return \Illuminate\Contracts\Queue\Job|null
    130▕      */
  ➜ 131▕     public function pop($queue = null)
    132▕     {
    133▕         return tap(parent::pop($queue), function ($result) use ($queue) {
    134▕             if ($result) {
    135▕                 $this->event($this->getQueue($queue), new JobReserved($result->getReservedJob()));

      +1 vendor frames

  2   [internal]:0
      Whoops\Run::handleShutdown()

Downgrading fixes it.

Steps To Reproduce

Run php artisan horizon even if not using redis for queues.

@aromka
Copy link

aromka commented Oct 8, 2024

Getting the same after the latest update (11.27.0) - horizon fails with Symfony\Component\ErrorHandler\Error\FatalError: Declaration of Laravel\Horizon\RedisQueue::pop($queue = null) must be compatible with Illuminate\Queue\RedisQueue::pop($queue = null, $index = 0) - seems related to #52826

@webpatser
Copy link
Contributor

webpatser commented Oct 8, 2024

Also with this update and the addition of the --json option. Horizon won't start properly since the --json option is not present in the horizon worker.

laravel/horizon#1505

@crynobone
Copy link
Member

It should be fixed via laravel/horizon#1504

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

4 participants