# Remove Federated Cloud Share Folder

**URL:** <https://help.nextcloud.com/t/remove-federated-cloud-share-folder/86019>\
**Category:** ℹ️ Support\
**Tags:** federated\
**Created:** [June 28, 2020, 9:24pm UTC](https://help.nextcloud.com/t/remove-federated-cloud-share-folder/86019 "2020-06-28T21:24:01Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![jwdf](https://help.nextcloud.com/letter_avatar/jwdf/32/6_22734026db12803ebb3e059622ac3534.png) [@jwdf](https://help.nextcloud.com/u/jwdf)\
**Post date:** [June 28, 2020, 9:24pm UTC](https://help.nextcloud.com/t/remove-federated-cloud-share-folder/86019/1 "2020-06-28T21:24:01Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![iBot](https://help.nextcloud.com/user_avatar/help.nextcloud.com/ibot/32/52_2.png) [@iBot](https://help.nextcloud.com/u/iBot)\
**Post date:** [June 29, 2020, 4:58am UTC](https://help.nextcloud.com/t/remove-federated-cloud-share-folder/86019/2 "2020-06-29T04:58:21Z")

</div>

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

```

> [@Unshare remote cloud directory](https://help.nextcloud.com/t/unshare-remote-cloud-directory/3376/5):
>
> I found one reference to the external share in my database that i just deleted. Seems like that is a workaround. MariaDB [nextcloud]\> select \* from oc\_share\_external; +----+----------------------+-----------+-----------------+----------+---------+--------+--------+------------+----------------------------------+----------+ | id | remote | remote\_id | share\_token | password | name | owner | user | mountpoint | mountpoint\_hash | accepted | +----+----------…

---

<div class="post-metadata">

**Author:** ![jwdf](https://help.nextcloud.com/letter_avatar/jwdf/32/6_22734026db12803ebb3e059622ac3534.png) [@jwdf](https://help.nextcloud.com/u/jwdf)\
**Post date:** [June 30, 2020, 8:13am UTC](https://help.nextcloud.com/t/remove-federated-cloud-share-folder/86019/3 "2020-06-30T08:13:45Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![tflidd](https://help.nextcloud.com/letter_avatar/tflidd/32/6_22734026db12803ebb3e059622ac3534.png) [@tflidd](https://help.nextcloud.com/u/tflidd)\
**Post date:** [June 30, 2020, 12:39pm UTC](https://help.nextcloud.com/t/remove-federated-cloud-share-folder/86019/4 "2020-06-30T12:39:13Z")

</div>

There are also maintenance commands for occ:  
[https://docs.nextcloud.com/server/19/admin\_manual/configuration\_server/occ\_command.html#files-external-label](https://docs.nextcloud.com/server/19/admin_manual/configuration_server/occ_command.html#files-external-label)

---

<div class="post-metadata">

**Author:** ![jwdf](https://help.nextcloud.com/letter_avatar/jwdf/32/6_22734026db12803ebb3e059622ac3534.png) [@jwdf](https://help.nextcloud.com/u/jwdf)\
**Post date:** [June 30, 2020, 12:53pm UTC](https://help.nextcloud.com/t/remove-federated-cloud-share-folder/86019/5 "2020-06-30T12:53:55Z")

</div>

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#](https://docs.nextcloud.com/server/19/admin_manual/configuration_files/federated_cloud_sharing_configuration.html?highlight=federated#)

---

<div class="post-metadata">

**Author:** ![tflidd](https://help.nextcloud.com/letter_avatar/tflidd/32/6_22734026db12803ebb3e059622ac3534.png) [@tflidd](https://help.nextcloud.com/u/tflidd)\
**Post date:** [June 30, 2020, 3:04pm UTC](https://help.nextcloud.com/t/remove-federated-cloud-share-folder/86019/6 "2020-06-30T15:04:25Z")

</div>

> [@jwdf](#):
>
> it has nothing to do with the external files

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

---

<div class="post-metadata">

**Author:** ![jwdf](https://help.nextcloud.com/letter_avatar/jwdf/32/6_22734026db12803ebb3e059622ac3534.png) [@jwdf](https://help.nextcloud.com/u/jwdf)\
**Post date:** [June 30, 2020, 9:15pm UTC](https://help.nextcloud.com/t/remove-federated-cloud-share-folder/86019/7 "2020-06-30T21:15:40Z")

</div>

> [@tflidd](#):
>
> I have already removed old external storage mounts like that. And the documentation says this

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:

> [@Unshare remote cloud directory](https://help.nextcloud.com/t/unshare-remote-cloud-directory/3376/5):
>
> I found one reference to the external share in my database that i just deleted. Seems like that is a workaround. MariaDB [nextcloud]\> select \* from oc\_share\_external; +----+----------------------+-----------+-----------------+----------+---------+--------+--------+------------+----------------------------------+----------+ | id | remote | remote\_id | share\_token | password | name | owner | user | mountpoint | mountpoint\_hash | accepted | +----+----------…

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

---

<div class="post-metadata">

**Author:** ![tflidd](https://help.nextcloud.com/letter_avatar/tflidd/32/6_22734026db12803ebb3e059622ac3534.png) [@tflidd](https://help.nextcloud.com/u/tflidd)\
**Post date:** [July 1, 2020, 7:33am UTC](https://help.nextcloud.com/t/remove-federated-cloud-share-folder/86019/8 "2020-07-01T07:33:24Z")

</div>

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

> [@jwdf](#):
>
> So please stop posting this

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

---

<div class="post-metadata">

**Author:** ![jwdf](https://help.nextcloud.com/letter_avatar/jwdf/32/6_22734026db12803ebb3e059622ac3534.png) [@jwdf](https://help.nextcloud.com/u/jwdf)\
**Post date:** [July 1, 2020, 8:21pm UTC](https://help.nextcloud.com/t/remove-federated-cloud-share-folder/86019/9 "2020-07-01T20:21:19Z")

</div>

> [@tflidd](#):
>
> `php occ sharing:cleanup-remote-storages`  
> Removes old non existing shares… not sure about federated…

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

---

<div class="post-metadata">

**Author:** ![jwdf](https://help.nextcloud.com/letter_avatar/jwdf/32/6_22734026db12803ebb3e059622ac3534.png) [@jwdf](https://help.nextcloud.com/u/jwdf)\
**Post date:** [July 10, 2020, 7:21am UTC](https://help.nextcloud.com/t/remove-federated-cloud-share-folder/86019/10 "2020-07-10T07:21:56Z")

</div>

unfortunately, that didn’t help.

---

<div class="post-metadata">

**Author:** ![jwdf](https://help.nextcloud.com/letter_avatar/jwdf/32/6_22734026db12803ebb3e059622ac3534.png) [@jwdf](https://help.nextcloud.com/u/jwdf)\
**Post date:** [July 10, 2020, 8:06am UTC](https://help.nextcloud.com/t/remove-federated-cloud-share-folder/86019/11 "2020-07-10T08:06:03Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Bajang](https://help.nextcloud.com/letter_avatar/bajang/32/6_22734026db12803ebb3e059622ac3534.png) [@Bajang](https://help.nextcloud.com/u/Bajang)\
**Post date:** [January 18, 2021, 10:48am UTC](https://help.nextcloud.com/t/remove-federated-cloud-share-folder/86019/12 "2021-01-18T10:48:36Z")

</div>

Hi

thanks for the help, I just wanted to add one thing.

I had the same issues: One of my friends took down his Nextcloud and after removing his server under Settings -\> Sharing -\> Trusted Server, I was not able remove his previously shared folders.  
However, for me the occ command ‘php occ sharing:cleanup-remote-storages’ posted by tflidd worked just fine. Using this command, the Folder just disappeared and the error messages in the log stopped popping up.

Thanks again for the help.

---

<div class="post-metadata">

**Author:** ![thomax](https://help.nextcloud.com/letter_avatar/thomax/32/6_22734026db12803ebb3e059622ac3534.png) [@thomax](https://help.nextcloud.com/u/thomax)\
**Post date:** [December 3, 2022, 11:39am UTC](https://help.nextcloud.com/t/remove-federated-cloud-share-folder/86019/13 "2022-12-03T11:39:40Z")

</div>

Thanks man. `delete from oc_share_external;` solved my problems.

---

<div class="post-metadata">

**Author:** ![le\_top](https://help.nextcloud.com/letter_avatar/le_top/32/6_22734026db12803ebb3e059622ac3534.png) [@le\_top](https://help.nextcloud.com/u/le_top)\
**Post date:** [July 21, 2023, 5:05pm UTC](https://help.nextcloud.com/t/remove-federated-cloud-share-folder/86019/14 "2023-07-21T17:05:34Z")

</div>

I had a similar issue in 27.0.1.2 for a remote share that I did not accept and for which I did not accept the share, which was in the pending list where clicking “Refuse” results in an error.

I had to remove it from the share\_external table as well (I started from an old version and my tables do not have a prefix).

---

<div class="post-metadata">

**Author:** ![MRPockets](https://help.nextcloud.com/letter_avatar/mrpockets/32/6_22734026db12803ebb3e059622ac3534.png) [@MRPockets](https://help.nextcloud.com/u/MRPockets)\
**Post date:** [February 24, 2024, 3:03am UTC](https://help.nextcloud.com/t/remove-federated-cloud-share-folder/86019/15 "2024-02-24T03:03:00Z")

</div>

Has anyone found a solution for this that doesn’t involve manually editing the database? I am getting my log file hammered from on old, non-existent federated share that I can’t delete. The occ sharing:cleanup-remote-storage command didn’t work and I can’t find anything helpful for occ federated:.

Edit: I was able to install & use PHPMyAdmin to remove the broken external share.

---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [January 16, 2025, 9:20am UTC](https://help.nextcloud.com/t/remove-federated-cloud-share-folder/86019/16 "2025-01-16T09:20:45Z")

</div>


