nextcloud / mail

💌 Mail app for Nextcloud
https://apps.nextcloud.com/apps/mail
GNU Affero General Public License v3.0
848 stars 261 forks source link

Wrong API URL Call in "Add share link from Cloud Name Files" in Mail App #5307

Closed mepsteinj closed 3 years ago

mepsteinj commented 3 years ago

When You I want to share a link to a file in the Mail App, the generated API URL is wrong, for example (Please note the "v1shares". no slash between v1 and shares): https://cloud.domain.cl/ocs/v2.php/apps/files_sharing/api/v1shares This URL give you a 404 error. The correct URL must be: https://cloud.domain.cl/ocs/v2.php/apps/files_sharing/api/v1/shares

Note: Browser log at the end.

Steps to reproduce

  1. Open the Mail App and write a new mail
  2. Click on "Add share link from Cloud Name Files"
  3. Select a file and click "Choose"

Expected behaviour

Add a link to shared file in the email.

Actual behaviour

Error: Error while sharing file

Server configuration

Operating system: Debian 10

Web server: Nginx 1.14.2

Database: MariaDB

PHP version: 7.3

Nextcloud version: 21.0.3

Updated from an older Nextcloud/ownCloud or fresh install: Updated fron 20.x

Where did you install Nextcloud from:

Signing status:

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

List of activated apps:

App list ``` Enabled: - accessibility: 1.7.0 - activity: 2.14.3 - announcementcenter: 5.0.0 - bruteforcesettings: 2.2.0 - calendar: 2.3.0 - cloud_federation_api: 1.4.0 - comments: 1.11.0 - contacts: 4.0.0 - dashboard: 7.1.0 - dav: 1.17.1 - federatedfilesharing: 1.11.0 - federation: 1.11.0 - files: 1.16.0 - files_pdfviewer: 2.1.0 - files_rightclick: 1.0.0 - files_sharing: 1.13.1 - files_trashbin: 1.11.0 - files_versions: 1.14.0 - files_videoplayer: 1.10.0 - impersonate: 1.8.0 - logreader: 2.6.0 - lookup_server_connector: 1.9.0 - mail: 1.10.0 - maps: 0.1.9 - notifications: 2.9.0 - oauth2: 1.9.0 - password_policy: 1.11.0 - photos: 1.3.0 - privacy: 1.5.0 - provisioning_api: 1.11.0 - recommendations: 1.0.0 - richdocuments: 4.2.0 - serverinfo: 1.11.0 - settings: 1.3.0 - sharebymail: 1.11.0 - socialsharing_email: 2.2.0 - spreed: 11.2.2 - systemtags: 1.11.0 - text: 3.2.0 - theming: 1.12.0 - twofactor_backupcodes: 1.10.0 - updatenotification: 1.11.0 - user_ispconfig: 0.4.9 - user_status: 1.1.1 - viewer: 1.5.0 - weather_status: 1.1.0 - workflowengine: 2.3.0 Disabled: - admin_audit - contactsinteraction - encryption - files_external - firstrunwizard - nextcloud_announcements - support - survey_client - user_ldap ```

Nextcloud configuration:

Config report ``` "system": { "instanceid": "***REMOVED SENSITIVE VALUE***", "passwordsalt": "***REMOVED SENSITIVE VALUE***", "secret": "***REMOVED SENSITIVE VALUE***", "trusted_domains": [ "cloud.domain.cl" ], "datadirectory": "***REMOVED SENSITIVE VALUE***", "dbtype": "mysql", "version": "21.0.3.1", "overwrite.cli.url": "https:\/\/cloud.domain.cl", "dbname": "***REMOVED SENSITIVE VALUE***", "dbhost": "***REMOVED SENSITIVE VALUE***", "dbport": "", "dbtableprefix": "oc_", "mysql.utf8mb4": true, "dbuser": "***REMOVED SENSITIVE VALUE***", "dbpassword": "***REMOVED SENSITIVE VALUE***", "installed": true, "filelocking.enabled": true, "memcache.local": "\\OC\\Memcache\\Redis", "memcache.distributed": "\\OC\\Memcache\\Redis", "memcache.locking": "\\OC\\Memcache\\Redis", "redis": { "host": "***REMOVED SENSITIVE VALUE***", "port": 0, "timeout": 0 }, "overwriteprotocol": "https", "preview_max_x": 1024, "preview_max_y": 768, "default_language": "es_ES", "default_locale": "es_CL", "default_phone_region": "CL", "htaccess.RewriteBase": "\/", "maintenance": false, "theme": "", "loglevel": 3, "logtimezone": "America\/Santiago", "log_rotate_size": 6553600, "blacklisted_files": [ ".htaccess", "Thumbs.db" ], "enabledPreviewProviders": [ "OC\\Preview\\PNG", "OC\\Preview\\JPEG", "OC\\Preview\\GIF", "OC\\Preview\\HEIC", "OC\\Preview\\BMP", "OC\\Preview\\XBitmap", "OC\\Preview\\MP3", "OC\\Preview\\TXT", "OC\\Preview\\MarkDown", "OC\\Preview\\OpenDocument", "OC\\Preview\\Krita", "OC\\Preview\\PDF" ], "knowledgebaseenabled": false, "skeletondirectory": "\/var\/www\/cloud\/skeleton", "trashbin_retention_obligation": "auto, 7", "defaultapp": "dashboard", "mail_smtpmode": "smtp", "mail_smtpsecure": "tls", "mail_sendmailmode": "smtp", "mail_from_address": "***REMOVED SENSITIVE VALUE***", "mail_domain": "***REMOVED SENSITIVE VALUE***", "mail_smtpauthtype": "LOGIN", "mail_smtpauth": 1, "mail_smtphost": "***REMOVED SENSITIVE VALUE***", "mail_smtpport": "587", "mail_smtpname": "***REMOVED SENSITIVE VALUE***", "mail_smtppassword": "***REMOVED SENSITIVE VALUE***", "activity_expire_days": 14, "app_install_overwrite": [ "user_ispconfig" ], "user_backends": [ { "class": "OC_User_ISPCONFIG", "arguments": [ "https:\/\/mail.domain.cl:8080\/remote\/index.php", "https:\/\/mail.domain.cl:8080\/remote\/", "user", "pass", { "map_uids": false, "allowed_domains": [ "domain.cl", "domain2.cl" ], "default_groups": [ "Global" ], "domain_config": { "domain.cl": { "groups": [ "domain" ] }, "domain2.cl": { "groups": [ "domain2" ] } } } ] } ] } } ```

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: ISPConfig

Client configuration

Browser: Firefox 89.0.2 (64-bit)

Operating system: Debian 10

Logs

Web server error log

Web server error log ``` No error ```

Nextcloud log (data/nextcloud.log)

Nextcloud log ``` No error ```

Browser log

Browser log ``` 1- XHR POST https://cloud.domain.cl/ocs/v2.php/apps/files_sharing/api/v1shares [HTTP/2 404 Not Found 283ms] 2- Error while sharing file: Unknown error FileSharingService.js:58:11 3- [ERROR] mail: could not choose a file as attachment link Object { app: "mail", uid: "user@domain.cl", error: Error } ```
st3iny commented 3 years ago

Thanks for the report. This regression is most likely caused by the recent update of nextcloud/router to v2. We had a similar issue in calendar.

Ref https://github.com/nextcloud/calendar/issues/3262 Fix needed is similar to https://github.com/nextcloud/calendar/pull/3263