Skip to content

Intermittent ArgumentCountError from CarbonImmutable::addUnit() in RedisJobRepository on PHP 8.5.3 (JIT/OPcache) #1713

@gracjankubicki

Description

@gracjankubicki

Summary

We observe intermittent production errors in Horizon job storage:

ArgumentCountError: Too few arguments to function Carbon\\CarbonImmutable::addUnit()

The stack points to Laravel\\Horizon\\Repositories\\RedisJobRepository::pushed() where Horizon calls CarbonImmutable::now()->addMinutes(...).

Environment

  • Laravel 12.51.0
  • Horizon 5.44.0 (also observed earlier on 5.43.0)
  • Carbon 3.11.x
  • PHP 8.5.3
  • ECS blue/green deployments
  • OPcache enabled, JIT enabled in production

Behavior

  • Error appears intermittently across different endpoints.
  • After full redeploy/restart, errors temporarily disappear.
  • First observed around 2026-01-22.

Relevant stack frame

Laravel\\Horizon\\Repositories\\RedisJobRepository::pushed()

$pipe->expireat(
    $payload->id(), CarbonImmutable::now()->addMinutes($this->pendingJobExpires)->getTimestamp()
);

Notes

Temporary app-level shield

As a mitigation, we replaced TTL Carbon math with plain timestamp arithmetic in an app override of Horizon job repository.

Question

Have you seen similar reports in Horizon on PHP 8.5 + JIT/OPcache? Any recommended diagnostics from Horizon side to help isolate root cause?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions