nextcloud / nextcloudpi

📦 Build code for NextcloudPi: Raspberry Pi, Odroid, Rock64, curl installer...
https://nextcloudpi.com
2.49k stars 295 forks source link

Error after nextcloud update : error stack in a sourced file #1820

Open Ghriann opened 1 year ago

Ghriann commented 1 year ago

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 ...