{"record":{"id":"5874e9e4ddd941ed","repo":"coollabsio/coolify","slug":"configuration-is-not-synced","errorCode":null,"errorMessage":"Configuration is not synced","messagePattern":"Configuration is not synced","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"app/Actions/Proxy/StartProxy.php","lineNumber":34,"sourceCode":"    public function handle(Server $server, bool $async = true, bool $force = false, bool $restarting = false): string|Activity\n    {\n        $proxyType = $server->proxyType();\n        if ((is_null($proxyType) || $proxyType === 'NONE' || $server->proxy->force_stop || $server->isBuildServer()) && $force === false) {\n            return 'OK';\n        }\n        $server->proxy->set('status', 'starting');\n        $server->save();\n        $server->refresh();\n\n        if (! $restarting) {\n            ProxyStatusChangedUI::dispatch($server->team_id);\n        }\n\n        $commands = collect([]);\n        $proxy_path = $server->proxyPath();\n        $configuration = GetProxyConfiguration::run($server);\n        if (! $configuration) {\n            throw new \\Exception('Configuration is not synced');\n        }\n        SaveProxyConfiguration::run($server, $configuration);\n        $docker_compose_yml_base64 = base64_encode($configuration);\n        $server->proxy->last_applied_settings = str($docker_compose_yml_base64)->pipe('md5')->value();\n        $server->save();\n\n        if ($server->isSwarmManager()) {\n            $commands = $commands->merge([\n                \"mkdir -p $proxy_path/dynamic\",\n                \"cd $proxy_path\",\n                \"echo 'Creating required Docker Compose file.'\",\n                \"echo 'Starting coolify-proxy.'\",\n                'docker stack deploy --detach=true -c docker-compose.yml coolify-proxy',\n                \"echo 'Successfully started coolify-proxy.'\",\n            ]);\n        } else {\n            if (isDev()) {\n                if ($proxyType === ProxyTypes::CADDY->value) {","sourceCodeStart":16,"sourceCodeEnd":52,"githubUrl":"https://github.com/coollabsio/coolify/blob/70b9acc42467278373e00de77abb40684e25b395/app/Actions/Proxy/StartProxy.php#L16-L52","documentation":"\\Exception from StartProxy when GetProxyConfiguration::run($server) returns a falsy configuration before saving it to the server. It guards the invariant that the proxy's docker-compose YAML must exist and be non-empty before base64/md5 stamping and remote execution. In practice GetProxyConfiguration already throws its own exception on empty output, so reaching this branch usually indicates an empty-string (not null) return or an older/custom fork where the two actions drifted apart.","triggerScenarios":"Starting/restarting coolify-proxy while the stored configuration is missing or regeneration produced an empty string (proxy type misconfigured as CUSTOM/NONE with a leftover start action); race where another process writes proxy settings mid-start; code paths returning '' instead of throwing.","commonSituations":"First proxy start on a freshly added server whose proxy was never initialized; after switching proxy types back and forth; corrupted proxy_path on the server (empty docker-compose.yaml); concurrent UI actions triggering StartProxy twice.","solutions":["Open Server -> Proxy, re-select the proxy type (Traefik/Caddy) and save so a valid configuration is generated, then start again.","Run CheckProxy::run($server, false) first and only call StartProxy when it returns true.","Inspect the proxy config directory on the server (proxyPath()) and delete the empty file so regeneration writes a full default."],"exampleFix":"// before\n$configuration = GetProxyConfiguration::run($server);\nif (! $configuration) {\n    throw new \\Exception('Configuration is not synced');\n}\n\n// after (regenerate deterministically before failing)\n$configuration = GetProxyConfiguration::run($server, forceRegenerate: true);\nif (! $configuration) {\n    throw new \\Exception('Configuration is not synced');\n}","handlingStrategy":"validation","validationCode":"if (! $server->isProxyShouldRun()) {\n    return; // don't attempt StartProxy\n}\n// ensure a fresh configuration exists before starting\n$config = GetProxyConfiguration::run($server, forceRegenerate: true);\nif (empty($config)) {\n    // regenerate failed; fix proxy settings instead of starting\n    return;\n}","typeGuard":null,"tryCatchPattern":"try {\n    StartProxy::run($server);\n} catch (\\Exception $e) {\n    if ($e->getMessage() === 'Configuration is not synced') {\n        GetProxyConfiguration::run($server, forceRegenerate: true);\n        StartProxy::run($server); // one deliberate retry after regen\n    } else {\n        throw $e;\n    }\n}","preventionTips":["Run CheckProxy before StartProxy in automation and abort on false.","Initialize the proxy (choose type + save) immediately after adding a server.","Avoid concurrent proxy start actions; serialize them per server."],"tags":["proxy","configuration","sync","traefik"],"backgroundTag":"configuration-not-synced","analyzedSha":"70b9acc42467278373e00de77abb40684e25b395","analyzedAt":"2026-08-17T01:41:01.313Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}