hevelius / files_external_onedrive

:mega: :floppy_disk: External storage support for Microsoft OneDrive
GNU General Public License v2.0
72 stars 22 forks source link

Help I installed a OneDrive addon, and now it broke my nextcloud instance #48

Closed hiro5id closed 3 years ago

hiro5id commented 3 years ago

I installed a OneDrive addon, and now it broke my nextcloud instance. I am using nextcloud v20.0.4

when I access my server I get 500 responses in browser. On server side I see these logs:

192.168.64.2 - - [29/Dec/2020:03:39:53 +0000] "GET / HTTP/1.1" 500 425 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36"
192.168.64.2 - - [29/Dec/2020:03:39:58 +0000] "GET / HTTP/1.1" 500 425 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36"
192.168.64.2 - - [29/Dec/2020:04:19:05 +0000] "GET / HTTP/1.1" 500 425 "-" "-"

Then I thought, since I can't use the UI to disable the addon, maybe I can do it via command line.

I tried: php -f occ app:disable files_external_onedrive

but that gives error:

An unhandled exception has been thrown:
Error: Interface 'OCA\Files_External\Lib\Config\IBackendProvider' not found in /var/www/html/custom_apps/files_external_onedrive/lib/AppInfo/Application.php:38
Stack trace:
#0 /var/www/html/lib/composer/composer/ClassLoader.php(444): include()
#1 /var/www/html/lib/composer/composer/ClassLoader.php(322): Composer\Autoload\includeFile('/var/www/html/c...')
#2 [internal function]: Composer\Autoload\ClassLoader->loadClass('OCA\\Files_exter...')
#3 [internal function]: spl_autoload_call('OCA\\Files_exter...')
#4 /var/www/html/lib/private/AppFramework/Bootstrap/Coordinator.php(108): class_exists('OCA\\Files_exter...')
#5 /var/www/html/lib/base.php(644): OC\AppFramework\Bootstrap\Coordinator->runRegistration()
#6 /var/www/html/lib/base.php(1091): OC::init()
#7 /var/www/html/console.php(49): require_once('/var/www/html/l...')
#8 /var/www/html/occ(11): require_once('/var/www/html/c...')

I also tried php -f occ app:disable files_external that gives

An unhandled exception has been thrown:
Error: Interface 'OCA\Files_External\Lib\Config\IBackendProvider' not found in /var/www/html/custom_apps/files_external_onedrive/lib/AppInfo/Application.php:38
Stack trace:
#0 /var/www/html/lib/composer/composer/ClassLoader.php(444): include()
#1 /var/www/html/lib/composer/composer/ClassLoader.php(322): Composer\Autoload\includeFile('/var/www/html/c...')
#2 [internal function]: Composer\Autoload\ClassLoader->loadClass('OCA\\Files_exter...')
#3 [internal function]: spl_autoload_call('OCA\\Files_exter...')
#4 /var/www/html/lib/private/AppFramework/Bootstrap/Coordinator.php(108): class_exists('OCA\\Files_exter...')
#5 /var/www/html/lib/base.php(644): OC\AppFramework\Bootstrap\Coordinator->runRegistration()
#6 /var/www/html/lib/base.php(1091): OC::init()
#7 /var/www/html/console.php(49): require_once('/var/www/html/l...')
#8 /var/www/html/occ(11): require_once('/var/www/html/c...')
#9 {main}

So i'm stuck with a bricked nextcloud instance because of this addon :(

I really shouldn't be able to break the whole thing due to a faulty addon.

No matter, at this point I just want to remove the addon and get back functionality of the server. I don't know how to remove it manually.

Can anyone help me get unstuck?

hevelius commented 3 years ago

Try to delete the directory files_external_onedrive in apps. Could you to write some info of you environment? (e.g. O.S. apache/nginx version etc...)

hiro5id commented 3 years ago

Ah thanks! So messing around with it, I ended up recovering. I explained in the nextcloud forum how I fixed it. I am posting here for completeness: https://help.nextcloud.com/t/help-i-installed-a-onedrive-addon-and-now-it-broke-my-nextcloud-instance/102606/12?u=hiro5id

My environment is a Docker. I'm actually running the official docker container: https://hub.docker.com/_/nextcloud

hiro5id commented 3 years ago

I also discovered why it broke the server in the first place.

It's because I didn't have the external_storages app enabled when I clicked "download & enable" for this OneDrive addon through the Nextcloud GUI. It was only after reading the readme in this Github that I realized that must be what the problem was.

But by then it was too late because the whole GUI was broken, I couldn't log in or anything. I could only SSH into the server. Being rather new to Nextcloud, not understanding how the folder structure works for addons, I was fairly lost. But through tips and talking on the forum I came to my senses and stumbled through a solution by renaming folders and got everything back.

Now that I recovered the server, I re-installed everything, while having the external_sotrages app enabled and it appears to work.

hevelius commented 3 years ago

Ok @hiro5id, I'm working to a solution to prevent installation if required module is not enabled. Solution in next release.

hiro5id commented 3 years ago

Thanks. And, also, I got it to work finally! But I lost a lot of time spinning my wheels because I didn't interpret the instructions correctly. I created a pull request to improve the setup instructions in the areas I got tripped up on: https://github.com/hevelius/files_external_onedrive/pull/49