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

Legitimate mp3 filenames fail to playback. #562

Closed
chris001 opened this issue Feb 26, 2017 · 10 comments
Closed

Legitimate mp3 filenames fail to playback. #562

chris001 opened this issue Feb 26, 2017 · 10 comments

Comments

@chris001
Copy link

chris001 commented Feb 26, 2017

Issue was first reported, by mistake, under another app:
Rello/audioplayer#135

Expected behavior

Play on any mp3 (or other supported audio file) and it plays in browser.

Actual behavior

Some filenames with punctuation fail to play. It hangs at loading. You can click on another mp3 without the special characters and it'll play that one.

Steps to reproduce the behavior

  1. Rename an mp3 file on your local machine to (Artist name) Album name [1] First song (ABC remix).mp3
  2. Upload the file to owncloud 9.1.4 (current version).
  3. Go into Music app.
  4. Scan for new files.
  5. Play the new file.
  6. See it hang.

Possible solution (optional)

Examine code.
See if it's treating special characters differently.
See if the code should quote or escape the filename characters before passing them to the process which opens the file and streams it to the browser.

Server configuration

Operating system:
Linux Debian 8 is running both the ownCloud 9.1.4.
Then upgraded / converted to nextCloud 11.
The Music app has disappeared. Probably because it detects nextCloud and decides not to support nextCloud?

Web server:
Nginx latest version

Database:
MySQL from debian 8 distribution

PHP version:
7.0 latest updated version.

ownCloud/Nextcloud version: (see /status.php)
ownCloud 9.1.4 nextCloud 11 latest version.

Updated from an older ownCloud/Nextcloud or fresh install:
Installed ownCloud 6 and upgraded regularly to current version 9.1.4.
Then converted to nextCloud 11 current version.

Music app version: (see /settings/apps)
latest

Where did you install Music app from:
Inside owncloud on apps page

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

Are you using encryption: yes/no
No

Client configuration

Operating system:
Windows 10

Browser:
Firefox 52.093 latest

Logs

ownCloud/Nextcloud log

ownCloud/Nextcloud log (`/data/[owncloud|nextcloud].log`) ``` Insert your ownCloud/Nextcloud log here ```

Web server error log (optional)

Web server error log ``` Insert your webserver log here ```

Browser log (optional)

Browser log ``` Insert your browser log here ```
@paulijar
Copy link
Collaborator

Hmm, I renamed one of my files like instructed but it plays back fine. Which version of Music app are you using? Are you certain that it is the file name causing the problem and not something else? It is a known issue that versions prior to 0.3.13 failed to play some mp3 tracks.

@chris001
Copy link
Author

@paulijar At the time of the bug report several weeks ago, it was the current version of the Music app. The owncloud 9 system got switched to try out another app that was only available on nextcloud app store, and in so doing, the Music app seems to have disappeared from the system and isn't listed on the nextcloud app store either, so it's not possible at the moment to try it again and check for a new error log entry. Do there error logs survive this type of migration between owncloud and nextcloud?

@paulijar
Copy link
Collaborator

@chris001 Sorry for the delay. The most recent version of Music app found in the ownCloud app store is still 0.3.12, and this version has problems playing some mp3 files. No version of the Music app is yet available in the nextcloud app store. Currently, the only way to get the version 0.3.13 is to download it manually from https://github.com/owncloud/music/releases/tag/v0.3.13. It should work on nextcloud, too, although I haven't tested myself.

@chris001
Copy link
Author

@paulijar Is it able to play audio file names which contain emoticons? UTF-8. However if the filenames are stored inside mysql/mariadb, the encoding must be utf8mb4 due to a defect in mysql - mysql fails to implement 4-byte UTF-8 characters., it only supports up to 3-byte in UTF-8 when it should support 4 bytes per character.

@paulijar
Copy link
Collaborator

@chris001 I tested with the unicode emoticons ☂❄♫ in the file name and the file played fine. I tested also the emoticon 💋 but ownCloud failed to rename the file if this glyph was included. Maybe this is the 4-byte issue you mentioned?

@chris001
Copy link
Author

Probably. @paulijar What does owncloud/nextcloud and the music add-on use for the default charset encoding, table/column encoding, connection encoding, and collation encoding? If any of those 4 encodings are not utf8mb4 or utf8mb4_unicode_ci, just 'utf8', and they are passing thru filenames or other user-entered text, then this explains why it breaks when emojis/emoticon characters are in the filenames.
More info:
http://unicode.org/emoji/charts/full-emoji-list.html
https://florian.ec/articles/mysql-doctrine-utf8/
doctrine/dbal#851
https://mathiasbynens.be/notes/mysql-utf8mb4

@gnarula
Copy link
Collaborator

gnarula commented Mar 14, 2017

@chris001 ownCloud doesn't support utf8mb4 yet but they do plan to have it in the next release owncloud/core#17978

@chris001
Copy link
Author

@gnarula Thanks. I guess when is owncloud/nextcloud is trying to store emoticon UTF8 characters in the MySQL database, the code's unknowingly hitting the MySQL bug which incorrectly limits UTF8 to 3 bytes when it should allow for the full 4 bytes per character.

@paulijar
Copy link
Collaborator

paulijar commented Aug 2, 2017

I tested Music 0.4.3 on Nextcloud 13 dev version and SQLite database. There, I could rename an audio file to contain the 4-byte UTF-8 character 💋 and it played just fine. Hence, I don't believe there's any Music app bug with the 4-byte characters; if the core can handle those files, the Music app can play them. This makes sense because Music app does not store the file name to any of its database tables. The app only stores numerical file IDs and fetches the file name from the core when needed.

The original playback problem of the reporter is most likely the same aurora.js problem which is reported in #404, and which is no longer an issue for most browsers. Hence, this case can be closed.

@paulijar paulijar closed this as completed Aug 2, 2017
@chris001
Copy link
Author

chris001 commented Aug 3, 2017

Thanks @paulijar , looks like this mysql utf8mb4 emoji support was added to NextCloud 12 on March 24.
nextcloud/server#3928

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

No branches or pull requests

3 participants