nextcloud / deck

🗂 Kanban-style project & personal management tool for Nextcloud, similar to Trello
https://apps.nextcloud.com/apps/deck
GNU Affero General Public License v3.0
1.22k stars 279 forks source link

Experiencing problems linking, when non-latin characters are used in card titles and exceed certain length #2780

Open frankmayer opened 3 years ago

frankmayer commented 3 years ago

Note: This issue might also apply to deck titles, and could as well be a general problem of nextcloud. I have not checked it yet, but I guess it will show, if the problem lies deeper in some common API

Steps to reproduce

Create a card with a title "αβγδεζηθικλμνξοπρστυφχψωαβγδεζηθι" (That is 34 greek characters) try to link this card to anything, a deck, a card, a file, or a conversation. It will fail.

For reference, if you remove the last character, making the length 33, linking to the other objects works as expected.

Note: It looks like there might be an encoding issue here, as for example url encoded characters like these, would eat up 99 characters in the case of a 33 character string of non-latin characters and 102 in the case of 34 non-latin characters. This might be a combination of problems - the first being the characters being counted wrong due to encoding issues, and the second being an imposed limit of 100 characters, which, i think, was the hard limit for titles in the past.

Expected behaviour

Link should complete

Actual behaviour

Link fails responding with "Failed to create a project" in the UI. See browser log below for related network info.

Server configuration detail

Operating system: Linux 5.4.0-65-generic 73-Ubuntu SMP Mon Jan 18 17:25:17 UTC 2021 x86_64

Webserver: Apache/2.4.38 (Debian) (apache2handler)

Database: mysql 10.5.8

PHP version:

7.4.14 Modules loaded: Core, date, libxml, openssl, pcre, sqlite3, zlib, ctype, curl, dom, fileinfo, filter, ftp, hash, iconv, json, mbstring, SPL, PDO, session, posix, Reflection, standard, SimpleXML, pdo_sqlite, Phar, tokenizer, xml, xmlreader, xmlwriter, mysqlnd, apache2handler, apcu, bcmath, exif, gd, gmp, imagick, intl, ldap, memcached, pcntl, pdo_mysql, pdo_pgsql, redis, sodium, zip, Zend OPcache

Nextcloud version: 20.0.6 - 20.0.6.1

Updated from an older Nextcloud/ownCloud or fresh install:

Where did you install Nextcloud from: unknown

Signing status Array ( )
List of activated apps ``` Enabled: - accessibility: 1.6.0 - activity: 2.13.4 - announcementcenter: 4.0.1 - appointments: 1.8.1 - apporder: 0.11.0 - breezedark: 20.0.3 - bruteforcesettings: 2.0.1 - calendar: 2.1.3 - circles: 0.20.6 - cloud_federation_api: 1.3.0 - comments: 1.10.0 - contacts: 3.4.3 - contactsinteraction: 1.1.0 - dashboard: 7.0.0 - dav: 1.16.2 - deck: 1.2.4 - epubreader: 1.4.5 - event_update_notification: 1.2.0 - external: 3.7.2 - federatedfilesharing: 1.10.2 - federation: 1.10.1 - files: 1.15.0 - files_automatedtagging: 1.10.1 - files_markdown: 2.3.1 - files_mindmap: 0.0.24 - files_pdfviewer: 2.0.1 - files_retention: 1.9.0 - files_rightclick: 0.17.0 - files_sharing: 1.12.2 - files_texteditor: 2.14.0 - files_trashbin: 1.10.1 - files_versions: 1.13.0 - files_videoplayer: 1.9.0 - firstrunwizard: 2.9.0 - flow_notifications: 1.0.3 - flowupload: 1.1.2 - forms: 2.1.0 - groupfolders: 8.2.0 - impersonate: 1.7.0 - issuetemplate: 0.7.0 - logreader: 2.5.0 - lookup_server_connector: 1.8.0 - nextcloud_announcements: 1.9.0 - notes: 3.5.1 - notifications: 2.8.0 - oauth2: 1.8.0 - password_policy: 1.10.1 - pdfdraw: 0.1.2 - photos: 1.2.3 - polls: 1.7.5 - privacy: 1.4.0 - provisioning_api: 1.10.0 - quicknotes: 0.6.3 - quota_warning: 1.9.1 - recommendations: 0.8.0 - richdocuments: 3.7.14 - richdocumentscode: 6.4.403 - serverinfo: 1.10.0 - settings: 1.2.0 - sharebymail: 1.10.0 - side_menu: 1.22.0 - socialsharing_email: 2.1.0 - socialsharing_facebook: 2.1.0 - socialsharing_twitter: 2.1.0 - spreed: 10.0.5 - support: 1.3.0 - survey_client: 1.8.0 - systemtags: 1.10.0 - talk_simple_poll: 1.2.0 - tasks: 0.13.6 - theming: 1.11.0 - twofactor_backupcodes: 1.9.0 - updatenotification: 1.10.0 - user_saml: 3.3.4 - user_status: 1.0.1 - viewer: 1.4.0 - weather_status: 1.0.0 - whiteboard: 0.0.3 - workflowengine: 2.2.0 Disabled: - admin_audit - encryption - files_external - hsts - registration - text - twofactor_email - twofactor_nextcloud_notification - user_ldap - workflow_script ```
Configuration (config/config.php) ``` { "htaccess.RewriteBase": "\/", "memcache.local": "\\OC\\Memcache\\APCu", "apps_paths": [ { "path": "\/var\/www\/html\/apps", "url": "\/apps", "writable": false }, { "path": "\/var\/www\/html\/custom_apps", "url": "\/custom_apps", "writable": true } ], "instanceid": "***REMOVED SENSITIVE VALUE***", "passwordsalt": "***REMOVED SENSITIVE VALUE***", "secret": "***REMOVED SENSITIVE VALUE***", "trusted_domains": [ "kgtz-nextcloud.frankmayer.net" ], "datadirectory": "***REMOVED SENSITIVE VALUE***", "dbtype": "mysql", "version": "20.0.6.1", "overwrite.cli.url": "http:\/\/kgtz-nextcloud.frankmayer.net", "dbname": "***REMOVED SENSITIVE VALUE***", "dbhost": "***REMOVED SENSITIVE VALUE***", "dbport": "", "dbtableprefix": "oc_", "mysql.utf8mb4": true, "dbuser": "***REMOVED SENSITIVE VALUE***", "dbpassword": "***REMOVED SENSITIVE VALUE***", "installed": true, "overwriteprotocol": "https", "mail_smtpmode": "smtp", "mail_smtpsecure": "tls", "mail_sendmailmode": "smtp", "mail_from_address": "***REMOVED SENSITIVE VALUE***", "mail_smtpauthtype": "LOGIN", "mail_smtpauth": 1, "mail_smtphost": "***REMOVED SENSITIVE VALUE***", "mail_smtpport": "25", "mail_smtpname": "***REMOVED SENSITIVE VALUE***", "mail_smtppassword": "***REMOVED SENSITIVE VALUE***", "mail_domain": "***REMOVED SENSITIVE VALUE***", "maintenance": false, "app_install_overwrite": [ "joplin", "documents" ], "updater.secret": "***REMOVED SENSITIVE VALUE***" } ```

Are you using external storage, if yes which one: local/smb/sftp/...

Are you using encryption:

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...

Client configuration

Browser: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:84.0) Gecko/20100101 Firefox/84.0

Operating system:

Logs

Web server error log ``` Insert your web server log here ```
Nextcloud log ``` Insert your Nextcloud log here ```
Browser log When linking succeeds, there are 2 consecutive successful calls to the server. in my case: Request URL: https://ADDRESS__/ocs/v2.php/collaboration/resources/deck-card/50?format=json Request Method: POST Status Code: 200 Referrer Policy: no-referrer cache-control: no-cache, no-store, must-revalidate content-encoding: gzip content-length: 291 content-security-policy: default-src 'none';base-uri 'none';manifest-src 'self';frame-ancestors 'none' content-type: application/json; charset=utf-8 with payload: {name: "αβγδεζηθικλμνξοπρστυφχψωαβγδεζηθ"} Response {"ocs":{"meta":{"status":"ok","statuscode":200,"message":"OK"},"data":{"id":45,"name":"\u03b1\u03b2\u03b3\u03b4\u03b5\u03b6\u03b7\u03b8\u03b9\u03ba\u03bb\u03bc\u03bd\u03be\u03bf\u03c0\u03c1\u03c3\u03c4\u03c5\u03c6\u03c7\u03c8\u03c9\u03b1\u03b2\u03b3\u03b4\u03b5\u03b6\u03b7\u03b8","resources":[{"type":"deck-card","id":"50","name":"IT (\u039c\u03b7\u03c7\u03b1\u03bd\u03bf\u03c1\u03b3\u03ac\u03bd\u03c9\u03c3\u03b7): \u03b1\u03b2\u03b3\u03b4\u03b5\u03b6\u03b7\u03b8\u03b9\u03ba\u03bb\u03bc\u03bd\u03be\u03bf\u03c0\u03c1\u03c3\u03c4\u03c5\u03c6\u03c7\u03c8\u03c9\u03b1\u03b2\u03b3\u03b4\u03b5\u03b6\u03b7\u03b8","link":"\/apps\/deck\/#\/board\/26\/card\/50","iconUrl":"\/core\/img\/actions\/toggle-pictures.svg"}]}}} and Request URL: https://ADDRESS__/ocs/v2.php/collaboration/resources/collections/45?format=json Request Method: POST Status Code: 200 Referrer Policy: no-referrer cache-control: no-cache, no-store, must-revalidate content-encoding: gzip content-length: 334 content-security-policy: default-src 'none';base-uri 'none';manifest-src 'self';frame-ancestors 'none' content-type: application/json; charset=utf-8 with payload: "{resourceType: "deck-card", resourceId: "46"}" and response: {"ocs":{"meta":{"status":"ok","statuscode":200,"message":"OK"},"data":{"id":45,"name":"\u03b1\u03b2\u03b3\u03b4\u03b5\u03b6\u03b7\u03b8\u03b9\u03ba\u03bb\u03bc\u03bd\u03be\u03bf\u03c0\u03c1\u03c3\u03c4\u03c5\u03c6\u03c7\u03c8\u03c9\u03b1\u03b2\u03b3\u03b4\u03b5\u03b6\u03b7\u03b8","resources":[{"type":"deck-card","id":"50","name":"IT (\u039c\u03b7\u03c7\u03b1\u03bd\u03bf\u03c1\u03b3\u03ac\u03bd\u03c9\u03c3\u03b7): \u03b1\u03b2\u03b3\u03b4\u03b5\u03b6\u03b7\u03b8\u03b9\u03ba\u03bb\u03bc\u03bd\u03be\u03bf\u03c0\u03c1\u03c3\u03c4\u03c5\u03c6\u03c7\u03c8\u03c9\u03b1\u03b2\u03b3\u03b4\u03b5\u03b6\u03b7\u03b8","link":"\/apps\/deck\/#\/board\/26\/card\/50","iconUrl":"\/core\/img\/actions\/toggle-pictures.svg"},{"type":"deck-card","id":"46","name":"\u03a0\u03c1\u03bf\u03c3\u03c9\u03c0\u03b9\u03ba\u03ac: test file link","link":"\/apps\/deck\/#\/board\/8\/card\/46","iconUrl":"\/core\/img\/actions\/toggle-pictures.svg"}]}}} When it fails, there is only the first request which gets executed and receives a 400 error Request URL: https://ADDRESS__/ocs/v2.php/collaboration/resources/deck-card/50?format=json Request Method: POST Status Code: 400 Referrer Policy: no-referrer cache-control: no-cache, no-store, must-revalidate content-length: 79 content-security-policy: default-src 'none';base-uri 'none';manifest-src 'self';frame-ancestors 'none' content-type: application/json; charset=utf-8 with payload: "{name: "αβγδεζηθικλμνξοπρστυφχψωαβγδεζηθι"}" and response: "{"ocs":{"meta":{"status":"failure","statuscode":400,"message":null},"data":[]}}"
Henschwen commented 3 years ago

I am struggling with a similar issue. To my understanding the problem here is the character of this "project"-feature in order to link a file or sth else. Such a "project" gets created and named exactly the same name that the card has. And this is absolutely not helpful to me. What is the reason to create this "projects"? I would suggest to: A) remove this feature. I want to create a link to a card, a file or a conversation, but NOT an additional "item/project" B) If the projects are necessary for things I don't understand -> keep them, but stop to give them name of the card automatically. The possibility to rename them afterwards exists already anyway. Or maybe cut the name down automatically to a max number of characters or cut out characters that are not supported? Instead of simply telling the user "Failed to create a project". It took me a while to figure out why I can't link a file as usually ...

Sorry in case I might sound rough! I like the whole Deck application a lot and want to give constructive feedback. Thanks for your good work Cheers

frankmayer commented 3 years ago

@Henschwen thanks for your comment. If I understand you correctly, the issue you are having is also somehow related to the underlying problem of non-latin characters. However I fail to understand on what issue you are referring to in relation to the "project". I am not exactly sure on that, but if you have a "design/implementation" issue of a specific workflow, it would probably not fall into this issue, which seems to be a bug somewhere. You might want to additionaly open a separate issue concerning that, in order to get it registered by the community / the devs.

Henschwen commented 3 years ago

thank you for the reply @frankmayer

yes you are probably right, I guess I will open a design/implementation issue soon when I find the time.

Just quickly here an explanation why I think that these problems are linked and what this "project" is that I was referring to: grafik

  1. this is where I click to create links to documents etc ... thats where the term "project" comes from
  2. such a "project" gets created and is getting the same name that the card has (in this case: test). Once it is created, I can rename it via the three dots on the right. but in case that the name of the card is too long -> the "project" can't be created at all (and so there is no link at all)
  3. IN this "project" there are two links showing up. The link to the original card I am currently in (3.) and the link to the card/document that I wanted to link to initially (4.)

So I actually don't need the "project" (2) and the link to the current card (3) at all. This would be the "design" issue. But also the fact that this clumsy "project" gets created seems to be the reason for me that the issue with the error because of the # of characters etc is showing up (also for you?)

And right now I am also wondering if this looks / works any different for you!?

frankmayer commented 3 years ago

@Henschwen, so I did a few tests. I agree that the term "Project" might be misleading. But what is meant by that is that the current card IS the project and you are being given the opportunity to link other items (cards, decks, files) to that "Project", which is in fact the current card.

However, it's only a definition. There is no actual project being created by default, so not even one with the same name as the card. I made two cards and tried to link one to another, while watching the network log in the browser. In the first scenario I am showing the logs, having the problem with non-latin characters, and in the second the logs without the issue:

First scenario: a post request is made, which fails, because of the character problem reported in this issue. First POST request: ` call to MY_NC_SERVER/ocs/v2.php/collaboration/resources/deck-card/60?format=json Request payload: {"name":"αβγδεζηθικλμνξοπρστυφχψωαβγδεζηθι"}

Response: ocs Object { meta: {…}, data: [] } meta Object { status: "failure", statuscode: 400, message: null } status "failure" statuscode 400 message null data [] `

Second scenario: a post request is made (having less characters ), which is successful and followed up by a second post request which actually makes the link between the items.

First POST request: ` call to MY_NC_SERVER/ocs/v2.php/collaboration/resources/collections/48?format=json Request payload: {"name":"αβγδεζηθικλμνξοπρστυφχψωαβγδε"}

Response: ocs Object { meta: {…}, data: {…} }
meta Object { status: "ok", statuscode: 200, message: "OK" }
status "ok"
statuscode 200
message "OK"
data Object { id: 48, name: "αβγδεζηθικλμνξοπρστυφχψωαβγδε", resources: […] }
id 48
name "αβγδεζηθικλμνξοπρστυφχψωαβγδε"
resources [ {…} ]
0 Object { type: "deck-card", id: "60", name: "Προσωπικά: αβγδεζηθικλμνξοπρστυφχψωαβγδε", … }
type "deck-card"
id "60"
name "Προσωπικά: αβγδεζηθικλμνξοπρστυφχψωαβγδε"
link "/apps/deck/#/board/8/card/60"
iconUrl "/core/img/actions/toggle-pictures.svg"

`

Second POST request: `call to MY_NC_SERVER/ocs/v2.php/collaboration/resources/deck-card/60?format=json Request payload: {"resourceType":"deck-card","resourceId":"46"}

Response:

ocs Object { meta: {…}, data: {…} }
meta Object { status: "ok", statuscode: 200, message: "OK" }
status "ok"
statuscode 200
message "OK"
data Object { id: 48, name: "αβγδεζηθικλμνξοπρστυφχψωαβγδε", resources: […] }
id 48
name "αβγδεζηθικλμνξοπρστυφχψωαβγδε"
resources [ {…}, {…} ]
0 Object { type: "deck-card", id: "60", name: "Προσωπικά: αβγδεζηθικλμνξοπρστυφχψωαβγδε", … }
type "deck-card"
id "60"
name "Προσωπικά: αβγδεζηθικλμνξοπρστυφχψωαβγδε"
link "/apps/deck/#/board/8/card/60"
iconUrl "/core/img/actions/toggle-pictures.svg"
1 Object { type: "deck-card", id: "46", name: "Προσωπικά: test file link", … }
type "deck-card"
id "46"
name "Προσωπικά: test file link"
link "/apps/deck/#/board/8/card/46"
iconUrl "/core/img/actions/toggle-pictures.svg"`

So, for the binding of the two items to take place, some consecutive action (2 POSTs) is required. Since the first one is failing, the second one is not executed. Unfortunately atm I don't have the time to look more into the inner workings of deck or probably NC itself, as I more and more get the feeling, that this is a central NC issue, not necessarily a "Deck" one.

So your problem has the same root as mine :) however, I hope I cleared up the confusion about the "Project".