nextcloud / nextcloud/nextcloudpi
Error after nextcloud update : error stack in a sourced file
Nobody has claimed this yet.
- Dominant language
- Shell
- Stars
- 2.9k
- Forks
- 318
- PR merge metrics
- No merged PRs in 30d
Description
Hello folks,
After upgrading NCP to the lasest version (1.52.4), we've got a funny error at every bash startup :
bash: Your: command not found
bash: Permissions: command not found
bash: An: command not found
bash: Exception:: command not found
bash: Stack: command not found
Actually it was because the file /usr/share/bash-completion/completions/ncp had been replaced with an error stack :
$ cat /usr/share/bash-completion/completions/ncp
Your data directory is not writable.
Permissions can usually be fixed by giving the web server write access to the root directory. See https://docs.nextcloud.com/server/26/go.php?to=admin-dir_permissions.
An unhandled exception has been thrown:
Exception: Environment not properly prepared. in /var/www/nextcloud/lib/private/Console/Application.php:167
Stack trace:
#0 /var/www/nextcloud/console.php(99): OC\Console\Application->loadCommands()
#1 ncc(11): require_once('...')
#2 {main}
The update was run without the data HD connected (my bad), but still, quite weird to find an error stack in my nextcloud server files, and the resulting bash error might bewild most beginner users.
P.S. : where can I find the proper content of this file to restore it ?
P.S.2 : I find this bug actually quite dangerous for the system, since a line of the stack error could be an actually valid command, which would have been sourced with root permissions ...
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by examining how the NextcloudPi 1.52.4 update handles /usr/share/bash-completion/completions/ncp when the data disk is disconnected. Reproduce that condition and verify that the completion file is not replaced with the displayed exception text; done means a normal bash startup produces no command-not-found errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- bash
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100