-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error while link sharing #2836
Comments
@llucenic Can I ask you to apply following patch: diff --git a/apps/files_sharing/lib/Controller/ShareAPIController.php b/apps/files_sharing/lib/Controller/ShareAPIController.php
index 90274be..79d7771 100644
--- a/apps/files_sharing/lib/Controller/ShareAPIController.php
+++ b/apps/files_sharing/lib/Controller/ShareAPIController.php
@@ -180,7 +180,11 @@ class ShareAPIController extends OCSController {
$expiration = $share->getExpirationDate();
if ($expiration !== null) {
- $result['expiration'] = $expiration->format('Y-m-d 00:00:00');
+ if ($expiration instanceof \DateTime) {
+ $result['expiration'] = $expiration->format('Y-m-d 00:00:00');
+ } else {
+ \OC::$server->getLogger()->logException(new \Exception('debug2836 ' . ($expiration ? 'true' : 'false')));
+ }
}
} else if ($share->getShareType() === \OCP\Share::SHARE_TYPE_REMOTE) { This adds a log message when this would have happened the next time. Just search the logs for |
Hi, I have patched the file and after clicking on the checkbox, I get the following log output: {"reqId":"lenF3wicfDzuG6g04OBs","remoteAddr":"185.22.215.103","app":"admin_audit","message":"The file \"\/Shared\/Anthony de Mello - Bdelos\u0165.pdf\" with ID \"149439\" has been shared via link with permissions \"1\" (Share ID: 48)","level":1,"time":"January 20, 2017 12:59:19","method":"POST","url":"\/ocs\/v2.php\/apps\/files_sharing\/api\/v1\/shares?format=json","user":"llucenic","version":"11.0.0.10"}
{"reqId":"lenF3wicfDzuG6g04OBs","remoteAddr":"185.22.215.103","app":"no app in context","message":"Exception: {\"Exception\":\"Exception\",\"Message\":\"debug2836 false\",\"Code\":0,\"Trace\":\"#0 \\\/data\\\/www\\\/nextcloud-11.0.0\\\/apps\\\/files_sharing\\\/lib\\\/Controller\\\/ShareAPIController.php(466): OCA\\\\Files_Sharing\\\\Controller\\\\ShareAPIController->formatShare(Object(OC\\\\Share20\\\\Share))\\n#1 [internal function]: OCA\\\\Files_Sharing\\\\Controller\\\\ShareAPIController->createShare('\\\/Knihy\\\/Anthony ...', 19, 3, NULL, 'false', '', '2017-02-20 00:0...')\\n#2 \\\/data\\\/www\\\/nextcloud-11.0.0\\\/lib\\\/private\\\/AppFramework\\\/Http\\\/Dispatcher.php(160): call_user_func_array(Array, Array)\\n#3 \\\/data\\\/www\\\/nextcloud-11.0.0\\\/lib\\\/private\\\/AppFramework\\\/Http\\\/Dispatcher.php(90): OC\\\\AppFramework\\\\Http\\\\Dispatcher->executeController(Object(OCA\\\\Files_Sharing\\\\Controller\\\\ShareAPIController), 'createShare')\\n#4 \\\/data\\\/www\\\/nextcloud-11.0.0\\\/lib\\\/private\\\/AppFramework\\\/App.php(114): OC\\\\AppFramework\\\\Http\\\\Dispatcher->dispatch(Object(OCA\\\\Files_Sharing\\\\Controller\\\\ShareAPIController), 'createShare')\\n#5 \\\/data\\\/www\\\/nextcloud-11.0.0\\\/lib\\\/private\\\/AppFramework\\\/Routing\\\/RouteActionHandler.php(47): OC\\\\AppFramework\\\\App::main('ShareAPIControl...', 'createShare', Object(OC\\\\AppFramework\\\\DependencyInjection\\\\DIContainer), Array)\\n#6 [internal function]: OC\\\\AppFramework\\\\Routing\\\\RouteActionHandler->__invoke(Array)\\n#7 \\\/data\\\/www\\\/nextcloud-11.0.0\\\/lib\\\/private\\\/Route\\\/Router.php(299): call_user_func(Object(OC\\\\AppFramework\\\\Routing\\\\RouteActionHandler), Array)\\n#8 \\\/data\\\/www\\\/nextcloud-11.0.0\\\/ocs\\\/v1.php(79): OC\\\\Route\\\\Router->match('\\\/ocsapp\\\/apps\\\/fi...')\\n#9 \\\/data\\\/www\\\/nextcloud-11.0.0\\\/ocs\\\/v2.php(23): require_once('\\\/data\\\/www\\\/nextc...')\\n#10 {main}\",\"File\":\"\\\/data\\\/www\\\/nextcloud-11.0.0\\\/apps\\\/files_sharing\\\/lib\\\/Controller\\\/ShareAPIController.php\",\"Line\":187}","level":3,"time":"January 20, 2017 12:59:19","method":"POST","url":"\/ocs\/v2.php\/apps\/files_sharing\/api\/v1\/shares?format=json","user":"llucenic","version":"11.0.0.10"}
{"reqId":"1jyuGp6at4AMJHTpuwJO","remoteAddr":"185.22.215.103","app":"admin_audit","message":"The file \"\/Shared\/Anthony de Mello - Bdelos\u0165.pdf\" with ID \"149439\" has been unshared (Share ID: 48)","level":1,"time":"January 20, 2017 12:59:21","method":"GET","url":"\/ocs\/v2.php\/apps\/files_sharing\/api\/v1\/shares?format=json&path=%2FKnihy%2FAnthony%20de%20Mello%20-%20Bdelos%C5%A5.pdf&reshares=true","user":"llucenic","version":"11.0.0.10"} Behaviour stays the same, except for no Error message pops up. |
@schiessle @rullzer could you check out this? Thanks |
I don't get why. But it seems that we set the expiration date to false then. I could come up with a patch for this. But that won't magically allow it to create the share. It would just fail at a different point. But that might be easier to debug. So lets have a look. |
Uhm mmm no the OCS API already has checks for this. |
Hi @rullzer, Thank you for your assistance, guys. |
Hello, I'm encountering the exact same issue. I added the debug thing as suggested and here is the output:
I'm pretty sure this used to work in 11.0 and probably in 11.0.1 too. The oc_share table contains:
|
I can confirm that the erroneous behaviour persists on my installation after upgrade to current stable NC version 11.0.2. |
Fixed in 12.0 |
I repeatedly confirm the issue persists even after upgrade to NC 12.0.0. |
I confirm this still seems to be broken in 12.0.0. |
This is still happening on 14.0.3 for me whenever a default expiration time is set. |
As the version of the software you've reported this for has reached end of life, I will close this ticket. If this is still happening after an upgrade to the latest version, feel free to reopen |
I am not able to create a public link to a document on my NC instance. Backend cannot determine share expiration date. Unfortunately, I am not able to tell which upgrade caused this regression. At least NC10 and NC11 affected.
Steps to reproduce
Expected behaviour
Checkbox should be checked and additional link sharing options should appear below it.
Actual behaviour
The checkbox is replaced by a loading icon and after a while message box appears with caption: Error while sharing. Error. Only Ok button in the box.
Server configuration
Operating system: debian 7.11
Web server: apache 2.4.10-10
Database: postgreSQL
PHP version: 5.6.7+dfsg-1
Nextcloud version: (see Nextcloud admin page) 11.0.0.10
Updated from an older Nextcloud/ownCloud or fresh install: OC6 > OC7 > OC8 > OC9 > NC10 > NC11
List of activated apps:
App list
Enabled: - activity: 2.4.1 - admin_audit: 1.1.0 - calendar: 1.4.1 - comments: 1.1.0 - contacts: 1.5.2 - dav: 1.1.1 - external: 1.2 - federatedfilesharing: 1.1.1 - federation: 1.1.1 - files: 1.6.1 - files_accesscontrol: 1.1.2 - files_automatedtagging: 1.1.1 - files_external: 1.1.2 - files_mv: 0.8.2 - files_pdfviewer: 1.0.1 - files_retention: 1.0.1 - files_sharing: 1.1.1 - files_texteditor: 2.2 - files_trashbin: 1.1.0 - files_versions: 1.4.0 - files_videoplayer: 1.0.0 - firstrunwizard: 2.0 - gallery: 16.0.0 - logreader: 2.0.0 - lookup_server_connector: 1.0.0 - nextcloud_announcements: 1.0 - notifications: 1.0.1 - password_policy: 1.1.0 - provisioning_api: 1.1.0 - serverinfo: 1.1.1 - sharebymail: 1.0.1 - survey_client: 0.1.5 - systemtags: 1.1.3 - templateeditor: 0.2 - theming: 1.1.1 - twofactor_backupcodes: 1.0.0 - updatenotification: 1.1.1 - user_external: 0.4 - workflowengine: 1.1.1 Disabled: - documents - encryption - ownnote - user_ldap - user_samlThe content of config/config.php:
Config report
{ "system": { "installed": true, "dbtype": "pgsql", "dbname": "owncloud", "dbuser": "***REMOVED SENSITIVE VALUE***", "dbpassword": "***REMOVED SENSITIVE VALUE***", "dbhost": "bariel.digital-orchestra.sk", "dbtableprefix": "oc_", "passwordsalt": "***REMOVED SENSITIVE VALUE***", "forcessl": true, "blacklisted_files": [ ".htaccess" ], "overwritehost": "", "overwriteprotocol": "", "overwritewebroot": "", "overwritecondaddr": "", "theme": "", "default_language": "sk", "3rdpartyroot": "", "3rdpartyurl": "", "defaultapp": "files", "knowledgebaseenabled": true, "knowledgebaseurl": "http:\/\/api.apps.owncloud.com\/v1", "appstoreenabled": true, "appstoreurl": "http:\/\/api.apps.owncloud.com\/v1", "mail_smtpdebug": true, "mail_smtpmode": "smtp", "mail_smtphost": "smtp.krutibrko.sk", "mail_smtpport": "25", "mail_smtptimeout": 10, "mail_smtpauthtype": "LOGIN", "trashbin_retention_obligation": "180, auto", "allow_user_to_change_display_name": true, "appcodechecker": "", "updatechecker": false, "log_type": "owncloud", "logfile": "", "loglevel": 0, "remember_login_cookie_lifetime": 31536000, "session_lifetime": 604800, "custom_csp_policy": "default-src 'self'; script-src 'self' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; frame-src *; img-src *; font-src 'self' data:; media-src *", "xframe_restriction": true, "maintenance": false, "apps_paths": [ { "path": "\/var\/www\/owncloud\/apps", "url": "\/apps", "writable": true } ], "customclient_desktop": "", "customclient_android": "", "customclient_ios": "", "logdateformat": "F d, Y H:i:s", "logtimezone": "Europe\/Berlin", "instanceid": "52881b38a4a63", "datadirectory": "\/data\/owncloud", "version": "11.0.0.10", "trusted_domains": [ "nextcloud.digital-orchestra.sk", "smtp.krutibrko.sk", "owncloud.digital-orchestra.sk" ], "secret": "***REMOVED SENSITIVE VALUE***", "share_folder": "\/Shared", "mail_from_address": "noreply", "mail_domain": "digital-orchestra.sk", "mail_smtpauth": 1, "mail_smtpname": "***REMOVED SENSITIVE VALUE***", "mail_smtppassword": "***REMOVED SENSITIVE VALUE***", "memcache.local": "\\OC\\Memcache\\APCu", "filelocking.enabled": true } }Are you using external storage, if yes which one: no
Are you using encryption: no
Are you using an external user-backend, if yes which one: no
Client configuration
Browser: FF50
Operating system: Linux Mint 17.3 as well as Android
Logs
Nextcloud log (data/nextcloud.log)
Nextcloud log
{"reqId":"cxRhY4dfqsuam5x\/0e78","remoteAddr":"185.22.215.103","app":"admin_audit","message":"File accessed: \"\/Knihy\/Anthony de Mello - Bdelos\u0165.pdf\"","level":1,"time":"December 22, 2016 23:22:42","method":"GET","url":"\/remote.php\/webdav\/Knihy\/Anthony%20de%20Mello%20-%20Bdelos%C5%A5.pdf","user":"***","version":"11.0.0.10"} {"reqId":"Vb0ayGY854nbnGJG2TKR","remoteAddr":"185.22.215.103","app":"admin_audit","message":"The file \"\/Shared\/Anthony de Mello - Bdelos\u0165.pdf\" with ID \"149439\" has been shared via link with permissions \"1\" (Share ID: 46)","level":1,"time":"December 22, 2016 23:22:50","method":"POST","url":"\/ocs\/v2.php\/apps\/files_sharing\/api\/v1\/shares?format=json","user":"***","version":"11.0.0.10"} {"reqId":"Vb0ayGY854nbnGJG2TKR","remoteAddr":"185.22.215.103","app":"PHP","message":"Call to a member function format() on boolean at \/data\/www\/nextcloud-11.0.0\/apps\/files_sharing\/lib\/Controller\/ShareAPIController.php#183","level":3,"time":"December 22, 2016 23:22:50","method":"POST","url":"\/ocs\/v2.php\/apps\/files_sharing\/api\/v1\/shares?format=json","user":"***","version":"11.0.0.10"}Note: user *** is same value for all records
The text was updated successfully, but these errors were encountered: