coollabsio/coolify · warning · Exception

Highlight log drain is not enabled.

Error message

Highlight log drain is not enabled.

What it means

Same defensive pattern as the New Relic guard: $type === 'highlight' was decided by is_logdrain_highlight_enabled at the top of StartLogDrain::handle(), so this inner re-check of the identical flag is an invariant assertion. It can only fire if the settings relation changes underneath the running action (concurrent save + refresh). Aborts before the Highlight Fluent Bit config (forward output to otel.highlight.io:24224) is written.

Source

Thrown at app/Actions/Server/StartLogDrain.php:71

[FILTER]
    Name                modify
    Match               *
    Set                 coolify.server_name {$server->name}
    Rename              COOLIFY_APP_NAME coolify.app_name
    Rename              COOLIFY_PROJECT_NAME coolify.project_name
    Rename              COOLIFY_SERVER_IP coolify.server_ip
    Rename              COOLIFY_ENVIRONMENT_NAME coolify.environment_name
[OUTPUT]
    Name nrlogs
    Match *
    license_key \${LICENSE_KEY}
    # https://log-api.eu.newrelic.com/log/v1 - EU
    # https://log-api.newrelic.com/log/v1 - US
    base_uri \${BASE_URI}
");
            } elseif ($type === 'highlight') {
                if (! $server->settings->is_logdrain_highlight_enabled) {
                    throw new \Exception('Highlight log drain is not enabled.');
                }
                $config = base64_encode('
[SERVICE]
    Flush     5
    Daemon    off
    Log_Level debug
    Parsers_File  parsers.conf
[INPUT]
    Name              forward
    tag               ${HIGHLIGHT_PROJECT_ID}
    Buffer_Chunk_Size 1M
    Buffer_Max_Size   6M
[OUTPUT]
    Name                forward
    Match               *
    Host                otel.highlight.io
    Port                24224
');

View on GitHub (pinned to 70b9acc424)

Solutions

  1. Re-run StartLogDrain once the settings are stable.
  2. Apply settings changes while no drain start/stop job is queued.
  3. Ensure HIGHLIGHT_PROJECT_ID and the enable flag are saved together in one request.
Defensive patterns

Strategy: validation

Validate before calling

if (! $server->settings->is_logdrain_highlight_enabled) {
    return 'Enable the Highlight log drain (and set HIGHLIGHT_PROJECT_ID) before starting it.';
}
StartLogDrain::run($server);

Type guard

function activeLogDrainType(\App\Models\Server $server): string
{
    $s = $server->settings;
    if ($s->is_logdrain_newrelic_enabled) { return 'newrelic'; }
    if ($s->is_logdrain_highlight_enabled) { return 'highlight'; }
    if ($s->is_logdrain_axiom_enabled) { return 'axiom'; }
    if ($s->is_logdrain_custom_enabled) { return 'custom'; }
    return 'none';
}

Try / catch

try {
    StartLogDrain::run($server);
} catch (\Exception $e) {
    if (str_contains($e->getMessage(), 'log drain is not enabled')) {
        StartLogDrain::run($server->refresh()); // settings changed mid-flight; retry once
    } else {
        throw $e;
    }
}

Prevention

When it happens

Trigger: Concurrent modification of the server's Highlight log-drain settings while the StartLogDrain job executes; programmatic calls passing a Server model whose settings were mutated mid-action.

Common situations: Multiple UI sessions or scripts reconfiguring log drains simultaneously with a queued restart.

Related errors


AI-assisted analysis of coollabsio/coolify@70b9acc424 (2026-08-17). Data as JSON: /api/errors/29e8d4d35040cafa. Report an issue: GitHub.