{"record":{"id":"1c586be022fdc93e","repo":"coollabsio/coolify","slug":"scheduledtaskjob-failed-more-than-one-container-e","errorCode":null,"errorMessage":"ScheduledTaskJob failed: More than one container exists but no container name was provided.","messagePattern":"ScheduledTaskJob failed: More than one container exists but no container name was provided\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"app/Jobs/ScheduledTaskJob.php","lineNumber":145,"sourceCode":"                }\n            } elseif ($this->resource->type() === 'service') {\n                $this->resource->applications()->get()->each(function ($application) {\n                    if (str(data_get($application, 'status'))->contains('running')) {\n                        $this->containers[] = data_get($application, 'name').'-'.data_get($this->resource, 'uuid');\n                    }\n                });\n                $this->resource->databases()->get()->each(function ($database) {\n                    if (str(data_get($database, 'status'))->contains('running')) {\n                        $this->containers[] = data_get($database, 'name').'-'.data_get($this->resource, 'uuid');\n                    }\n                });\n            }\n            if (count($this->containers) == 0) {\n                throw new \\Exception('ScheduledTaskJob failed: No containers running.');\n            }\n\n            if (count($this->containers) > 1 && empty($this->task->container)) {\n                throw new \\Exception('ScheduledTaskJob failed: More than one container exists but no container name was provided.');\n            }\n\n            foreach ($this->containers as $containerName) {\n                if (count($this->containers) == 1 || str_starts_with($containerName, $this->task->container.'-'.$this->resource->uuid)) {\n                    $cmd = \"sh -c '\".str_replace(\"'\", \"'\\''\", $this->task->command).\"'\";\n                    $exec = \"docker exec {$containerName} {$cmd}\";\n                    // Disable SSH multiplexing to prevent race conditions when multiple tasks run concurrently\n                    // See: https://github.com/coollabsio/coolify/issues/6736\n                    $this->task_output = instant_remote_process([$exec], $this->server, true, false, $this->timeout, disableMultiplexing: true);\n                    $this->task_log->update([\n                        'status' => 'success',\n                        'message' => $this->task_output,\n                    ]);\n\n                    $this->team?->notify(new TaskSuccess($this->task, $this->task_output));\n\n                    return;\n                }","sourceCodeStart":127,"sourceCodeEnd":163,"githubUrl":"https://github.com/coollabsio/coolify/blob/70b9acc42467278373e00de77abb40684e25b395/app/Jobs/ScheduledTaskJob.php#L127-L163","documentation":"Error \"ScheduledTaskJob failed: More than one container exists but no container name was provided.\" thrown in coollabsio/coolify.","triggerScenarios":"Thrown at app/Jobs/ScheduledTaskJob.php:145 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"70b9acc42467278373e00de77abb40684e25b395","analyzedAt":"2026-08-17T01:41:01.313Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}