{"id":"990cee08705e4079","repo":"laravel/framework","slug":"the-failed-job-provider-does-not-have-a-configured","errorCode":null,"errorMessage":"The failed job provider does not have a configured queue","messagePattern":"The failed job provider does not have a configured queue","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"src/Illuminate/Foundation/Cloud/FailedJobProvider.php","lineNumber":59,"sourceCode":"    }\n\n    /**\n     * Log a failed job into storage.\n     *\n     * @param  string  $connection\n     * @param  string  $queue\n     * @param  string  $payload\n     * @param  \\Throwable  $exception\n     * @return string|null\n     */\n    public function log($connection, $queue, $payload, $exception)\n    {\n        if ($connection !== 'cloud') {\n            return $this->failer->log(...func_get_args());\n        }\n\n        if ($this->queue === null) {\n            throw new RuntimeException('The failed job provider does not have a configured queue');\n        }\n\n        $timestamp = CarbonImmutable::now('UTC');\n        $processingJobDetails = $this->queue->processingJobDetails();\n\n        $this->events->emit([\n            '_cloud_event' => 'failed_job',\n            'id' => $id = Str::uuid7($timestamp)->toString(),\n            'queue' => $processingJobDetails['queue'],\n            'started_at' => $processingJobDetails['started_at']->toDateTimeString('microsecond'),\n            'attempts' => $processingJobDetails['attempts'],\n            'payload' => $payload,\n            'exception' => (string) mb_convert_encoding($exception, 'UTF-8'),\n        ]);\n\n        $this->queue->finishProcessingJob(timestamp: $timestamp);\n\n        return $id;","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/laravel/framework/blob/bd6b5437e6ad87bb49f9b426724f07a9f64e9683/src/Illuminate/Foundation/Cloud/FailedJobProvider.php#L41-L77","documentation":"Thrown by Foundation\\Cloud\\FailedJobProvider::log() when a job on the 'cloud' connection fails but the provider's injected Queue instance (the configured cloud queue) is null. The provider needs the cloud Queue to read processingJobDetails (queue name, started_at, attempts) before emitting the failed_job event; without it, it cannot record the failure correctly. This is a wiring/configuration defect rather than a transient runtime issue.","triggerScenarios":"A job dispatched on the cloud connection failing, triggering FailedJobProvider::log('cloud', ...). Reached when the cloud failed-job provider was constructed/injected without its Queue dependency (e.g. custom service provider binding, partial Cloud config, or queue.failer override missing the cloud queue).","commonSituations":"Overriding the queue.failer binding in a service provider without supplying the Cloud Queue. Running cloud connection locally without the Cloud agent present. Misconfigured config/queue.php connections.cloud. Upgrading Laravel Cloud integration and forgetting to republish config.","solutions":["Ensure the cloud failed-job provider is constructed with the cloud Queue instance (don't override queue.failer without re-wiring Cloud dependencies).","Verify config/queue.php has a correctly configured 'cloud' connection and that the Cloud service provider is registered.","If running outside Laravel Cloud, do not use the 'cloud' connection — switch the queue connection to database/redis/sync.","Re-publish or restore the Cloud integration config: php artisan vendor:publish (for the Cloud package)."],"exampleFix":"// before — service provider overrides failer without cloud queue\n$this->app->extend('queue.failer', fn () => new \\Illuminate\\Foundation\\Cloud\\FailedJobProvider($baseFailer, $events, $encrypter));\n\n// after — inject the cloud queue\n$this->app->extend('queue.failer', function ($_, $app) {\n    return new \\Illuminate\\Foundation\\Cloud\\FailedJobProvider(\n        $app->make('queue.failer.base'),\n        $app->make(\\Illuminate\\Foundation\\Cloud\\Events::class),\n        $app->make(\\Illuminate\\Contracts\\Encryption\\StringEncrypter::class),\n    );\n});","handlingStrategy":"validation","validationCode":"// Ensure the cloud failed-job provider has its Queue before any job fails.\n$provider = app('queue.failer');\nif ($provider instanceof \\Illuminate\\Foundation\\Cloud\\FailedJobProvider) {\n    $reflect = new \\ReflectionProperty($provider, 'queue');\n    $reflect->setAccessible(true);\n    if ($reflect->getValue($provider) === null) {\n        throw new \\RuntimeException('Cloud failed-job provider is missing its Queue dependency.');\n    }\n}","typeGuard":"function isCloudFailedJobProviderWired(): bool\n{\n    $provider = app('queue.failer');\n    if (! $provider instanceof \\Illuminate\\Foundation\\Cloud\\FailedJobProvider) {\n        return false;\n    }\n    $r = new \\ReflectionProperty($provider, 'queue');\n    $r->setAccessible(true);\n    return $r->getValue($provider) !== null;\n}","tryCatchPattern":"try {\n    app('queue.failer')->log('cloud', $queue, $payload, $e);\n} catch (\\RuntimeException $ex) {\n    if (str_contains($ex->getMessage(), 'does not have a configured queue')) {\n        // log to a fallback store and alert — cloud failed-job wiring is broken\n        report($ex);\n    } else {\n        throw $ex;\n    }\n}","preventionTips":["Do not override queue.failer without re-injecting the Cloud Queue dependency.","Run a CI smoke test that dispatches + fails a job on the cloud connection.","Outside Cloud, never use the 'cloud' queue connection."],"tags":["laravel-cloud","queue","failed-jobs","configuration","dependency-injection"],"analyzedSha":"bd6b5437e6ad87bb49f9b426724f07a9f64e9683","analyzedAt":"2026-08-06T00:28:32.783Z","schemaVersion":2}