bugSavane - Bugs: bug #2850, Binary attachements corrupted by...

 
 
Show feedback again

You are not allowed to post comments on this tracker with your current authentification level.

bug #2850: Binary attachements corrupted by UTF-8 conversion

Submitted by:  Sylvain Beucler <beuc>
Submitted on:  Thu 08 Sep 2005 07:53:44 AM UTC  
 
Category: DatabaseStatus: Fixed
Severity: 5 - BlockerPriority: E - Immediate
Assigned to: Mathieu Roy <yeupou>Open/Closed: Closed
Release: 1.0.7Planned Release: 1.0.7+2, 1.0.8+2
Reproducibility: NonePrivacy: Public

(Jump to the original submission Jump to the original submission)

Sat 10 Sep 2005 12:14:51 PM UTC, comment #11:

New packages are online.

Mathieu Roy <yeupou>
Project AdministratorIn charge of this item.
Sat 10 Sep 2005 11:21:42 AM UTC, comment #10:

Hum, I'm forced to do a 1.0.7+2 since 1.0.7+1 tag is already used in the cvs :(

Mathieu Roy <yeupou>
Project AdministratorIn charge of this item.
Sat 10 Sep 2005 09:35:36 AM UTC, comment #9:

The only decent option I can think of is to read the dump, put the attachment apart, convert the file minu the attachment, reput then the attachement at the bottom of the file.

I'll work on that, this repackaging cannot wait.

Mathieu Roy <yeupou>
Project AdministratorIn charge of this item.
Sat 10 Sep 2005 09:11:58 AM UTC, comment #8:

Would be mysqlhotcopy helpful?

Mathieu Roy <yeupou>
Project AdministratorIn charge of this item.
Sat 10 Sep 2005 09:08:05 AM UTC, comment #7:

root@pcphsft15:/opt/dev/svtestUTF/update/1.0.7# ./backup_database.pl
Creating a backup dump of your database in the file
"./database-backup.sql"
mysqldump: unrecognized option `--hex-blob'
root@pcphsft15:/opt/dev/svtestUTF/update/1.0.7# more
root@pcphsft15:/opt/dev/svtestUTF/update/1.0.7# mysql --version
mysql Ver 11.18 Distrib 3.23.58, for redhat-linux-gnu (i686)

The script doesnt work with mysql 3.x, unfortunately. Next solution?

Mathieu Roy <yeupou>
Project AdministratorIn charge of this item.
Fri 09 Sep 2005 05:52:33 PM UTC, comment #6:

I'll try tomorrow to make an install of 1.0.6, then try the upgraded script with binaries in attachement, we'll see.

if it's ok, we'll repackage 1.0.7+ and 1.0.8+. At the same time, I would be nice to check if iconv can undo the change.

Mathieu Roy <yeupou>
Project AdministratorIn charge of this item.
Fri 09 Sep 2005 05:45:41 PM UTC, comment #5:

Unfortunately, I have no savane installation with data that is no in utf8. Have you tested it?

Mathieu Roy <yeupou>
Project AdministratorIn charge of this item.
Fri 09 Sep 2005 04:19:24 PM UTC, comment #4:

Hi Mathieu,

I think the fix for this bug (adding --hex-blob to the mysqldump program options) should be everything that is needed for updates from 1.0.6. As I said, it does not currently fix the databases which have already been converted.

I've added a new release version in the CVS, the tag is called "REL_1-0-7+1". Feel free to check this out and have a look yourself. I think you can package a new release based on that tag.

Tobias Quathamer <toddy>
Project Member
Fri 09 Sep 2005 07:50:45 AM UTC, comment #3:

Hello Tobias,

I've seen that you updated the relevant upgrade script. Have you tested it? If so, we could repackage 1.0.7 and 1.0.8.

Mathieu Roy <yeupou>
Project AdministratorIn charge of this item.
Thu 08 Sep 2005 07:14:48 PM UTC, comment #2:

If we need to repackage 1.0.7 to avoid database breakage (and we do), it must be done ASAP.
As soon as a working solution to avoid this problem during conversion is found, the repackaging should be done.

And 1.0.8 must be also repackaged, since it includes update scripts.

I moved packages to directories called WARNING_NEED_FIX since we cannot affort to let people breaking their installation knowning it.

How to fix already broken things, that's secondary for now. I dont think there's any solution apart using backups and I very glad this bug get found now and not later. I wonder how come we forgot to check that :(

What would be nice would be to write a small script that could take a mysql dump of a whole database, take as argument a number of supposedly the more recent broken attachment, and would prepare a .sql file that would contain what is necessary to reinsert the appropriate content.
In Gna! case, fortunately there are very few attachment in the database; I dont think we have still backups of database of 5 month ago.

Indeed, the first thing to do is too check whether iconv can reverse the change.

Tobias, do you think you have time to check on those issues in a timely fashion? Since you are the one that is most familiar with all these UTF8 issues, that would be helpful.

Mathieu Roy <yeupou>
Project AdministratorIn charge of this item.
Thu 08 Sep 2005 12:45:12 PM UTC, comment #1:

Hi Sylvain,

that's certainly a really bad thing to have happened. It also affects the Savane installation at Gna!, for example see bug #2251 and bug #2257.

I think the solution (for future upgrades to 1.0.7) is to add the option "--hex-blob" to the mysqldump command, which encodes binary data as hexadecimal numbers. Those use pure ASCII, they are not affected by the conversion to UTF-8.

I'm not sure how to cleanly resolve the errors in the current (already updated) databases, I'll have to think about that.

Tobias Quathamer <toddy>
Project Member
Thu 08 Sep 2005 07:53:44 AM UTC, original submission:

User reported corrupted downloads at Savannah today.

Binary data was encoded utf-8 during the database conversion.

I reverted those using a backup I luckily kept since the conversion. This data might be restored using the reverse iconv transformation, but I haven't tested. Downloads could not be reverted by simple users, because Savane truncates the (bigger, if iso8859->utf8) data at file_size.

Apparently trackers attachments are the only binary data. There might be issues with binary-encoded numbers, but apparently we don't use that.

We have a problem with the Savane upgrades: I got 2 issues with 1.0.7 and another one with 1.0.8. In each case one need to be a Savane dev to fix the issue so that's pretty bad for us.

As for fixing the utf8 upgrade procedure, I guess we should look at MySQL tools to do the job, or else automate the attachment recovery.

Sylvain Beucler <beuc>
Project Administrator

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by yeupou (Updated the item)
  • -unavailable- added by toddy (Updated the item)
  • -unavailable- added by beuc (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 12 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 10 Sep 2005 12:14:51 PM UTCyeupouStatusConfirmed=>Fixed
      Open/ClosedOpen=>Closed
    Sat 10 Sep 2005 11:21:42 AM UTCyeupouPlanned Release1.0.7+1, 1.0.8+2=>1.0.7+2, 1.0.8+2
    Sat 10 Sep 2005 09:35:36 AM UTCyeupouAssigned totoddy=>yeupou
    Sat 10 Sep 2005 09:08:05 AM UTCyeupouStatusNeed Info=>Confirmed
    Thu 08 Sep 2005 07:14:48 PM UTCyeupouPriorityA - Later=>E - Immediate
      Severity4 - Important=>5 - Blocker
      StatusReady For Test=>Need Info
      Planned Release1.0.7+1=>1.0.7+1, 1.0.8+2
    Thu 08 Sep 2005 12:45:12 PM UTCtoddyStatusNone=>Ready For Test
      Assigned toNone=>toddy
      Planned Release=>1.0.7+1
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup