Skip to content
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

Cannot receive a federated share of a file with name > 64 characters #36730

phil-davis opened this issue Jan 9, 2020 · 2 comments · Fixed by #37835

Cannot receive a federated share of a file with name > 64 characters #36730

phil-davis opened this issue Jan 9, 2020 · 2 comments · Fixed by #37835


Copy link

Steps to reproduce

  1. have a federated server with any database other than SQlite
  2. run the test scenario tests/acceptance/features/webUISharingExternal/federationSharing.feature:310
  Scenario: test sharing long file names with federation share                                                                                                                 # /drone/src/tests/acceptance/features/webUISharingExternal/federationSharing.feature:310
    When user "user1" moves file "/lorem.txt" to "/averylongfilenamefortestingthatfileswithlongfilenamescannotbeshared.txt" using the WebDAV API                               # FeatureContext::userMovesFileUsingTheAPI()
    And the user has reloaded the current page of the webUI                                                                                                                    # WebUIGeneralContext::theUserReloadsTheCurrentPageOfTheWebUI()
    And the user shares file "averylongfilenamefortestingthatfileswithlongfilenamescannotbeshared.txt" with remote user "user1@%remote_server_without_scheme%" using the webUI # WebUISharingContext::theUserSharesFileFolderWithUserUsingTheWebUI()
    And user "user1" re-logs in to "%remote_server%" using the webUI                                                                                                           # WebUILoginContext::theUserRelogsInToUsingTheWebUI()
    And the user accepts the offered remote shares using the webUI                                                                                                             # WebUISharingContext::theUserAcceptsTheOfferedRemoteShares()
    And using server "REMOTE"                                                                                                                                                  # FeatureContext::usingServer()
    Then as "user1" file "/averylongfilenamefortestingthatfileswithlongfilenamescannotbeshared.txt" should exist                                                               # FeatureContext::asFileOrFolderShouldExist()
      file '/averylongfilenamefortestingthatfileswithlongfilenamescannotbeshared.txt' expected to exist but not found
      Failed asserting that false is true.

Expected behaviour

The user on the federated server can accept the incoming share and see the file.

Actual behaviour

{"reqId":"MNjuD6efk4bQzUZUI28E","level":3,"time":"2020-01-09T09:04:25+00:00","remoteAddr":"","user":"--","app":"federatefilesharing","method":"POST","url":"\/apps\/federatedfilesharing\/shares","message":"server can not add remote share, An exception occurred while executing 'INSERT INTO `oc_share_external` (`remote`,`share_token`,`password`,`name`,`owner`,`user`,`mountpoint`,`mountpoint_hash`,`accepted`,`remote_id`) SELECT ?,?,?,?,?,?,?,?,?,? FROM `oc_share_external` WHERE `user` = ? AND `mountpoint_hash` = ? HAVING COUNT(*) = 0' with params [\"https:\\\/\\\/server\", \"o0lYJCHDZxac8Is\", \"\", \"\\\/averylongfilenamefortestingthatfileswithlongfilenamescannotbeshared.txt\", \"user1\", \"user1\", \"{{TemporaryMountPointName#\\\/averylongfilenamefortestingthatfileswithlongfilenamescannotbeshared.txt}}\", \"4179477e980fad7ebbfdfebc56ca24c8\", 0, \"14\", \"user1\", \"4179477e980fad7ebbfdfebc56ca24c8\"]:\n\nSQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'name' at row 1"}

Server configuration

Current core master CI

Copy link
Contributor Author

phil-davis commented Jan 9, 2020

This was noticed in PR #36725
Previously we were using SQlite as the database on the federated server. That does not enforce table column length. Now we are using MariaDB/MySQL and we notice the problem. defines the max length of the name to be 64 chars - why?

Copy link
Contributor Author

I searched for an existing issue like this, and I am surprised that nobody has already reported this.
Feel free to point me to an existing issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

Successfully merging a pull request may close this issue.

1 participant