Contexte
During the initialization phase, if no configuration exists, the code attempts to open /index.json
. The error is not caught and the operation fails silently.
Description
This issue is located in the initBackend
function within cmd/root.go
. The error is reported by the PackageSource.InitialInstallCommands
function. When the error is caught, it outputs:
Failed to initialize package source default: install failed for the following reasons: [cannot get remote packages: open /index.json: no such file or directory]
However, this error is not caught and the return code remains 0.
The underlying cause is that the error only happens if RemoteBaseURL
is not initialized in the command-launcher config, leading to a missing remote URL during init.
Suggested Fix
- Detect when the command-launcher config remote URL (
RemoteBaseURL
) is not initialized and prevent running initial install.
- Catch and handle errors during initialization and provide a clear, user-friendly error message.