{"record":{"id":"4d6b819afa4851de","repo":"coollabsio/coolify","slug":"axiom-log-drain-is-not-enabled","errorCode":null,"errorMessage":"Axiom log drain is not enabled.","messagePattern":"Axiom log drain is not enabled\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"warning","filePath":"app/Actions/Server/StartLogDrain.php","lineNumber":92,"sourceCode":"[SERVICE]\n    Flush     5\n    Daemon    off\n    Log_Level debug\n    Parsers_File  parsers.conf\n[INPUT]\n    Name              forward\n    tag               ${HIGHLIGHT_PROJECT_ID}\n    Buffer_Chunk_Size 1M\n    Buffer_Max_Size   6M\n[OUTPUT]\n    Name                forward\n    Match               *\n    Host                otel.highlight.io\n    Port                24224\n');\n            } elseif ($type === 'axiom') {\n                if (! $server->settings->is_logdrain_axiom_enabled) {\n                    throw new \\Exception('Axiom log drain is not enabled.');\n                }\n                $config = base64_encode(\"\n[SERVICE]\n    Flush     5\n    Daemon    off\n    Log_Level debug\n    Parsers_File  parsers.conf\n[INPUT]\n    Name              forward\n    Buffer_Chunk_Size 1M\n    Buffer_Max_Size   6M\n[FILTER]\n    Name grep\n    Match *\n    Exclude log 127.0.0.1\n[FILTER]\n    Name                modify\n    Match               *","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/coollabsio/coolify/blob/70b9acc42467278373e00de77abb40684e25b395/app/Actions/Server/StartLogDrain.php#L74-L110","documentation":"Third instance of the defensive double-check: $type === 'axiom' implies is_logdrain_axiom_enabled was true seconds earlier when the type was computed at the top of handle(). The inner re-check can only fail through a concurrent settings mutation/refresh race; when it fires, the Axiom Fluent Bit config (HTTP ingest to /v1/datasets/{AXIOM_DATASET_NAME}/ingest) is never generated.","triggerScenarios":"A concurrent save of ServerSettings flips is_logdrain_axiom_enabled (or AXIOM_DATASET_NAME/API key) while the drain start job runs and the model relation refreshes.","commonSituations":"Reconfiguring Axiom logging while a restart is in flight; automation racing UI changes.","solutions":["Re-run StartLogDrain after the concurrent change completes.","Keep dataset name, API key and enable flag in a single atomic settings update.","Pause log-drain jobs while migrating logging providers."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (! $server->settings->is_logdrain_axiom_enabled) {\n    return 'Enable the Axiom log drain (dataset + API key) before starting it.';\n}\nStartLogDrain::run($server);","typeGuard":"function activeLogDrainType(\\App\\Models\\Server $server): string\n{\n    $s = $server->settings;\n    if ($s->is_logdrain_newrelic_enabled) { return 'newrelic'; }\n    if ($s->is_logdrain_highlight_enabled) { return 'highlight'; }\n    if ($s->is_logdrain_axiom_enabled) { return 'axiom'; }\n    if ($s->is_logdrain_custom_enabled) { return 'custom'; }\n    return 'none';\n}","tryCatchPattern":"try {\n    StartLogDrain::run($server);\n} catch (\\Exception $e) {\n    if (str_contains($e->getMessage(), 'log drain is not enabled')) {\n        StartLogDrain::run($server->refresh());\n    } else {\n        throw $e;\n    }\n}","preventionTips":["Save AXIOM_DATASET_NAME, AXIOM_API_KEY and the enable flag atomically.","Don't reconfigure Axiom settings while a drain start/stop job is in the 'high' queue.","Pre-check with $server->isLogDrainEnabled() before showing 'Start Log Drain' actions."],"tags":["log-drain","axiom","fluent-bit","race-condition","settings"],"backgroundTag":"log-drain-not-configured","analyzedSha":"70b9acc42467278373e00de77abb40684e25b395","analyzedAt":"2026-08-17T01:41:01.313Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}