Nextcloud 18: Users lose shared folders when they move them

Nextcloud version: 18.0.4
Operating system and version: Ubuntu Bionic Beaver (18.04 LTS)
Apache version: 2.4.29
PHP version: 7.2

The issue you are facing:

Given a user was shared a folder,
When he moves the shared folder to another (private) folder (on the same storage),
Then he loses the shared folder: missing from the destination folder, missing from the origin folder (i.e. root), missing from the list of all shared items.

The issue occurs using the web UI, using the function “move or copy” from the contextual menu of a shared folder.

This nextcloud instance has a bit of an historic, but so far everything worked pretty good:

  • first installed with a nextcloud 12 (AFAIR).
    • set up with LDAP
    • encryption enabled + recovery key.
  • regularly upgraded up to nextcloud 15.
  • migrated to new server:
  • upgraded sequentially from 15 to 16, 17 and finally 18.
  • has been running fine for a couple of weeks; no issue reported since then.

Note: encryption has not been enabled again.

Note2: I’m experiencing the issue with formerly shared folders (i.e. shared long before migration). I’ll try to reproduce the issue with new shares as soon as possible.

Is this the first time you’ve seen this error? Yes, but never tried this before.

Steps to replicate it… given the historic of the instance, I’m not quite sure these steps are enough:

  1. User A shares folder_a with User B,
  2. User B has got a shared folder folder_a at the root of his user space,
  3. User B creates a new private folder at the root of his user space and names it SharedWithMe,
  4. User B moves the shared folder folder_a into its folder SharedWithMe
  5. User B has lost the shared folder folder_a. It is nowhere to be found: neither at the root of his user space, neither into its private folder SharedWithMe.

The output of your Nextcloud log in Admin > Logging:

No error logged in the admin that day.
No error logged in nextcloud.log on the server that day.

The output of your config.php:

<?php
$CONFIG = array (
  'passwordsalt' => '*****',
  'secret' => '*****',
  'trusted_domains' => 
  array (***),
  'datadirectory' => '/mnt/01_data/nextcloud/data',
  'overwrite.cli.url' => 'https://*****/nextcloud',
  'htaccess.RewriteBase' => '/nextcloud',
  'dbtype' => 'pgsql',
  'version' => '18.0.4.2',
  'dbname' => 'nextcloud',
  'dbhost' => '*****', // DB host is a dedicated instance, separated from the app server
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => '*****',
  'dbpassword' => '*****',
  'logtimezone' => 'UTC',
  'installed' => true,
  'instanceid' => '*****',
  'updatechecker' => false,
  'ldapIgnoreNamingRules' => false,
  'ldapProviderFactory' => '\\OCA\\User_LDAP\\LDAPProviderFactory',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'integrity.check.disabled' => true,
  'maintenance' => false,
  'loglevel' => 2,
  'filelocking.enabled' => true,
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => '/var/run/redis/redis-server.sock',
    'port' => 0,
  ),
  'mail_domain' => '*****',
  'mail_smtpmode' => 'smtp',
  'mail_smtphost' => '*****',
  'mail_smtpport' => 587,
  'mail_smtptimeout' => 30,
  'mail_smtpsecure' => 'tls',
  'mail_smtpauth' => true,
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpname' => '*****',
  'mail_smtppassword' => '*****',
  'data-fingerprint' => '*****',
);

The output of your Apache/nginx/system log in /var/log/apache2/error.log:

No error logged that day...

The output of your Apache/nginx/system log in /var/log/apache2/access.log:

***** - - [15/May/2020:07:13:38 +0200] "MKCOL /nextcloud/remote.php/dav/files/userb/SharedWithMe HTTP/1.1" 201 2416 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0"
***** - - [15/May/2020:07:13:39 +0200] "POST /nextcloud/apps/text/session/sync HTTP/1.1" 200 2869 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0"
***** - - [15/May/2020:07:13:40 +0200] "PROPFIND /nextcloud/remote.php/dav/files/userb/SharedWithMe HTTP/1.1" 207 3670 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0"
***** - - [15/May/2020:07:13:40 +0200] "PROPFIND /nextcloud/remote.php/dav/files/userb/SharedWithMe HTTP/1.1" 207 1886 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0"
***** - - [15/May/2020:07:13:41 +0200] "GET /nextcloud/ocs/v2.php/apps/files_sharing/api/v1/shares?format=json&path=%2FSharedWithMe&shared_with_me=true HTTP/1.1" 200 828 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0"
***** - - [15/May/2020:07:13:42 +0200] "PROPFIND /nextcloud/remote.php/dav/systemtags-relations/files/816319 HTTP/1.1" 207 2988 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0"
***** - - [15/May/2020:07:13:42 +0200] "PROPFIND /nextcloud/remote.php/dav/systemtags-relations/files/816319 HTTP/1.1" 207 2988 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0"
***** - - [15/May/2020:07:13:42 +0200] "GET /nextcloud/ocs/v2.php/apps/files_sharing/api/v1/shares?format=json&path=%2FSharedWithMe&reshares=true HTTP/1.1" 200 2612 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0"
***** - - [15/May/2020:07:13:42 +0200] "GET /nextcloud/ocs/v2.php/collaboration/resources/file/816319?format=json HTTP/1.1" 200 2612 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0"
***** - - [15/May/2020:07:13:42 +0200] "GET /nextcloud/ocs/v1.php/apps/files_sharing/api/v1/sharees_recommended?format=json&itemType=dir HTTP/1.1" 200 1419 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0"
***** - - [15/May/2020:07:13:43 +0200] "GET /nextcloud/ocs/v2.php/apps/notifications/api/v2/notifications HTTP/1.1" 200 2652 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0"
***** - - [15/May/2020:07:13:45 +0200] "POST /nextcloud/apps/text/session/sync HTTP/1.1" 200 1085 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0"
::1 - - [15/May/2020:07:13:45 +0200] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.29 (Ubuntu) OpenSSL/1.1.1 (internal dummy connection)"
::1 - - [15/May/2020:07:13:47 +0200] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.29 (Ubuntu) OpenSSL/1.1.1 (internal dummy connection)"
::1 - - [15/May/2020:07:13:48 +0200] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.29 (Ubuntu) OpenSSL/1.1.1 (internal dummy connection)"
::1 - - [15/May/2020:07:13:49 +0200] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.29 (Ubuntu) OpenSSL/1.1.1 (internal dummy connection)"
::1 - - [15/May/2020:07:13:50 +0200] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.29 (Ubuntu) OpenSSL/1.1.1 (internal dummy connection)"
***** - - [15/May/2020:07:13:51 +0200] "POST /nextcloud/apps/text/session/sync HTTP/1.1" 200 2869 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0"
::1 - - [15/May/2020:07:13:51 +0200] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.29 (Ubuntu) OpenSSL/1.1.1 (internal dummy connection)"
::1 - - [15/May/2020:07:13:56 +0200] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.29 (Ubuntu) OpenSSL/1.1.1 (internal dummy connection)"
***** - - [15/May/2020:07:13:57 +0200] "POST /nextcloud/apps/text/session/sync HTTP/1.1" 200 2869 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0"
***** - - [15/May/2020:07:14:03 +0200] "POST /nextcloud/apps/text/session/sync HTTP/1.1" 200 2869 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0"
162.158.6.240 - userb [15/May/2020:07:14:03 +0200] "PROPFIND /nextcloud/remote.php/dav/files/userb/ HTTP/1.1" 207 2947 "-" "Mozilla/5.0 (Linux) mirall/2.6.4git (Nextcloud)"
162.158.6.240 - userb [15/May/2020:07:14:04 +0200] "GET /nextcloud/ocs/v2.php/apps/notifications/api/v2/notifications?format=json HTTP/1.1" 200 2652 "-" "Mozilla/5.0 (Linux) mirall/2.6.4git (Nextcloud)"
162.158.6.180 - userb [15/May/2020:07:14:04 +0200] "PROPFIND /nextcloud/remote.php/dav/files/userb/ HTTP/1.1" 207 14846 "-" "Mozilla/5.0 (Linux) mirall/2.6.4git (Nextcloud)"
162.158.6.240 - userb [15/May/2020:07:14:05 +0200] "PROPFIND /nextcloud/remote.php/dav/files/userb/SharedWithMe HTTP/1.1" 207 1177 "-" "Mozilla/5.0 (Linux) mirall/2.6.4git (Nextcloud)"
162.158.6.240 - userb [15/May/2020:07:14:06 +0200] "PROPFIND /nextcloud/remote.php/dav/files/userb/SharedWithMe HTTP/1.1" 207 3296 "-" "Mozilla/5.0 (Linux) mirall/2.6.4git (Nextcloud)"
162.158.6.240 - userb [15/May/2020:07:14:07 +0200] "PROPFIND /nextcloud/remote.php/dav/files/userb/ HTTP/1.1" 207 1163 "-" "Mozilla/5.0 (Linux) mirall/2.6.4git (Nextcloud)"
***** - - [15/May/2020:07:14:09 +0200] "POST /nextcloud/apps/text/session/sync HTTP/1.1" 200 2869 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0"
***** - - [15/May/2020:07:14:10 +0200] "PROPFIND /nextcloud/remote.php/dav/files/userb/Import%20Externe HTTP/1.1" 207 4665 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0"
162.158.6.240 - userb [15/May/2020:07:14:10 +0200] "PROPFIND /nextcloud/remote.php/dav/files/userb/ HTTP/1.1" 207 2948 "-" "Mozilla/5.0 (Linux) mirall/2.6.4git (Nextcloud)"
***** - - [15/May/2020:07:14:10 +0200] "PROPFIND /nextcloud/remote.php/dav/systemtags-relations/files/402591 HTTP/1.1" 207 1204 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0"
***** - - [15/May/2020:07:14:11 +0200] "PROPFIND /nextcloud/remote.php/dav/systemtags-relations/files/402591 HTTP/1.1" 207 2988 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0"
***** - - [15/May/2020:07:14:11 +0200] "GET /nextcloud/ocs/v2.php/apps/files_sharing/api/v1/shares?format=json&path=%2FImport+Externe&reshares=true HTTP/1.1" 200 3203 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0"
***** - - [15/May/2020:07:14:11 +0200] "GET /nextcloud/ocs/v2.php/collaboration/resources/file/402591?format=json HTTP/1.1" 200 2612 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0"
***** - - [15/May/2020:07:14:11 +0200] "GET /nextcloud/ocs/v2.php/apps/files_sharing/api/v1/shares?format=json&path=%2FImport+Externe&shared_with_me=true HTTP/1.1" 200 3203 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0"
***** - - [15/May/2020:07:14:12 +0200] "GET /nextcloud/ocs/v1.php/apps/files_sharing/api/v1/sharees_recommended?format=json&itemType=dir HTTP/1.1" 200 1419 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0"
***** - - [15/May/2020:07:14:12 +0200] "GET /nextcloud/ocs/v2.php/apps/activity/api/v2/activity/filter?format=json&object_type=files&object_id=402591 HTTP/1.1" 200 1684 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0"
***** - - [15/May/2020:07:14:12 +0200] "GET /nextcloud/avatar/%C3%89quipe/32 HTTP/1.1" 404 2546 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0"
***** - - [15/May/2020:07:14:12 +0200] "GET /nextcloud/ocs/v2.php/apps/notifications/api/v2/notifications HTTP/1.1" 200 868 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0"
***** - - [15/May/2020:07:14:13 +0200] "GET /nextcloud/avatar/APE/21 HTTP/1.1" 201 2984 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0"
***** - - [15/May/2020:07:14:14 +0200] "POST /nextcloud/apps/text/session/sync HTTP/1.1" 200 1085 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0"
::1 - - [15/May/2020:07:14:16 +0200] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.29 (Ubuntu) OpenSSL/1.1.1 (internal dummy connection)"

::1 - - [15/May/2020:07:14:19 +0200] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.29 (Ubuntu) OpenSSL/1.1.1 (internal dummy connection)"
::1 - - [15/May/2020:07:14:20 +0200] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.29 (Ubuntu) OpenSSL/1.1.1 (internal dummy connection)"
***** - - [15/May/2020:07:14:20 +0200] "POST /nextcloud/apps/text/session/sync HTTP/1.1" 200 2869 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0"
::1 - - [15/May/2020:07:14:21 +0200] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.29 (Ubuntu) OpenSSL/1.1.1 (internal dummy connection)"
***** - - [15/May/2020:07:14:23 +0200] "PROPFIND /nextcloud/remote.php/dav/files/userb/Import%20Externe HTTP/1.1" 207 2881 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0"
***** - - [15/May/2020:07:14:24 +0200] "GET /nextcloud/ocs/v2.php/apps/text/workspace?path=%2FImport+Externe HTTP/1.1" 404 2688 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0"
***** - - [15/May/2020:07:14:24 +0200] "GET /nextcloud/index.php/apps/files/ajax/getstoragestats.php?dir=%2FImport%20Externe HTTP/1.1" 200 961 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0"
***** - - [15/May/2020:07:14:25 +0200] "POST /nextcloud/apps/text/session/sync HTTP/1.1" 200 2869 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0"
***** - - [15/May/2020:07:14:26 +0200] "PROPFIND /nextcloud/remote.php/dav/files/userb/Import%20Externe/Jour%20de%20la%20nuit HTTP/1.1" 207 2932 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0"
***** - - [15/May/2020:07:14:26 +0200] "GET /nextcloud/ocs/v2.php/apps/text/workspace?path=%2FImport+Externe%2FJour+de+la+nuit HTTP/1.1" 404 2688 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0"
***** - - [15/May/2020:07:14:27 +0200] "GET /nextcloud/index.php/apps/files/ajax/getstoragestats.php?dir=%2FImport%20Externe%2FJour%20de%20la%20nuit HTTP/1.1" 200 961 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0"
***** - - [15/May/2020:07:14:27 +0200] "GET /nextcloud/apps/text/session/close?documentId=815940&sessionId=14&sessionToken=4A1c80qY6TdcUZHl3DH%2BoY7ULIbjSnF3R4Gh46IeHsAGCaX7aEDKkwe10N1DE1ae HTTP/1.1" 200 2539 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0"
***** - - [15/May/2020:07:14:28 +0200] "PROPFIND /nextcloud/remote.php/dav/files/userb/Import%20Externe/Jour%20de%20la%20nuit/Jour%20de%20la%20nuit%202019 HTTP/1.1" 207 10478 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0"
***** - - [15/May/2020:07:14:29 +0200] "GET /nextcloud/ocs/v2.php/apps/text/workspace?path=%2FImport+Externe%2FJour+de+la+nuit%2FJour+de+la+nuit+2019 HTTP/1.1" 404 2688 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0"
***** - - [15/May/2020:07:14:29 +0200] "GET /nextcloud/index.php/apps/files/ajax/getstoragestats.php?dir=%2FImport%20Externe%2FJour%20de%20la%20nuit%2FJour%20de%20la%20nuit%202019 HTTP/1.1" 200 952 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0"
***** - - [15/May/2020:07:14:29 +0200] "GET /nextcloud/core/preview?fileId=419269&c=2f837e418c00d615b182962546edf21e&x=250&y=250&forceIcon=0 HTTP/1.1" 200 17620 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0"
***** - - [15/May/2020:07:14:29 +0200] "GET /nextcloud/core/preview?fileId=419266&c=01d1989d7ad6c7497bf5bbce11fca11d&x=250&y=250&forceIcon=0 HTTP/1.1" 200 21984 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0"
***** - - [15/May/2020:07:14:29 +0200] "GET /nextcloud/core/preview?fileId=419248&c=8da61e352f42427ec42040f8b9c0ed07&x=250&y=250&forceIcon=0 HTTP/1.1" 200 24565 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0"
***** - - [15/May/2020:07:14:29 +0200] "GET /nextcloud/core/preview?fileId=419255&c=dbdb18f6c29f017deffdcfa518bb3805&x=250&y=250&forceIcon=0 HTTP/1.1" 200 24846 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0"
***** - - [15/May/2020:07:14:29 +0200] "GET /nextcloud/core/preview?fileId=419258&c=6c1082f5b5b703c4a327c0b392b8dd9e&x=250&y=250&forceIcon=0 HTTP/1.1" 200 22873 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0"
***** - - [15/May/2020:07:14:29 +0200] "GET /nextcloud/core/preview?fileId=419262&c=6dc7669acfd343074441f43edfb13850&x=250&y=250&forceIcon=0 HTTP/1.1" 200 28248 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0"
***** - - [15/May/2020:07:14:29 +0200] "GET /nextcloud/core/preview?fileId=419242&c=c719bd7a2b8e1941e4a50ceb1dfdd5dd&x=250&y=250&forceIcon=0 HTTP/1.1" 200 31857 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0"
***** - - [15/May/2020:07:14:29 +0200] "GET /nextcloud/core/preview?fileId=419252&c=4489fe29a50fc276680efd9fedf5b42c&x=250&y=250&forceIcon=0 HTTP/1.1" 200 25627 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0"
::1 - - [15/May/2020:07:14:35 +0200] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.29 (Ubuntu) OpenSSL/1.1.1 (internal dummy connection)"