nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
26.89k stars 4.02k forks source link

Cannot share via link if expiration date is predefined #24433

Closed lorettprinz closed 3 years ago

lorettprinz commented 3 years ago

How to use GitHub

Steps to reproduce

  1. Settings > Administration:Sharing > Allow users to share via link: grafik

Actual behaviour

It's not possible to create a link. Neither file nor folder. Instead an error message appears. If the option Set default expiration date for link shares is set to false everything works.

Server configuration

Operating system: Ubuntu 20.04

Web server: Aapche

Database: postgresql13.1

PHP version: 7.4.3

Nextcloud version: (see Nextcloud admin page) 20.0.2

Updated from an older Nextcloud/ownCloud or fresh install: Yes. The bug is also in NC19.0.5

Signing status:

Signing status ``` No errors have been found. ```

List of activated apps:

App list ``` Enabled: - accessibility: 1.6.0 - activity: 2.13.3 - admin_audit: 1.10.0 - calendar: 2.1.2 - cloud_federation_api: 1.3.0 - comments: 1.10.0 - contacts: 3.4.2 - contactsinteraction: 1.1.0 - dashboard: 7.0.0 - dav: 1.16.1 - deck: 1.2.2 - drawio: 0.9.7 - external: 3.7.1 - extract: 1.2.5 - federatedfilesharing: 1.10.1 - federation: 1.10.1 - files: 1.15.0 - files_accesscontrol: 1.10.1 - files_external: 1.11.1 - files_mindmap: 0.0.23 - files_pdfviewer: 2.0.1 - files_rightclick: 0.17.0 - files_sharing: 1.12.0 - files_trashbin: 1.10.1 - files_versions: 1.13.0 - files_videoplayer: 1.9.0 - firstrunwizard: 2.9.0 - groupfolders: 8.1.1 - logreader: 2.5.0 - lookup_server_connector: 1.8.0 - maps: 0.1.8 - metadata: 0.12.0 - nextcloud_announcements: 1.9.0 - notes: 4.0.1 - notifications: 2.8.0 - oauth2: 1.8.0 - password_policy: 1.10.1 - photos: 1.2.0 - privacy: 1.4.0 - provisioning_api: 1.10.0 - rainloop: 7.0.3 - recommendations: 0.8.0 - richdocuments: 3.7.10 - richdocumentscode: 6.4.14 - serverinfo: 1.10.0 - settings: 1.2.0 - sharebymail: 1.10.0 - spreed: 10.0.3 - support: 1.3.0 - survey_client: 1.8.0 - systemtags: 1.10.0 - tasks: 0.13.6 - text: 3.1.0 - theming: 1.11.0 - twofactor_backupcodes: 1.9.0 - twofactor_u2f: 6.0.0 - updatenotification: 1.10.0 - user_status: 1.0.1 - viewer: 1.4.0 - w2g2: 3.0.3 - weather_status: 1.0.0 - workflow_script: 1.5.0 - workflowengine: 2.2.0 Disabled: - documentserver_community - emlviewer - encryption - mail - ocr - onlyoffice - user_ldap ```

Nextcloud configuration:

Config report ``` { "system": { "instanceid": "***REMOVED SENSITIVE VALUE***", "passwordsalt": "***REMOVED SENSITIVE VALUE***", "secret": "***REMOVED SENSITIVE VALUE***", "trusted_domains": [ "***REMOVED SENSITIVE VALUE***" ], "datadirectory": "***REMOVED SENSITIVE VALUE***", "dbtype": "pgsql", "version": "20.0.2.2", "overwrite.cli.url": "***REMOVED SENSITIVE VALUE***", "dbname": "***REMOVED SENSITIVE VALUE***", "dbhost": "***REMOVED SENSITIVE VALUE***", "dbport": "", "dbtableprefix": "oc_", "dbuser": "***REMOVED SENSITIVE VALUE***", "dbpassword": "***REMOVED SENSITIVE VALUE***", "logtimezone": "Europe\/Berlin", "log_type": "owncloud", "logfile": "\/var\/log\/nextcloud.log", "sharing.interal_shares_accepted": true, "installed": true, "maintenance": false, "mail_from_address": "***REMOVED SENSITIVE VALUE***", "mail_smtpmode": "smtp", "mail_sendmailmode": "smtp", "mail_domain": "***REMOVED SENSITIVE VALUE***", "mail_smtpsecure": "ssl", "mail_smtpauthtype": "LOGIN", "mail_smtpauth": 1, "mail_smtphost": "***REMOVED SENSITIVE VALUE***", "mail_smtpport": "465", "mail_smtpname": "***REMOVED SENSITIVE VALUE***", "mail_smtppassword": "***REMOVED SENSITIVE VALUE***", "pgsql.utf8mb4": true, "memcache.local": "\\OC\\Memcache\\APCu", "memcache.locking": "\\OC\\Memcache\\Redis", "filelocking.enabled": "true", "redis": { "host": "***REMOVED SENSITIVE VALUE***", "port": 0, "timeout": 0 }, "theme": "", "loglevel": 2, "updater.release.channel": "stable", "app_install_overwrite": [ "drawio", "files_readmemd" ] }, "apps": { "accessibility": { "enabled": "yes", "types": "", "installed_version": "1.6.0" }, "activity": { "enabled": "yes", "types": "filesystem", "installed_version": "2.13.3" }, "admin_audit": { "enabled": "yes", "types": "logging", "installed_version": "1.10.0" }, "backgroundjob": { "lastjob": "327" }, "calendar": { "types": "", "enabled": "yes", "installed_version": "2.1.2" }, "cloud_federation_api": { "enabled": "yes", "types": "filesystem", "installed_version": "1.3.0" }, "comments": { "enabled": "yes", "types": "logging", "installed_version": "1.10.0" }, "contacts": { "enabled": "yes", "types": "dav", "installed_version": "3.4.2" }, "contactsinteraction": { "enabled": "yes", "types": "dav", "installed_version": "1.1.0" }, "core": { "backgroundjobs_mode": "cron", "enterpriseLogoChecked": "yes", "installedat": "1557220202.2398", "public_files": "files_sharing\/public.php", "public_webdav": "dav\/appinfo\/v1\/publicwebdav.php", "scss.variables": "269f572a864db2bf58ebe006097611dd", "shareapi_expire_after_n_days": "21", "vendor": "nextcloud", "updater.secret.created": "1605792761", "shareapi_default_expire_date": "no", "lastupdateResult": "[]", "lastupdatedat": "1606646452", "lastcron": "1606647006", "theming.variables": "7d0ebad87366df0e9fde68adff7a2725", "oc.integritycheck.checker": "[]" }, "dashboard": { "installed_version": "7.0.0", "types": "", "enabled": "yes" }, "dav": { "buildCalendarReminderIndex": "yes", "buildCalendarSearchIndex": "yes", "chunks_migrated": "1", "enabled": "yes", "regeneratedBirthdayCalendarsForYearFix": "yes", "sendEventRemindersPush": "no", "types": "filesystem", "installed_version": "1.16.1" }, "deck": { "installed_version": "1.2.2", "types": "dav" }, "documentserver_community": { "enabled": "no", "installed_version": "0.1.8", "types": "filesystem" }, "drawio": { "DrawioLang": "auto", "DrawioOffline": "no", "DrawioTheme": "minimal", "DrawioUrl": "https:\/\/www.draw.io", "DrawioXml": "yes", "installed_version": "0.9.7", "types": "filesystem", "enabled": "yes" }, "emlviewer": { "types": "", "installed_version": "0.0.21", "enabled": "no" }, "external": { "max_site": "1", "sites": "***REMOVED SENSITIVE VALUE***", "types": "", "installed_version": "3.7.1", "enabled": "yes" }, "extract": { "enabled": "yes", "installed_version": "1.2.5", "types": "" }, "federatedfilesharing": { "enabled": "yes", "types": "", "installed_version": "1.10.1" }, "federation": { "enabled": "yes", "types": "authentication", "installed_version": "1.10.1" }, "files": { "cronjob_scan_files": "500", "enabled": "yes", "types": "filesystem", "watermark_enabled": "no", "installed_version": "1.15.0" }, "files_accesscontrol": { "types": "filesystem", "enabled": "yes", "installed_version": "1.10.1" }, "files_external": { "allow_user_mounting": "no", "enabled": "yes", "types": "filesystem", "installed_version": "1.11.1" }, "files_fulltextsearch": { "enabled": "no", "files_audio": "0", "files_encrypted": "0", "files_external": "1", "files_federated": "0", "files_group_folders": "1", "files_image": "0", "files_local": "1", "files_office": "1", "files_pdf": "1", "files_size": "1000", "installed_version": "1.4.1", "types": "filesystem" }, "files_fulltextsearch_tesseract": { "enabled": "no", "installed_version": "1.4.0", "tesseract_enabled": "1", "tesseract_lang": "eng,deu", "tesseract_pdf": "1", "tesseract_psm": "1", "types": "" }, "files_mindmap": { "enabled": "yes", "installed_version": "0.0.23", "types": "" }, "files_pdfviewer": { "enabled": "yes", "types": "", "installed_version": "2.0.1" }, "files_readmemd": { "auto_refresh": "false", "enabled": "no", "fileslist_footer": "[\"README\"]", "fileslist_header": "[\"HEADER\"]", "installed_version": "1.1.4", "show_asciidoc": "false", "show_html": "false", "show_title": "true", "types": "filesystem", "yellow_back": "true" }, "files_rightclick": { "types": "", "installed_version": "0.17.0" }, "files_sharing": { "enabled": "yes", "lookupServerEnabled": "yes", "types": "filesystem", "installed_version": "1.12.0" }, "files_texteditor": { "enabled": "no", "installed_version": "2.8.0", "types": "" }, "files_trashbin": { "enabled": "yes", "types": "filesystem,dav", "installed_version": "1.10.1" }, "files_versions": { "enabled": "yes", "types": "filesystem,dav", "installed_version": "1.13.0" }, "files_videoplayer": { "enabled": "yes", "types": "", "installed_version": "1.9.0" }, "firstrunwizard": { "enabled": "yes", "types": "logging", "installed_version": "2.9.0" }, "forms": { "enabled": "no", "installed_version": "1.0.3", "types": "" }, "fulltextsearch": { "app_navigation": "1", "cron_err_reset": "1582039885", "enabled": "no", "installed_version": "1.4.1", "provider_indexed": "{\"deck\":\"1\",\"files\":\"1\"}", "search_platform": "OCA\\FullTextSearch_ElasticSearch\\Platform\\ElasticSearchPlatform", "types": "" }, "fulltextsearch_elasticsearch": { "analyzer_tokenizer": "standard", "elastic_host": "http:\/\/localhost:9200", "elastic_index": "index2", "enabled": "no", "installed_version": "1.5.0", "types": "" }, "gallery": { "enabled": "no", "installed_version": "18.4.0", "types": "" }, "groupfolders": { "types": "filesystem,dav", "installed_version": "8.1.1", "enabled": "yes" }, "logreader": { "enabled": "yes", "types": "", "installed_version": "2.5.0", "levels": "11111" }, "lookup_server_connector": { "enabled": "yes", "types": "authentication", "installed_version": "1.8.0" }, "mail": { "types": "", "installed_version": "1.7.0", "enabled": "no" }, "maps": { "lastAddressLookup": "1605265151", "enabled": "yes", "types": "filesystem", "installed_version": "0.1.8" }, "metadata": { "enabled": "yes", "installed_version": "0.12.0", "types": "" }, "nextcloud_announcements": { "installed_version": "1.9.0", "enabled": "yes", "pub_date": "Thu, 24 Oct 2019 00:00:00 +0200", "types": "logging" }, "notifications": { "enabled": "yes", "types": "logging", "installed_version": "2.8.0" }, "oauth2": { "enabled": "yes", "types": "authentication", "installed_version": "1.8.0" }, "ocr": { "installed_version": "6.0.58", "enabled": "no", "types": "" }, "onlyoffice": { "DocumentServerInternalUrl": "", "DocumentServerUrl": "***REMOVED SENSITIVE VALUE***", "StorageUrl": "", "customizationChat": "true", "customizationCompactHeader": "true", "customizationFeedback": "true", "customizationHelp": "true", "customizationToolbarNoTabs": "true", "defFormats": "{\"csv\":\"false\",\"doc\":\"true\",\"docm\":\"false\",\"docx\":\"true\",\"dotx\":\"false\",\"epub\":\"false\",\"html\":\"false\",\"odp\":\"true\",\"ods\":\"true\",\"odt\":\"true\",\"pdf\":\"false\",\"potm\":\"false\",\"potx\":\"false\",\"ppsm\":\"false\",\"ppsx\":\"false\",\"ppt\":\"true\",\"pptm\":\"false\",\"pptx\":\"true\",\"rtf\":\"false\",\"txt\":\"false\",\"xls\":\"true\",\"xlsm\":\"false\",\"xlsx\":\"true\",\"xltm\":\"false\",\"xltx\":\"false\"}", "demo": "{\"available\":true,\"enabled\":false,\"start\":{\"date\":\"2020-02-18 15:35:01.692364\",\"timezone_type\":3,\"timezone\":\"UTC\"}}", "editFormats": "{\"csv\":\"true\",\"odp\":\"true\",\"ods\":\"true\",\"odt\":\"true\",\"rtf\":\"true\",\"txt\":\"true\"}", "enabled": "no", "installed_version": "6.1.0", "jwt_secret": "", "sameTab": "false", "settings_error": "", "types": "filesystem" }, "password_policy": { "enabled": "yes", "types": "authentication", "installed_version": "1.10.1" }, "photos": { "enabled": "yes", "types": "", "installed_version": "1.2.0" }, "privacy": { "enabled": "yes", "readableLocation": "de", "types": "", "installed_version": "1.4.0" }, "provisioning_api": { "enabled": "yes", "types": "prevent_group_restriction", "installed_version": "1.10.0" }, "rainloop": { "enabled": "yes", "installed_version": "7.0.3", "rainloop-autologin": "", "rainloop-autologin-with-email": "", "types": "" }, "recommendations": { "enabled": "yes", "types": "", "installed_version": "0.8.0" }, "richdocumentscode": { "enabled": "yes", "installed_version": "6.4.14", "types": "" }, "serverinfo": { "enabled": "yes", "types": "", "installed_version": "1.10.0" }, "settings": { "enabled": "yes", "types": "", "installed_version": "1.2.0" }, "sharebymail": { "enabled": "yes", "types": "filesystem", "installed_version": "1.10.0" }, "smb_test": { "enabled": "no", "installed_version": "0.2.3", "types": "" }, "socialsharing_twitter": { "enabled": "no", "installed_version": "1.0.4", "types": "" }, "spreed": { "has_reference_id": "yes", "project_access_invalidated": "1", "signaling_servers": "***REMOVED SENSITIVE VALUE***", "signaling_ticket_secret": "***REMOVED SENSITIVE VALUE***", "stun_servers": "***REMOVED SENSITIVE VALUE***", "turn_servers": "***REMOVED SENSITIVE VALUE***", "types": "prevent_group_restriction", "enabled": "yes", "installed_version": "10.0.3" }, "support": { "SwitchUpdaterServerHasRun": "yes", "enabled": "yes", "types": "session", "installed_version": "1.3.0" }, "survey_client": { "enabled": "yes", "types": "", "installed_version": "1.8.0" }, "systemtags": { "enabled": "yes", "types": "logging", "installed_version": "1.10.0" }, "tasks": { "types": "", "installed_version": "0.13.6" }, "text": { "enabled": "yes", "types": "dav", "installed_version": "3.1.0" }, "theming": { "cachebuster": "18", "color": "#2E576D", "enabled": "yes", "faviconMime": "image\/png", "logoMime": "image\/png", "name": "WINKEL + MANGELS", "slogan": "***REMOVED SENSITIVE VALUE***", "types": "logging", "url": "***REMOVED SENSITIVE VALUE***", "installed_version": "1.11.0" }, "timetracker": { "enabled": "no", "installed_version": "0.0.43", "types": "" }, "twofactor_backupcodes": { "enabled": "yes", "types": "", "installed_version": "1.9.0" }, "twofactor_u2f": { "enabled": "yes", "installed_version": "6.0.0", "types": "" }, "updatenotification": { "calendar": "2.0.3", "core": "19.0.3.1", "drawio": "0.9.7", "enabled": "yes", "extract": "1.2.5", "files_fulltextsearch": "1.3.6", "files_fulltextsearch_tesseract": "1.3.2", "files_mindmap": "0.0.21", "files_readmemd": "1.1.3", "files_rightclick": "0.15.1", "fulltextsearch": "1.3.8", "fulltextsearch_elasticsearch": "1.4.1", "groupfolders": "7.1.1", "mail": "1.4.1", "metadata": "0.12.0", "notes": "3.6.3", "ocr": "6.0.54", "onlyoffice": "4.3.0", "rainloop": "7.0.3", "richdocumentscode": "6.4.14", "spreed": "9.0.5", "timetracker": "0.0.42", "twofactor_u2f": "6.0.0", "types": "", "update_check_errors": "0", "w2g2": "3.0.3", "workflow_script": "1.3.2", "tasks": "0.13.6", "emlviewer": "0.0.21", "contacts": "3.4.2", "richdocuments": "3.7.10", "files_accesscontrol": "1.9.2", "deck": "1.2.2", "installed_version": "1.10.0" }, "user_status": { "types": "", "installed_version": "1.0.1", "enabled": "yes" }, "viewer": { "enabled": "yes", "types": "", "installed_version": "1.4.0" }, "w2g2": { "enabled": "yes", "installed_version": "3.0.3", "types": "" }, "weather_status": { "installed_version": "1.0.0", "types": "", "enabled": "yes" }, "workflow_script": { "types": "filesystem", "installed_version": "1.5.0", "enabled": "yes" }, "workflowengine": { "enabled": "yes", "types": "filesystem", "installed_version": "2.2.0" } } } ```

Are you using external storage, if yes which one: smb

Are you using encryption: no

Are you using an external user-backend, if yes which one: no

Client configuration

Browser: Firefox/83.0

Operating system: Windows NT 10.0

Logs

Nextcloud log (data/nextcloud.log)

Nextcloud log ``` {"reqId":"UmLoid6TuPueSkKcXeRM","level":3,"time":"2020-11-29T11:33:24+01:00","remoteAddr":,"user":,"app":"no app in context","method":"POST","url":"/ocs/v2.php/apps/files_sharing/api/v1/shares","message":{"Exception":"Exception","Message":"Call to a member function format() on bool","Code":0,"Trace":[{"file":"/var/www/html/nextcloud/lib/private/AppFramework/App.php","line":152,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/Route/Router.php","line":308,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/html/nextcloud/ocs/v1.php","line":88,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/html/nextcloud/ocs/v2.php","line":24,"args":["/var/www/html/nextcloud/ocs/v1.php"],"function":"require_once"}],"File":"/var/www/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","Line":110,"Previous":{"Exception":"Error","Message":"Call to a member function format() on bool","Code":0,"Trace":[{"file":"/var/www/html/nextcloud/apps/files_sharing/lib/Controller/ShareAPIController.php","line":622,"function":"formatShare","class":"OCA\\Files_Sharing\\Controller\\ShareAPIController","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":169,"function":"createShare","class":"OCA\\Files_Sharing\\Controller\\ShareAPIController","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":100,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/AppFramework/App.php","line":152,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/Route/Router.php","line":308,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/html/nextcloud/ocs/v1.php","line":88,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/html/nextcloud/ocs/v2.php","line":24,"args":["/var/www/html/nextcloud/ocs/v1.php"],"function":"require_once"}],"File":"/var/www/html/nextcloud/apps/files_sharing/lib/Controller/ShareAPIController.php","Line":231},"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:83.0) Gecko/20100101 Firefox/83.0","version":"20.0.2.2","id":"5fc37be2ae7ac"} ```
szaimen commented 3 years ago

As I cannot reproduce the original issue anymore, I will close this ticket. If this is still happening please make sure to upgrade to the latest version. After that, feel free to reopen. The latest version can be seen by checking https://nextcloud.com/install/#install-clients and https://nextcloud.com/install/#instructions-server respectively.