coollabsio/coolify · error · Exception
Invalid Cron / Human expression.
Error message
Invalid Cron / Human expression.
What it means
syncData(toModel: true) on the scheduled-task screen validates the frequency field with validate_cron_expression(), which wraps cron-parser's CronExpression::isValid() plus a lookup in the VALID_CRON_STRINGS human-friendly map (keys like every_minute). When validation fails the field is reverted to the task's stored frequency and the save is aborted with this exception.
Source
Thrown at app/Livewire/Project/Shared/ScheduledTask/Show.php:95
'application_uuid' => $application_uuid,
'service_uuid' => $service_uuid,
];
$this->task = $this->resource->scheduled_tasks()->where('uuid', $task_uuid)->firstOrFail();
$this->syncData();
} catch (\Exception $e) {
return handleError($e);
}
}
public function syncData(bool $toModel = false)
{
if ($toModel) {
$this->validate();
$isValid = validate_cron_expression($this->frequency);
if (! $isValid) {
$this->frequency = $this->task->frequency;
throw new \Exception('Invalid Cron / Human expression.');
}
$this->task->enabled = $this->isEnabled;
$this->task->name = str($this->name)->trim()->value();
$this->task->command = str($this->command)->trim()->value();
$this->task->frequency = str($this->frequency)->trim()->value();
$this->task->container = str($this->container)->trim()->value();
$this->task->timeout = (int) $this->timeout;
$this->task->save();
} else {
$this->isEnabled = $this->task->enabled;
$this->name = $this->task->name;
$this->command = $this->task->command;
$this->frequency = $this->task->frequency;
$this->container = $this->task->container;
$this->timeout = $this->task->timeout ?? 300;
}
}
View on GitHub (pinned to 70b9acc424)
Solutions
- Use a standard 5-field cron expression: minute hour day-of-month month day-of-week, e.g. '*/5 * * * *'
- Or use one of Coolify's exact human strings such as every_minute (match the preset keys, no free-form English)
- Re-copy the value from the UI frequency picker instead of typing manually
- Sanity-check the expression with the same library: php artisan tinker --execute 'var_dump(validate_cron_expression("*/5 * * * *"));'
Example fix
// before $this->frequency = 'every 5 minutes'; // after $this->frequency = '*/5 * * * *'; // or an exact preset key like 'every_minute'
Defensive patterns
Strategy: validation
Validate before calling
if (! validate_cron_expression($frequency)) {
return 'Invalid Cron / Human expression.'; // fix input before syncData(true)
} Try / catch
Wrap syncData(true) in try { } catch (\Exception $e) { return handleError($e, $this); } as the component does; re-display the reverted (stored) frequency so the user sees the canonical value. Prevention
- Restrict input to the UI frequency picker or validated presets
- Remember the accepted format: 5-field cron or exact VALID_CRON_STRINGS keys
- Trim and reject 6-field/username-carrying crontab lines before submit
When it happens
Trigger: Entering a malformed 5-field cron (e.g. '*/2 * * *' with only 4 fields), a 6-field seconds-based cron, a human string not in VALID_CRON_STRINGS (e.g. 'every 5 minutes' or 'every minut'), or a copy-pasted crontab line that includes the username column.
Common situations: Copying crontab entries from tutorials (which often include the user field); using Jenkins/Quartz-style 6-field expressions; typos in the human-readable presets; trailing whitespace or smart quotes from pasting.
Related errors
- Invalid Cron / Human expression
- Invalid Cron / Human expression for Disk Usage Check Frequen
- Invalid Cron / Human expression for Docker Cleanup Frequency
- This server was transferred to another Coolify instance and
- Unknown notification channel [{$channel}].
AI-assisted analysis of coollabsio/coolify@70b9acc424 (2026-08-17).
Data as JSON: /api/errors/a798b812d7dde934.
Report an issue: GitHub.