Remove Federated Cloud Share Folder

I have in one of my instances a Federated Cloud Share of a directory from another instance. Unfortunately, this other instance no longer exists and the user can no longer access the folder, delete the folder or return the share. However, the folder with the share is located in a different folder of the user and not in his main folder anymore.

Is this the first time you’ve seen this error? (Y):

Steps to replicate it:

1) Federated Share of a folder from one instance to another
2) Take the instance with the mediated shares offline
3) Trying to delete the Federated Cloud Share on the other instance

I have also tried to use
occ files:scan
to fix this. Didn’t work out.

What can I do to delete the folder?

I had a similar problem couple of yearsr ago. If its not possible to remove the folder through the UI try to delete it manually

MariaDB [nextcloud]> select * from oc_share_external;
+----+----------------------+-----------+-----------------+----------+---------+--------+--------+------------+----------------------------------+----------+
| id | remote               | remote_id | share_token     | password | name    | owner  | user   | mountpoint | mountpoint_hash                  | accepted |
+----+----------------------+-----------+-----------------+----------+---------+--------+--------+------------+----------------------------------+----------+
|  2 | http://XXXXXXX/cloud |        -1 | duXXXXXXXmTlCBL |          | /XXX    | XXX    |   XXX  | /XXX       | 25ca74b23eb1e2eeb76a0dXXXX0ce4   |        1 |
+----+----------------------+-----------+-----------------+----------+---------+--------+--------+------------+----------------------------------+----------+

Oh… thx!
So i have to do it in the database?

There are also maintenance commands for occ:
https://docs.nextcloud.com/server/19/admin_manual/configuration_server/occ_command.html#files-external-label

I know these commands and thanks for the hint but it has nothing to do with the external files. The folder is a federated share:
https://docs.nextcloud.com/server/19/admin_manual/configuration_files/federated_cloud_sharing_configuration.html?highlight=federated#

I have already removed old external storage mounts like that. And the documentation says this

Commands for managing external storage:

files_external
files_external:applicable Manage applicable users and groups for a mount
files_external:backends Show available authentication and storage backends
files_external:config Manage backend configuration for a mount
files_external:create Create a new mount configuration
files_external:delete Delete an external mount
files_external:export Export mount configurations
files_external:import Import mount configurations
files_external:list List configured mounts
files_external:option Manage mount options for a mount
files_external:verify Verify mount configuration
files_external:notify Listen for active update notifications for a configured external mount

That could be true and the documentation is correct. But one more time: federated cloud share is something diffferent as external files. Trust me! External files is for mounted (external) devices at ur server and not for shares across instances of nextcloud. So please stop posting this. It is not helpful.

BTW:
Look at the original post of iBot:


There it says, that files:external did not take any effect!

php occ sharing:cleanup-remote-storages
Removes old non existing shares… not sure about federated…

Don’t tell me what to post. Don’t worry, I won’t post anything on this topic any more

That is a good hint!!! :smiley: I will try this tomorrow and report! I didnt know that command, thank you!

unfortunately, that didn’t help.

For completion, here is the longer explanation:
The federated shares are stored with the metadata in the database. Unfortunately none of the occ processes led to a success. You have to search in the nextcloud database (easiest with php-MyAdmin) and table with oc_share_external. In the rows of this table the shares are displayed with the data where the share comes from and where it is stored. Then simply search for the orphaned share and delete the line. Afterwards the share is no longer there and the cloud works normally again.