Skip to content

php artisan register:app fails: "There are no commands defined in the "register" namespace" #1606

Description

@HK-Moebius

Registering a private app as described in the Heimdall-Apps wiki no longer works. The command exists in app/Console/Commands/RegisterApp.php, but artisan does not know it.

Steps to reproduce

  1. Put a private app folder, e.g. MyApp, into SupportedApps.
  2. Run:
    docker exec -it heimdall php /app/www/artisan register:app MyApp
    

Expected behaviour

Application Added - MyApp - <appid>

Actual behaviour

ERROR  There are no commands defined in the "register" namespace.

php artisan list does not show register:app either.

Cause

Since the move to the new Laravel application structure, bootstrap/app.php only passes the console routes file to withRouting():

->withRouting(
    ...
    commands: __DIR__.'/../routes/console.php',
    ...
)

withRouting() then calls withCommands([routes/console.php]). Because that array is not empty, ApplicationBuilder::withCommands() does not add its default path app/Console/Commands. As a result, RegisterApp is never discovered.

Suggested fix

Register the commands directory explicitly in bootstrap/app.php, for example:

->withCommands([
    __DIR__.'/../app/Console/Commands',
])

Workaround

Until this is fixed, the command can be registered and run manually:

docker exec -i heimdall sh -c 'cat > /tmp/register.php' <<'PHP'
<?php
require '/app/www/vendor/autoload.php';
$app = require '/app/www/bootstrap/app.php';
$kernel = $app->make(Illuminate\Contracts\Console\Kernel::class);
$kernel->bootstrap();
$kernel->registerCommand($app->make(App\Console\Commands\RegisterApp::class));
$kernel->call('register:app', ['folder' => 'MyApp']);
echo $kernel->output();
PHP
docker exec -it -u abc heimdall php /tmp/register.php

Environment

  • Heimdall version: 2.8.3
  • Installation: linuxserver/heimdall Docker image on Unraid

Activity

  1. moved this to Non-Docker Issues in Issue & PR Trackeron Sep 16, 2026
  2. changed the title [-]php artisan register:app fails: "There are no commands defined in the \"register\" namespace"[/-] [+]php artisan register:app fails: "There are no commands defined in the "register" namespace"[/+] on Sep 16, 2026
  3. KodeStar commented on Oct 3, 2026

    @KodeStar
    Member

    Thanks for the detailed report. Reproduced in the 2.8.3 image, fix is in #1607.

    The cause turned out to be slightly different from the withRouting() one: Application::configure() already adds app/Console/Commands, but only once providers have finished booting. On startup Heimdall checks for public/storage/.gitignore and runs storage:link if it is missing. The Docker image does not ship that file, so storage:link ran on every start, and calling Artisan during provider boot locks in the command list before app/Console/Commands is added. So explicitly adding the path in bootstrap/app.php would not have helped either.

    Until the fix is released, a simpler workaround than the script is to create that file once in the container:

    docker exec -it -u abc heimdall touch /app/www/storage/app/public/.gitignore
    docker exec -it -u abc heimdall php /app/www/artisan register:app MyApp
    

    (It lives inside the container, so it needs redoing if the container is recreated.)

  4. moved this from Non-Docker Issues to Done in Issue & PR Trackeron Oct 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions