On new install of NC 13.0.2.1 cannot run OCC app:disable of broken app that causes PHP Fatal error

For a few hours I had a fully working Nextcloud system running, tested and customised on new hardware with Ubuntu 18.04, PHP 7.2, Apache2 2.4.29, MariaDB 10.1. Then I went and broke itā€¦!
I had installed the ā€œfiles_external_gdriveā€ app with the intention of trying it out. However, I think when I later ā€œdisabledā€ the official ā€œfiles_externalā€ app, this brought Nextcloud crashing down.

[Thu May 31 13:54:52.088060 2018] [php7:error] [pid 12937] [client 127.0.0.1:55508] PHP Fatal error: Interface ā€˜OCA\Files_External\Lib\Config\IBackendProviderā€™ not found in /var/www/nextcloud/apps/files_external_gdrive/lib/AppInfo/Application.php on line 32

I now needed to use the command-line ā€œOCCā€ function to disable the broken Google_Drive app. As I am not experienced with this feature I had to research the docs but it did appear straight forward. Yet it wasnā€™tā€¦

PHP cannot open the OCC script in /var/www/nextcloud and I cannot make out why. Permissions are fine and owner:group is ā€œwww-dataā€. I have not touched (deliberately) the .htaccess file as itā€™s beyond my brain-power.

My Terminal command attempt is:
sysadmin@Nextcloud-Server-0:~$ sudo -u www-data php occ app:disable files_external_gdrive disabled
[sudo] password for sysadmin:
Could not open input file: occ

PHP has a CLI operation that might be relevant to my problem but it is all ā€œsmoke & mirrorsā€ that has me completely baffled.

Any assistance or guidance would be greatly appreciated.
Pete

I tend to use the full path when running occ, for this reason. You appear to be in your userā€™s home directory, so of course PHP canā€™t find occ in that working directory. I always provide the full path so it doesnā€™t matter where I am currently:
sudo -u www-data php /var/www/nextcloud/occ app:disable files_external_gdrive

Thanks, that has shown some progress. This is a new area for me to dabble in. PHP is still looking unhappy as the original fatal message is being repeated.

sysadmin@Nextcloud-Server-0:~$ sudo -u www-data php /var/www/nextcloud/occ app:disable files_external_gdrive
[sudo] password for sysadmin:
PHP Fatal error: Interface ā€˜OCA\Files_External\Lib\Config\IBackendProviderā€™ not found in /var/www/nextcloud/apps/files_external_gdrive/lib/AppInfo/Application.php on line 32

I donā€™t understand why this busted app is being re-driven by PHP after the OCC ā€œdisableā€ procedure. I will have a sniff around in the log for clues.

Now that I know how to invoke the OCC console correctly (thank-you ā€œlinucksroxā€), I can see that my Nextcloud is mortally wounded. Even the status cannot be displayed.

sudo -u www-data php /var/www/nextcloud/occ status
[sudo] password for sysadmin:
PHP Fatal error: Interface ā€˜OCA\Files_External\Lib\Config\IBackendProviderā€™ not found in /var/www/nextcloud/apps/files_external_gdrive/lib/AppInfo/Application.php on line 32

Iā€™m a complete ā€œnumptyā€ with my knowledge of PHP but I suspect the ā€œsmoking gunā€ is in the hand of app ā€œfiles_external_gdriveā€ (0.2.8) and that it (with my help(?) has broken the core code.
I will go now and report the problem to this Google-Drive app developer (Samy Nastuzzi) and see if the underlying cause can be found. (Bye for Now)

If you could share a link where you reported the issue would be nice for people who follow the same topic. I was wondering if this might not even be an issue for nextcloud itself if an app can this easily break the setup. Especially when it is distributed via the app store, we could imagine some basic test routines such as enable and disable app. @BernhardPosselt

To disable the app, you can also delete the folder of the app (/var/www/nextcloud/apps/files_external_gdrive). Existing external storage to gdrive will probably disappear, since most of this information is hold in the database, the information is not lost and can be used again once a working version is available (or ideally the apps are programmed this way).

What do you mean? Store is written in Python and executing user provided code to check if itā€™s valid PHP is madness.

There are some automated tests in place for the NC code. Wouldnā€™t it be possible to run a test setup, install apps during the night and try a few basic operations like enabling or disabling them. Or if they try to create an external connection, ā€¦
Or a way that the occ command does not automatically load app code for some featuresā€¦

Also for the development such an infrastructure could be helpful for developers. NC 14 is not announced yet, it will drop for example php 5.x support. It could be helpful to have a full picture which apps are not compatible and it leaves some time to reach out to the developers or the community and does not leave users with a bad surprise that their favorite app is not working any more since the last upgrade.

I have no idea how difficult it is to put such things in place or if different approaches are easier and more efficient.

PHP compatibility is all handled via the info.xml. Also Nextcloud 13 ships with a feature afaik that will tell you if you can upgrade to the next version with all of your apps.

Thatā€™s what CI is actually doing, but itā€™s the app authors job to test the app btw.

As this now looks like an ā€œappā€ problem and not related to ā€œinstallationā€, I have posted a new entry here: Google-Drive External Files (0.2.8). App suspected of involvement in my ā€œPHP Fatal error:ā€ (Sev-1)
I hope this is the correct procedure.

I thought Iā€™d wake this thread back up after finding this via a Google search as Iā€™ve just experienced the same issue after installing the Google-Drive External Files App.

PHP Fatal error: Interface ā€˜OCA\Files_External\Lib\Config\IBackendProviderā€™ not found in /usr/local/www/nextcloud/apps/files_external_gdrive/lib/AppInfo/Application.php on line 32
root@nextcloud:/usr/local/www/nextcloud # sudo -u www-data php /var/www/nextcloud/occ app:disable files_external_gdrive
sudo: unknown user: www-data
sudo: unable to initialize policy plugin
root@nextcloud:/usr/local/www/nextcloud # sudo -u www-data php /var/www/nextcloud/occ status
sudo: unknown user: www-data
sudo: unable to initialize policy plugin

I assume NextCloud fatally damaged. Iā€™ll do a re-install since this is a initial setup.

I posted hereā€¦