coollabsio/coolify · error · Exception

Invalid Cron / Human expression for Disk Usage Check Frequen

Error message

Invalid Cron / Human expression for Disk Usage Check Frequency.

What it means

The server Advanced screen's submit() validates serverDiskUsageCheckFrequency with validate_cron_expression() (cron-parser CronExpression::isValid() plus the VALID_CRON_STRINGS human presets). On failure the field is reset to the original DB value via getOriginal() and the exception surfaces through handleError - nothing is persisted.

Source

Thrown at app/Livewire/Server/Advanced.php:82

        }
    }

    public function instantSave()
    {
        try {
            $this->syncData(true);
            $this->dispatch('success', 'Server updated.');
        } catch (\Throwable $e) {
            return handleError($e, $this);
        }
    }

    public function submit()
    {
        try {
            if (! validate_cron_expression($this->serverDiskUsageCheckFrequency)) {
                $this->serverDiskUsageCheckFrequency = $this->server->settings->getOriginal('server_disk_usage_check_frequency');
                throw new \Exception('Invalid Cron / Human expression for Disk Usage Check Frequency.');
            }
            $this->syncData(true);
            $this->dispatch('success', 'Server updated.');
        } catch (\Throwable $e) {
            return handleError($e, $this);
        }
    }

    public function render()
    {
        return view('livewire.server.advanced');
    }
}

View on GitHub (pinned to 70b9acc424)

Solutions

  1. Enter a valid 5-field cron, e.g. '*/5 * * * *'
  2. Or an exact Coolify preset string like 'every_minute' (no free-form phrasing)
  3. Trim stray whitespace/quotes before saving
  4. Test first: php artisan tinker --execute 'var_dump(validate_cron_expression("*/5 * * * *"));'

Example fix

// before
$this->serverDiskUsageCheckFrequency = 'every 5 minutes';

// after
$this->serverDiskUsageCheckFrequency = '*/5 * * * *';
Defensive patterns

Strategy: validation

Validate before calling

if (! validate_cron_expression($this->serverDiskUsageCheckFrequency)) {
    // fix the expression before submit; stored value is untouched
}

Try / catch

Keep submit()'s try/catch with return handleError($e, $this); the component already restores the original DB value on failure - rely on that instead of persisting partial settings.

Prevention

When it happens

Trigger: Typing an invalid frequency such as 'every 5 minutes', a 6-field cron, '*/2 * * *' (missing a field), or a preset key that does not exist in VALID_CRON_STRINGS; pasting a crontab line that includes the username column.

Common situations: Users used to systemd timer calendars or Quartz expressions; copy-paste from blog cron examples; typos in the human presets.

Related errors


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