{"record":{"id":"c4d85248d21150a8","repo":"coollabsio/coolify","slug":"a-target-instance-api-token-is-required-root-or-w","errorCode":null,"errorMessage":"A target instance API token is required (root or write + create servers).","messagePattern":"A target instance API token is required \\(root or write \\+ create servers\\)\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"app/Services/ServerTransfer/ServerTransferMigrator.php","lineNumber":120,"sourceCode":"        if (file_exists('/.dockerenv') || is_file('/run/.containerenv')) {\n            $targetUrl = (string) preg_replace(\n                '#^(https?://)(localhost|127\\.0\\.0\\.1)(?=[:/]|$)#i',\n                '$1host.docker.internal',\n                $targetUrl\n            );\n        }\n\n        return $targetUrl;\n    }\n\n    private function normalizeToken(string $targetToken): string\n    {\n        $token = trim($targetToken);\n        if (str_starts_with(strtolower($token), 'bearer ')) {\n            $token = trim(substr($token, 7));\n        }\n        if ($token === '') {\n            throw new RuntimeException('A target instance API token is required (root or write + create servers).');\n        }\n\n        return $token;\n    }\n\n    /**\n     * @param  array<string, mixed>  $bundle\n     * @return array<string, mixed>\n     */\n    private function postImportToTarget(\n        string $targetUrl,\n        string $token,\n        array $bundle,\n        bool $writeRemote,\n        bool $rebindSentinel,\n        bool $preserveUuids,\n        bool $adoptMode,\n    ): array {","sourceCodeStart":102,"sourceCodeEnd":138,"githubUrl":"https://github.com/coollabsio/coolify/blob/70b9acc42467278373e00de77abb40684e25b395/app/Services/ServerTransfer/ServerTransferMigrator.php#L102-L138","documentation":"Error \"A target instance API token is required (root or write + create servers).\" thrown in coollabsio/coolify.","triggerScenarios":"Thrown at app/Services/ServerTransfer/ServerTransferMigrator.php:120 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"}