Can't remove external mount

I had 2 ftp mounts on my personal nextcloud. These mounts arn’t avalable anymore. Now I get an error at every start of my user: “Einige der konfigurierten externen Bereitstellungspunkte sind nicht angeschlossen. Bitte klicke auf die roten Zeile(n) für weitere Informationen”
The mounts are red hightlighted and if I click at them I geht the message: “[…] Do you want to review mount point config in personal settings page?”
If I click yes, I get an internal error. I can’t open the personal page, so I can’t remove the ftp mounts on any other way.

So what to to?
How can I delete the mounts?

Thx

Can you check your logfiles? Internal server errors should provide more information in your server logs. Please let us know what version of NC you are using and what environment (webserver, php version).

Thanks for your answer.

The log say - level: fatal - app: webdav

Sabre\DAV\Exception\ServiceUnavailable: HTTP/1.1 503 Storage is temporarily not available

/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php - line 178: OCA\DAV\Connector\Sabre\ObjectTree->getNodeForPath('###')
/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php - line 287: Sabre\DAV\Tree->delete('###')
[internal function] Sabre\DAV\CorePlugin->httpDelete(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
/var/www/nextcloud/3rdparty/sabre/event/lib/EventEmitterTrait.php - line 105: call_user_func_array(Array, Array)
/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 479: Sabre\Event\EventEmitter->emit('method DELETE', Array)
/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 254: Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
/var/www/nextcloud/apps/dav/appinfo/v1/webdav.php - line 60: Sabre\DAV\Server->exec()
/var/www/nextcloud/remote.php - line 165: require_once('/var/www/nextcl...')
{main}

Ubuntu 16.04.2 LTS - NC v11.0.2

Related to this report?

Thanks for your answer …
No. I think there are no parallels between that and my Problem.

How to reproduce:

  • create a ftp-Server
  • mount this ftp-share
  • check if it’s working … it should work
  • then delete/stop this ftp-server
  • now you can’t remove the nextcloud mount of this ftp-share anymore, you get everytime an error if you open the main-page and you can’t open the personal-page anymore, becouse of an internal error

This internal Error is like this:

Interner Serverfehler
    Der Server hat einen internen Fehler und konnte Ihre Anfrage nicht vervollständigen.
    Bitte wende dich an den Serveradministrator, falls dieser Fehler mehrfach auftritt, und füge deiner Anfrage die untenstehenden technischen Details bei.
    Weitere Details können im Serverprotokoll gefunden werden.
    Technische Details
    Entfernte Adresse: ###
    Anforderungskennung: hdJa/K4UbVKkpteEL3Lp

What does this “Anforderungskennung” mean? My NC is in german, but I can’t translate this word into english, or can to anything with this token.

I can deactivate all mounts, then I can visit my personal-page … but that isn’t a solution …

What can I do? This f*** problem is annoying.

Check the bug tracker and submit a new issue.

It takes me a lot of hours … but it was quite easy … I don’t know why no other tell me that!?
Just:
sudo -u www-data php occ files_external:delete <id>

Now the external mounts are gone … and a lot of errors with them. It takes 7 months to me, to solve it …
But the main is sill there … when I activate the external storages and a user goes to ‘personal’, then a error comes. I don’t know why …

When I check the files_external app, a tonnes of errors a coming:

root@uNAS:/var/www/nextcloud# sudo -u www-data php occ app:check-code files_external
Analysing /var/www/nextcloud/apps/files_external/templates/settings.php
 3 errors
	line   92: != - is discouraged
	line  172: == - is discouraged
	line  175: != - is discouraged
Analysing /var/www/nextcloud/apps/files_external/ajax/applicable.php
 4 errors
	line   24: OCP\JSON - Static method of deprecated class must not be called
	line   25: OCP\JSON - Static method of deprecated class must not be called
	line   27: OCP\JSON - Static method of deprecated class must not be called
	line   54: OCP\JSON - Static method of deprecated class must not be called
Analysing /var/www/nextcloud/apps/files_external/ajax/oauth2.php
 10 errors
	line   31: OC_App - Static method of private class must not be called
	line   34: OCP\JSON - Static method of deprecated class must not be called
	line   35: OCP\JSON - Static method of deprecated class must not be called
	line   36: OCP\JSON - Static method of deprecated class must not be called
	line   50: == - is discouraged
	line   53: OCP\JSON - Static method of deprecated class must not be called
	line   57: OCP\JSON - Static method of deprecated class must not be called
	line   61: == - is discouraged
	line   64: OCP\JSON - Static method of deprecated class must not be called
	line   68: OCP\JSON - Static method of deprecated class must not be called
Analysing /var/www/nextcloud/apps/files_external/ajax/oauth1.php
 8 errors
	line   29: OCP\JSON - Static method of deprecated class must not be called
	line   30: OCP\JSON - Static method of deprecated class must not be called
	line   31: OCP\JSON - Static method of deprecated class must not be called
	line   47: OCP\JSON - Static method of deprecated class must not be called
	line   51: OCP\JSON - Static method of deprecated class must not be called
	line   61: OCP\JSON - Static method of deprecated class must not be called
	line   64: OCP\JSON - Static method of deprecated class must not be called
	line   73: OCP\JSON - Static method of deprecated class must not be called
Analysing /var/www/nextcloud/apps/files_external/lib/Lib/Storage/Swift.php
 3 errors
	line  409: OCP\Files::tmpFile - Method of deprecated class must not be called
	line  433: != - is discouraged
	line  638: != - is discouraged
Analysing /var/www/nextcloud/apps/files_external/lib/Lib/Storage/FTP.php
 2 errors
	line   59: != - is discouraged
	line  130: OCP\Files::tmpFile - Method of deprecated class must not be called
Analysing /var/www/nextcloud/apps/files_external/lib/Lib/Storage/AmazonS3.php
 14 errors
	line   40: OC_App - Static method of private class must not be called
	line  157: OCP\Util::logException - Method of deprecated class must not be called
	line  216: OCP\Util::logException - Method of deprecated class must not be called
	line  252: OCP\Util::logException - Method of deprecated class must not be called
	line  283: OCP\Util::logException - Method of deprecated class must not be called
	line  303: OCP\Util::logException - Method of deprecated class must not be called
	line  324: OCP\Util::logException - Method of deprecated class must not be called
	line  337: OCP\Files::tmpFile - Method of deprecated class must not be called
	line  347: OCP\Util::logException - Method of deprecated class must not be called
	line  369: OCP\Files::tmpFile - Method of deprecated class must not be called
	line  421: OCP\Util::logException - Method of deprecated class must not be called
	line  441: OCP\Util::logException - Method of deprecated class must not be called
	line  455: OCP\Util::logException - Method of deprecated class must not be called
	line  532: OCP\Util::logException - Method of deprecated class must not be called
Analysing /var/www/nextcloud/apps/files_external/lib/Lib/Storage/Google.php
 2 errors
	line   44: OC_App - Static method of private class must not be called
	line  509: OCP\Files::tmpFile - Method of deprecated class must not be called
Analysing /var/www/nextcloud/apps/files_external/lib/Lib/Storage/Dropbox.php
 7 errors
	line   50: == - is discouraged
	line  190: == - is discouraged
	line  190: == - is discouraged
	line  195: == - is discouraged
	line  206: == - is discouraged
	line  206: == - is discouraged
	line  306: OCP\Files::tmpFile - Method of deprecated class must not be called
Analysing /var/www/nextcloud/apps/files_external/lib/Lib/Storage/OwnCloud.php
 2 errors
	line   43: == - is discouraged
	line   46: == - is discouraged
Analysing /var/www/nextcloud/apps/files_external/lib/Lib/Storage/SMB.php
 4 errors
	line   84: != - is discouraged
	line   87: != - is discouraged
	line  343: OCP\Files::tmpFile - Method of deprecated class must not be called
	line  492: OC_Helper - Static method of private class must not be called
Analysing /var/www/nextcloud/apps/files_external/lib/Lib/Storage/SFTP.php
 8 errors
	line  105: != - is discouraged
	line  109: != - is discouraged
	line  131: != - is discouraged
	line  251: == - is discouraged
	line  303: != - is discouraged
	line  303: != - is discouraged
	line  319: == - is discouraged
	line  323: == - is discouraged
Analysing /var/www/nextcloud/apps/files_external/lib/config.php
 3 errors
	line  225: OCP\User::getUser - Method of deprecated class must not be called
	line  243: OCP\Util::logException - Method of deprecated class must not be called
	line  363: OCP\Util::generateRandomBytes - Method of deprecated class must not be called
Analysing /var/www/nextcloud/apps/files_external/lib/Command/Import.php
 2 errors
	line  164: == - is discouraged
	line  165: == - is discouraged
App is not compliant

Is this normal?

There are a bit less errors on a 12.0.3 setup. However, I would expect Nextcloud to write Nextcloud-compliant apps. You can check the current code, they seem to start to fix some of these issues for NC 13: https://github.com/nextcloud/server/tree/master/apps/files_external

Feel free to get and test NC 13, once they release alpha/beta/RC releases and check again. These errors are warnings, this does not imply that the app isn’t working properly.

NextCloud - Force Remove External Mount Point

I am creating this post for reference. It was difficult to find a one-stop answer on how to do this and why it occurs. Hopefully this response will serve that purpose.

If you can’t remove an external mount point or get the following sync error

Client does not sync/The server file discovery reply is missing data

You may go into the web application and see that you have an unknown storage provider on one of your external mount points.

In my case, it was Google. Some posts say that updating the extension for Google Drive will fix it, but there was no explanation of how to do that. It doesn’t look likes it’s a plug-in.

If you just want to remove the link, you can try to delete it from the Web UI by clicking the checkbox next to the folder and selecting the remove item from the dropdown menu.

If the web UI removal method does not work, the occ command must be used.

The following will remove the link from NextCloud to the external provider you choose.

Remove an external storage provider from the command line

Hop onto the terminal or command prompt in order to issue the external files occ commands.

First, I will provide a walk-through of the commands, then I will show the commands in action. I will also give two variations of the commands for terminal and docker usage.

Open a docker interactive terminal (if you’re using docker with the official image)

sudo docker exec -it docker-nextcloud /bin/bash

List the currently active mount points for all users

Standard Usage

occ files_external:list -a

Docker

su -c "php /var/www/html/occ files_external:list -a" -s /bin/sh www-data

Delete a selected mount using the mount’s ID

Standard Usage

occ files_external:delete <Mount ID>

Docker

su -c "php /var/www/html/occ files_external:delete <Mount ID>" -s /bin/sh www-data

Command results for reference

These commands were issued from inside a docker container, so they command syntax will look different if you’re using the terminal (as discussed previously) or if you are using a different image base in your docker container.

List ALL of the mount points as the root user

root@mydockercontainer# su -c "php /var/www/html/occ files_external:list -a" -s /bin/sh www-data
+----------+-------------+-------------------------------------+-----------------------+----------------------------------------------------------------------------------------------------------+---------+------------------+-------------------+----------+
| Mount ID | Mount Point | Storage                             | Authentication Type   | Configuration                                                                                            | Options | Applicable Users | Applicable Groups | Type     |
+----------+-------------+-------------------------------------+-----------------------+----------------------------------------------------------------------------------------------------------+---------+------------------+-------------------+----------+
| 2        | /BoxDotCom  | WebDAV                              | Username and password | host: "dav.box.com\/dav", root: "NextCloud", secure: true, user: "emai1@local.com", password: "***"      |         | user1            |                   | Personal |
| 3        | /GDrive     | Unknown storage backend googledrive | OAuth2                | configured: "true", client_id: "xxxxxx...al.com", client_secret: "***", token: "***"                     |         | user2            |                   | Personal |
+----------+-------------+-------------------------------------+-----------------------+----------------------------------------------------------------------------------------------------------+---------+------------------+-------------------+----------+

Pick out your ID from the results

I choose number three which is associated with the provider type and user that is having the issue.

Delete the mount and confirm when prompted

root@mydockercontainer# su -c "php /var/www/html/occ files_external:delete 3" -s /bin/sh www-data
+----------+-------------+-------------------------------------+---------------------+--------------------------------------------------------------------------------------+---------+------------------+-------------------+
| Mount ID | Mount Point | Storage                             | Authentication Type | Configuration                                                                        | Options | Applicable Users | Applicable Groups |
+----------+-------------+-------------------------------------+---------------------+--------------------------------------------------------------------------------------+---------+------------------+-------------------+
| 3        | /GDrive     | Unknown storage backend googledrive | OAuth2              | configured: "true", client_id: "xxxxxx...al.com", client_secret: "***", token: "***" |         | user2            |                   |
+----------+-------------+-------------------------------------+---------------------+--------------------------------------------------------------------------------------+---------+------------------+-------------------+
Delete this mount? [y/N] y

List ALL of the mount points again to ensure it’s gone

root@mydockercontainer# su -c "php /var/www/html/occ files_external:list -a" -s /bin/sh www-data
+----------+-------------+---------+-----------------------+----------------------------------------------------------------------------------------------------------+---------+------------------+-------------------+----------+
| Mount ID | Mount Point | Storage | Authentication Type   | Configuration                                                                                            | Options | Applicable Users | Applicable Groups | Type     |
+----------+-------------+---------+-----------------------+----------------------------------------------------------------------------------------------------------+---------+------------------+-------------------+----------+
| 2        | /BoxDotCom  | WebDAV  | Username and password | host: "dav.box.com\/dav", root: "NextCloud", secure: true, user: "email@local.com", password: "***"      |         | user1            |                   | Personal |
+----------+-------------+---------+-----------------------+----------------------------------------------------------------------------------------------------------+---------+------------------+-------------------+----------+

Go back to the browser and verify that the issue is fixed

I was also able to go into the client sync at this point and force a sync which cleared away the red x and errors I was experiencing.

Hope this helps anyone looking for an answer!

REFERENCE:

[https://docs.nextcloud.com/server/14/admin_manual/configuration_server/occ_command.html?highlight=occ#files-external-label

1 Like

@SimpleCake: Thank you for your post, you just saved my day :-). The same thing happend to me after the Google Drive »app« was automatically removed by the update to 17.0.5. The provider for files_external was gone, but the mount point still was there and could not be removed via the web interface.

1 Like