octobercms/october · warning · ApplicationException
There are no commands defined in the "util" namespace.
Error message
There are no commands defined in the "util" namespace.
What it means
The october:util console command (class OctoberUtil) dispatches to util* methods on itself and its traits (method = 'util' . studly_case(imploded name)). Invoked with no name argument, handle() throws an ApplicationException shaped like Symfony's 'no commands defined in the namespace' error and appends every available utility name, built from util* methods (e.g. october:util compile assets, october:util purge uploads, october:util set build).
Source
Thrown at modules/system/console/OctoberUtil.php:77
* Execute the console command.
*/
public function handle()
{
$command = implode(' ', (array) $this->argument('name'));
$method = str_replace('.', 'Point', 'util'.studly_case($command));
$list = $this->getAvailableCommands();
if (!$this->argument('name')) {
$message = 'There are no commands defined in the "util" namespace.';
if (count($list) === 1) {
$message .= "\n\nDid you mean this?\n ";
}
else {
$message .= "\n\nDid you mean one of these?\n ";
}
$message .= implode("\n ", $list);
throw new ApplicationException($message);
}
if (!method_exists($this, $method)) {
$this->error(sprintf('Utility command "%s" does not exist!', $command));
return;
}
$this->$method();
}
/**
* getAvailableCommands
*/
protected function getAvailableCommands(): array
{
$methods = preg_grep('/^util/', get_class_methods(get_called_class()));
$list = array_map(function ($item) {
if (str_starts_with($item, 'utilPatch')) {View on GitHub (pinned to b608633a7e)
Solutions
- Re-run with a utility name — copy one from the 'Did you mean one of these?' list the exception itself prints
- Pin the exact subcommand in scripts, e.g. php artisan october:util set build 420
- Discover valid names with php artisan list october or by reading the util* methods in modules/system/console/OctoberUtilCommands.php
Example fix
# before php artisan october:util # after (pick a name from the list printed by the error) php artisan october:util compile assets
Defensive patterns
Strategy: validation
Validate before calling
#!/usr/bin/env bash
# guard scripts before invoking the utility
[ $# -ge 1 ] || { echo 'usage: php artisan october:util <name>'; exit 1; }
php artisan october:util "$@" Prevention
- Always pass an explicit subcommand in scripts and cron entries
- Run php artisan list october to see valid util commands
- Pin utility commands in deployment docs so copy-paste errors surface early
When it happens
Trigger: Running `php artisan october:util` (or the `util` alias) with zero arguments; a deploy script or cron entry invoking october:util without a subcommand.
Common situations: A CI/deploy script copied from docs with the subcommand accidentally removed; developers expecting the bare command to print help.
Related errors
- [{$importFile}] {message}
- Media tags can only be processed for front-end requests.
- [!!] Missing key for english [{$key}] in [{$englishPath}]
AI-assisted analysis of octobercms/october@b608633a7e (2026-08-21).
Data as JSON: /api/errors/b3ae3ad21a8ba212.
Report an issue: GitHub.