Been looking around for awhile and haven't found any solution. I'm seeing an issue when uploading certain mp3 files where I get a database error similar to the following:

Incorrect string value: '\\xF7\\x98\\x9E\\xAA\\x01L...' for column 'tags' at row 1\nquery: INSERT INTO filefield_meta (fid, width, height, duration, audio_format, audio_sample_rate, audio_channel_mode, audio_bitrate, audio_bitrate_mode, tags) VALUES (556, 0, 0, 220.133875, 'mp3', 44100, 'stereo', 192000, 'cbr', 'a:8:{s:5:\\"title\\";s:12:\\"I\\'m Worth It\\";s:6:\\"artist\\";s:7:\\"Unknown\\";s:5:\\"album\\" in C:\inetpub\wwwroot\afc\htdocs\includes\database.mysqli.inc on line 128

Here are the relevant versions I am running:

Drupal 6.19
Filefield 6.x-3.9
getID3 6.x-1.4

I've traced the issue down to the filefield_meta module. Specifically, in filefield_meta.module on line 145 where the filefield_meta module is reading out the id3 tags found by getid3, a key called 'music_cd_identifier' is read out that has a bunch of really odd characters in it. The id3 tags get serialized and saved to the tags column in the filefield_meta module and that's where the MySQL error occurs above.

Has anyone else run into this?

I should note that to the end user, the error that appears is the same as that in #297035: HTTP error 0 when you upload the file via AJAX, but if you simply Save the form, you get the white screen with the MySQL error above.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

m4olivei’s picture

Attached is a small patch that will ignore the 'music_cd_identifier' key much like the 'coverart' key is ignored. This doesn't get at the cause of the issue but is a workable solution for my case.

Perhaps a more long term solution would be to allow site admins to enter a black list / white list of tags that are collected from id3 tags. I'd also like to figure out why MySQL complains about the strings that are pulled out from the music_cd_identifier tags.

Here is the string as it is coming out of the id3 tag:

(*AF*,"	;/�Length(�{=�Quality𺽂VBR Itл/

Here is the string after passing through html_entity_decode on line 144 of filefield_meta.module:

(*AF*,"	;/÷˜žªLength(õ¯�™{=÷°ž«Quality𺽂VBR Itл/

This is the string that is breaking the MySQL query to insert into the filefield_meta table.

If anyone could shed light on this for that would be cool, otherwise the patch works for my circumstance.

m4olivei’s picture

And the patch..

quicksketch’s picture

Title: Incorrect string value error when uploading mp3 file » Incorrect string value error when uploading mp3 file; Ignore music_cd_identifier id3 tag
Priority: Normal » Minor
Status: Active » Fixed

Well, I don't have any suggestions really, but I'd think that this ID3 tag probably isn't worth keeping for the trouble it causes. I've committed your patch, thanks for the help.

m4olivei’s picture

Awesome, thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.