server icon indicating copy to clipboard operation
server copied to clipboard

[Bug]: NC 28.0.2 RC5 Trying to set expiration date for share – NC claims it's in the past

Open cetcondor opened this issue 1 year ago • 8 comments

⚠️ This issue respects the following points: ⚠️

Bug description

When trying to create a share with an expiration date, it fails. Nextcloud claims the date would be in the past, but it actually is in the future.

Steps to reproduce

  1. Create a share
  2. Try picking an expiration date for the share
  3. Saving won't work, because Nextcloud says the date is in the past, even though picked date isn't Bildschirmfoto vom 2024-01-31 18-19-40

Expected behavior

Expiration date should be saved

Installation method

None

Nextcloud Server version

28

Operating system

None

PHP engine version

PHP 8.2

Web server

Apache (supported)

Database engine version

MariaDB

Is this bug present after an update or on a fresh install?

Updated from a MINOR version (ex. 22.1 to 22.2)

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

What user-backends are you using?

  • [X] Default user-backend (database)
  • [ ] LDAP/ Active Directory
  • [ ] SSO - SAML
  • [ ] Other

Configuration report

{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "***REMOVED SENSITIVE VALUE***"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "28.0.2.4",
        "overwrite.cli.url": "***REMOVED SENSITIVE VALUE***",
        "overwriteprotocol": "https",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "skeletondirectory": "",
        "default_language": "de",
        "default_locale": "de_DE",
        "default_phone_region": "DE",
        "minimum.supported.desktop.version": "3.5.3",
        "activity_expire_days": 90,
        "filelocking.enabled": "true",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 6379
        },
        "htaccess.RewriteBase": "\/",
        "updater.release.channel": "stable",
        "maintenance": false,
        "theme": "",
        "loglevel": 3,
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpmode": "smtp",
        "mail_sendmailmode": "smtp",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauth": 1,
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "587",
        "mail_smtpsecure": "tls",
        "mail_smtpauthtype": "LOGIN",
        "app_install_overwrite": [
            "drawio",
            "deck"
        ]
    }
}

List of activated Apps

Enabled:
  - activity: 2.20.0
  - admin_audit: 1.18.0
  - bruteforcesettings: 2.8.0
  - calendar: 4.6.4
  - circles: 28.0.0-dev
  - cloud_federation_api: 1.11.0
  - comments: 1.18.0
  - contacts: 5.5.1
  - contactsinteraction: 1.9.0
  - dashboard: 7.8.0
  - dav: 1.29.1
  - deck: 1.12.1
  - drawio: 3.0.2
  - federatedfilesharing: 1.18.0
  - files: 2.0.0
  - files_antivirus: 5.4.1
  - files_lock: 28.0.1
  - files_mindmap: 0.0.30
  - files_pdfviewer: 2.9.0
  - files_reminders: 1.1.0
  - files_sharing: 1.20.0
  - files_trashbin: 1.18.0
  - files_versions: 1.21.0
  - forms: 4.0.0
  - groupfolders: 16.0.3
  - holiday_calendars: 0.3.0
  - logreader: 2.13.0
  - lookup_server_connector: 1.16.0
  - mail: 3.5.5
  - notes: 4.9.2
  - notifications: 2.16.0
  - oauth2: 1.16.3
  - password_policy: 1.18.0
  - photos: 2.4.0
  - polls: 6.0.1
  - provisioning_api: 1.18.0
  - quota_warning: 1.18.0
  - recommendations: 2.0.0
  - related_resources: 1.3.0
  - richdocuments: 8.3.1
  - serverinfo: 1.18.0
  - settings: 1.10.1
  - sharebymail: 1.18.0
  - spreed: 18.0.3
  - systemtags: 1.18.0
  - tasks: 0.15.0
  - terms_of_service: 2.3.2
  - text: 3.9.1
  - theming: 2.3.0
  - twofactor_backupcodes: 1.17.0
  - updatenotification: 1.18.0
  - user_status: 1.8.1
  - viewer: 2.2.0
  - weather_status: 1.8.0
  - workflowengine: 2.10.0
Disabled:
  - encryption: 2.16.0
  - externalpassword: 1.1.0 (installed 1.1.0)
  - federation: 1.18.0 (installed 1.14.0)
  - files_external: 1.20.0
  - firstrunwizard: 2.17.0 (installed 2.8.0)
  - nextcloud_announcements: 1.17.0 (installed 1.13.0)
  - privacy: 1.12.0 (installed 1.8.0)
  - ransomware_protection: 1.14.0 (installed 1.14.0)
  - support: 1.11.0 (installed 1.7.0)
  - survey_client: 1.16.0 (installed 1.12.0)
  - suspicious_login: 6.0.0 (installed 4.3.0)
  - twofactor_totp: 10.0.0-beta.2
  - user_ldap: 1.19.0

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

Exception OCA\Files_Sharing\Controller\ShareAPIController::parseDate(): Argument #1 ($expireDate) must be of type string, DateTime given, called in /***REMOVED SENSITIVE VALUE***/apps/files_sharing/lib/Controller/ShareAPIController.php on line 837 in file '/***REMOVED SENSITIVE VALUE***/apps/files_sharing/lib/Controller/ShareAPIController.php' line 1695
Exception thrown: Exception

Additional info

No response

cetcondor avatar Jan 31 '24 17:01 cetcondor

cc @Fenn-CS

szaimen avatar Jan 31 '24 18:01 szaimen

Could be related to : https://github.com/nextcloud/server/issues/42453 not sure yet.

nfebe avatar Jan 31 '24 18:01 nfebe

Just upgraded from 27.1.6 to 28.0.2 and I can confirm the problem which didn't exist in 27 as we use that feature quite frequently.

pierr0t avatar Feb 02 '24 14:02 pierr0t

I have my installation set to create a default expiration. I guess what's happening with mine is that I can't update the expiration date to a different value when I "customize link". (Note: I don't see an error message. But when I go back in to look at the link, the expiration date hasn't changed.)

manumitted avatar Feb 02 '24 15:02 manumitted

@manumitted that is handled in https://github.com/nextcloud/server/issues/43256

susnux avatar Feb 03 '24 13:02 susnux

I have the same issue. Behaviour demonstrated in https://youtu.be/3bly3t_dESs

The-Judge avatar Feb 09 '24 10:02 The-Judge

cc @nextcloud/server-frontend

szaimen avatar Feb 15 '24 16:02 szaimen

A fix is in its way here: https://github.com/nextcloud/server/pull/43428

artonge avatar Feb 15 '24 16:02 artonge

In addition to the "expiration date is in the past" error, the UI should display the date according to the configured locale in the user settings. The "set expiration date" input renders the date in US format mm/dd/yyyy for me, even though I have set my language to "English/Australia" (which uses the dd.mm.yyyy format).

mathansen avatar Feb 19 '24 14:02 mathansen

Can confirm it is possible to set a expiration date again in 28.0.3 RC2, but:

Each time the date is updated (or shown) one day goes missing; e.g. setting it to 31.03.2024 - save - press F5 to refresh the page - open settings again - settings show 30.03.2024. This only happens when the page is refreshed, so it might be a bug in the timezone conversion when loading the data from the backend?

MalteP avatar Feb 23 '24 09:02 MalteP

Hi, I consider this bug critical for the following reason : the error message is barely visible, and the sharing panel closes as if the operation was successful. It happened several times that I share a folder with a password and at the same time setting an expiration date. The result is that both fail, and I didn't realise that the folder was shared without password... :-/

ccomb avatar Feb 25 '24 19:02 ccomb

The fix has been merged in master. The backport for stable28 is ready: https://github.com/nextcloud/server/pull/43833 Any test is welcome :)

Altahrim avatar Feb 27 '24 08:02 Altahrim

I just tested with 28.0.3 bug is partially fixed. If you dont set a date and press save it will say it is set in the past. If you in the settings say a date 7 days ahead it will work. If you set just one day forward it will say date set in the past.

Screenshot from 2024-02-29 17-48-02 Screenshot from 2024-02-29 17-50-25

small1 avatar Feb 29 '24 16:02 small1

@Fenn-CS can you handle that as a follow up of your rewrite?

artonge avatar Feb 29 '24 17:02 artonge

https://github.com/nextcloud/server/pull/43833 wasn't included in 28.0.3. It was merged too late since second RC was already out.

Altahrim avatar Mar 01 '24 08:03 Altahrim