Can't create share link on external storage

Nextcloud version (eg, 20.0.5): 26.0.1
Operating system and version (eg, Ubuntu 20.04): Linux/Synology
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4
PHP version (eg, 7.4): PHP 8.0

The issue you are facing:
I can’t create share links on an external storage, although sharing is enabled on that storage.
On the root level, I can create the link but it “dissapears” immediately. If I stay on the share menu, I can edit the share (permission, PW protection etc). But if I navigate to a different folder and then navigate back and open the share menu, the link is gone. Also opening the link shows “page not found”.
If I try to create a share link from a subfolder within the external storage I get “error creating the link”.
I already tried disabling and enabling the share option on the external sotrage.
The external storage is added on user level.

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

Steps to replicate it:

  1. Click on share icon on external storage
  2. create a share link

The output of your Nextcloud log in Admin > Logging:

"app":"no app in context","method":"GET","url":"/apps/files/","message":"Deprecated event type for \\OCP\\Collaboration\\Resources::loadAdditionalScripts: null","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36","version":"26.0.1.1","data":[]}
"app":"no app in context","method":"GET","url":"/apps/files/","message":"Deprecated event type for OCA\\Files::loadAdditionalScripts: Symfony\\Component\\EventDispatcher\\GenericEvent is used","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36","version":"26.0.1.1","data":[]}
"app":"no app in context","method":"GET","url":"/apps/files/ajax/getstoragestats?dir=%2F","message":"Deprecated event type for \\OCP\\Collaboration\\Resources::loadAdditionalScripts: null","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36","version":"26.0.1.1","data":[]}
"app":"no app in context","method":"GET","url":"/apps/files/ajax/getstoragestats?dir=%2F","message":"Deprecated event type for OCA\\Files::loadAdditionalScripts: Symfony\\Component\\EventDispatcher\\GenericEvent is used","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36","version":"26.0.1.1","data":[]}
"app":"no app in context","method":"GET","url":"/core/preview?fileId=382641&c=284fc6ee9563320781fc6c2e61ed75b0&x=250&y=250&forceIcon=0&a=1","message":"Deprecated event type for OCP\\IPreview:PreviewRequested: Symfony\\Component\\EventDispatcher\\GenericEvent is used","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36","version":"26.0.1.1","data":[]}
"app":"text","method":"PUT","url":"/apps/text/session/create","message":"Keep previous document of 382641","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36","version":"26.0.1.1","data":{"app":"text"}}
"app":"text","method":"PUT","url":"/apps/text/session/create","message":"Loading existing session for 382641","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36","version":"26.0.1.1","data":{"app":"text"}}
"app":"text","method":"PUT","url":"/apps/text/session/create","message":"State file not found for 382641","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36","version":"26.0.1.1","data":{"app":"text"}}
"app":"text","method":"PUT","url":"/apps/text/session/create","message":"Empty steps, loading content for 382641","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36","version":"26.0.1.1","data":{"app":"text"}}
"app":"webdav","method":"PROPFIND","url":"/remote.php/dav/systemtags-relations/files/509302","message":"Entity does not exist or is not available","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36","version":"26.0.1.1","exception":{"Exception":"Sabre\\DAV\\Exception\\NotFound","Message":"Entity does not exist or is not available","Code":0,"Trace":[{"file":"/volume1/web/mimir/3rdparty/sabre/dav/lib/DAV/Tree.php","line":78,"function":"getChild","class":"OCA\\DAV\\SystemTag\\SystemTagsObjectTypeCollection","type":"->","args":["509302"]},{"file":"/volume1/web/mimir/3rdparty/sabre/dav/lib/DAV/Server.php","line":971,"function":"getNodeForPath","class":"Sabre\\DAV\\Tree","type":"->","args":["systemtags-relations/files/509302"]},{"file":"/volume1/web/mimir/3rdparty/sabre/dav/lib/DAV/Server.php","line":1662,"function":"getPropertiesIteratorForPath","class":"Sabre\\DAV\\Server","type":"->","args":["systemtags-relations/files/509302",["{http://owncloud.org/ns}id","{http://owncloud.org/ns}display-name","{http://owncloud.org/ns}user-visible","{http://owncloud.org/ns}user-assignable","{http://owncloud.org/ns}can-assign"],1]},{"file":"/volume1/web/mimir/3rdparty/sabre/dav/lib/DAV/Server.php","line":1647,"function":"writeMultiStatus","class":"Sabre\\DAV\\Server","type":"->","args":[["Sabre\\Xml\\Writer",[],"/remote.php/dav/",["d","s","oc","nc"],[]],["Generator"],false]},{"file":"/volume1/web/mimir/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":346,"function":"generateMultiStatus","class":"Sabre\\DAV\\Server","type":"->","args":[["Generator"],false]},{"file":"/volume1/web/mimir/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpPropFind","class":"Sabre\\DAV\\CorePlugin","type":"->","args":[["Sabre\\HTTP\\Request"],["Sabre\\HTTP\\Response"]]},{"file":"/volume1/web/mimir/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->","args":["method:PROPFIND",[["Sabre\\HTTP\\Request"],["Sabre\\HTTP\\Response"]]]},{"file":"/volume1/web/mimir/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->","args":[["Sabre\\HTTP\\Request"],["Sabre\\HTTP\\Response"]]},{"file":"/volume1/web/mimir/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\\DAV\\Server","type":"->","args":[]},{"file":"/volume1/web/mimir/apps/dav/lib/Server.php","line":366,"function":"exec","class":"Sabre\\DAV\\Server","type":"->","args":[]},{"file":"/volume1/web/mimir/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->","args":[]},{"file":"/volume1/web/mimir/remote.php","line":172,"args":["/volume1/web/mimir/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/volume1/web/mimir/apps/dav/lib/SystemTag/SystemTagsObjectTypeCollection.php","Line":125,"message":"Entity does not exist or is not available","exception":{},"CustomMessage":"Entity does not exist or is not available"}}
"app":"webdav","method":"PROPFIND","url":"/remote.php/dav/systemtags-relations/files/509302","message":"Entity does not exist or is not available","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36","version":"26.0.1.1","exception":{"Exception":"Sabre\\DAV\\Exception\\NotFound","Message":"Entity does not exist or is not available","Code":0,"Trace":[{"file":"/volume1/web/mimir/3rdparty/sabre/dav/lib/DAV/Tree.php","line":78,"function":"getChild","class":"OCA\\DAV\\SystemTag\\SystemTagsObjectTypeCollection","type":"->","args":["509302"]},{"file":"/volume1/web/mimir/3rdparty/sabre/dav/lib/DAV/Server.php","line":971,"function":"getNodeForPath","class":"Sabre\\DAV\\Tree","type":"->","args":["systemtags-relations/files/509302"]},{"file":"/volume1/web/mimir/3rdparty/sabre/dav/lib/DAV/Server.php","line":1662,"function":"getPropertiesIteratorForPath","class":"Sabre\\DAV\\Server","type":"->","args":["systemtags-relations/files/509302",["{http://owncloud.org/ns}id","{http://owncloud.org/ns}display-name","{http://owncloud.org/ns}user-visible","{http://owncloud.org/ns}user-assignable","{http://owncloud.org/ns}can-assign"],1]},{"file":"/volume1/web/mimir/3rdparty/sabre/dav/lib/DAV/Server.php","line":1647,"function":"writeMultiStatus","class":"Sabre\\DAV\\Server","type":"->","args":[["Sabre\\Xml\\Writer",[],"/remote.php/dav/",["d","s","oc","nc"],[]],["Generator"],false]},{"file":"/volume1/web/mimir/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":346,"function":"generateMultiStatus","class":"Sabre\\DAV\\Server","type":"->","args":[["Generator"],false]},{"file":"/volume1/web/mimir/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpPropFind","class":"Sabre\\DAV\\CorePlugin","type":"->","args":[["Sabre\\HTTP\\Request"],["Sabre\\HTTP\\Response"]]},{"file":"/volume1/web/mimir/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->","args":["method:PROPFIND",[["Sabre\\HTTP\\Request"],["Sabre\\HTTP\\Response"]]]},{"file":"/volume1/web/mimir/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->","args":[["Sabre\\HTTP\\Request"],["Sabre\\HTTP\\Response"]]},{"file":"/volume1/web/mimir/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\\DAV\\Server","type":"->","args":[]},{"file":"/volume1/web/mimir/apps/dav/lib/Server.php","line":366,"function":"exec","class":"Sabre\\DAV\\Server","type":"->","args":[]},{"file":"/volume1/web/mimir/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->","args":[]},{"file":"/volume1/web/mimir/remote.php","line":172,"args":["/volume1/web/mimir/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/volume1/web/mimir/apps/dav/lib/SystemTag/SystemTagsObjectTypeCollection.php","Line":125,"message":"Entity does not exist or is not available","exception":{},"CustomMessage":"Entity does not exist or is not available"}}
"app":"webdav","method":"REPORT","url":"/remote.php/dav/comments/files/509302","message":"Entity does not exist or is not available","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36","version":"26.0.1.1","exception":{"Exception":"Sabre\\DAV\\Exception\\NotFound","Message":"Entity does not exist or is not available","Code":0,"Trace":[{"file":"/volume1/web/mimir/3rdparty/sabre/dav/lib/DAV/Tree.php","line":78,"function":"getChild","class":"OCA\\DAV\\Comments\\EntityTypeCollection","type":"->","args":["509302"]},{"file":"/volume1/web/mimir/apps/dav/lib/Connector/Sabre/FilesReportPlugin.php","line":183,"function":"getNodeForPath","class":"Sabre\\DAV\\Tree","type":"->","args":["comments/files/509302"]},{"file":"/volume1/web/mimir/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"onReport","class":"OCA\\DAV\\Connector\\Sabre\\FilesReportPlugin","type":"->","args":["{http://owncloud.org/ns}filter-comments",[["{http://owncloud.org/ns}limit","20",[]],["{http://owncloud.org/ns}offset","0",[]]],"comments/files/509302"]},{"file":"/volume1/web/mimir/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":690,"function":"emit","class":"Sabre\\DAV\\Server","type":"->","args":["report",["{http://owncloud.org/ns}filter-comments",[["{http://owncloud.org/ns}limit","20",[]],["{http://owncloud.org/ns}offset","0",[]]],"comments/files/509302"]]},{"file":"/volume1/web/mimir/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpReport","class":"Sabre\\DAV\\CorePlugin","type":"->","args":[["Sabre\\HTTP\\Request"],["Sabre\\HTTP\\Response"]]},{"file":"/volume1/web/mimir/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->","args":["method:REPORT",[["Sabre\\HTTP\\Request"],["Sabre\\HTTP\\Response"]]]},{"file":"/volume1/web/mimir/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->","args":[["Sabre\\HTTP\\Request"],["Sabre\\HTTP\\Response"]]},{"file":"/volume1/web/mimir/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\\DAV\\Server","type":"->","args":[]},{"file":"/volume1/web/mimir/apps/dav/lib/Server.php","line":366,"function":"exec","class":"Sabre\\DAV\\Server","type":"->","args":[]},{"file":"/volume1/web/mimir/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->","args":[]},{"file":"/volume1/web/mimir/remote.php","line":172,"args":["/volume1/web/mimir/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/volume1/web/mimir/apps/dav/lib/Comments/EntityTypeCollection.php","Line":94,"message":"Entity does not exist or is not available","exception":{},"CustomMessage":"Entity does not exist or is not available"}}
"app":"no app in context","method":"POST","url":"/ocs/v2.php/apps/files_sharing/api/v1/shares","message":"Deprecated event type for OCP\\Share::preShare: Symfony\\Component\\EventDispatcher\\GenericEvent is used","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36","version":"26.0.1.1","data":[]}
"app":"no app in context","method":"POST","url":"/ocs/v2.php/apps/files_sharing/api/v1/shares","message":"Deprecated event type for OCP\\Share::postShare: Symfony\\Component\\EventDispatcher\\GenericEvent is used","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36","version":"26.0.1.1","data":[]}
"app":"related_resources","method":"POST","url":"/ocs/v2.php/apps/files_sharing/api/v1/shares","message":"flush cache","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36","version":"26.0.1.1","data":{"app":"related_resources"}}
"app":"files_sharing","method":"POST","url":"/ocs/v2.php/apps/files_sharing/api/v1/shares","message":"Share type does not allow to emit interaction event","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36","version":"26.0.1.1","data":{"app":"files_sharing"}}

Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.

there are no errors in the log, just the few lines pasted above

Could be related to the following issues.

https://github.com/nextcloud/server/issues/37414