Opened 10 years ago

Closed 10 years ago

#5071 closed defect (fixed)

Error during db update

Reported by: mrb Owned by:
Priority: critical Milestone: 0.8.0
Component: programming Keywords: db, migration, video
Cc: Boris Bobrov Parent Tickets:

Description

Running

./bin/gmg dbupdate

produces the following backtrace:

https://gist.github.com/mrvdb/b1f6ed39af8eb5a84944

Attachments (1)

issue_5071.patch (1.8 KB ) - added by Boris Bobrov 10 years ago.

Download all attachments as: .zip

Change History (11)

comment:1 by mrb, 10 years ago

Summary: Error up upgradingError during db update

comment:2 by mrb, 10 years ago

  • Running on commit 714008693e08fc8a229fb3f7822c70c132aade7f
  • Using postgresql
Last edited 10 years ago by mrb (previous) (diff)

comment:3 by mrb, 10 years ago

A workaround is to add '{}' values in the column 'orig_metadata' in the table 'videomediadata' where this column is empty and run the migration again.

comment:4 by ayleph, 10 years ago

Cc: Boris Bobrov added
Keywords: db migration video added
Milestone: 0.8.0
Status: newaccepted

comment:5 by ayleph, 10 years ago

breton, there's a small bug in https://gitorious.org/mediagoblin/mediagoblin/commit/2d1e89055d52023a7600f35dd41564019f4d70c3 at file mediagoblin/media_types/video/migrations.py.

If the orig_metadata row is empty, json.loads throws an error on line 62 before reaching the if not metadata: code on line 64.

comment:6 by Boris Bobrov, 10 years ago

Owner: set to Boris Bobrov
Priority: majorcritical
Status: acceptedin_progress

orig_metadata can be empty? That's a surprise to me!

Thank you for the bug report, I will fix it now.

comment:7 by ayleph, 10 years ago

It's a surprise to me too. I wonder if there's another bug that caused orig_metadata to be empty.

comment:8 by Boris Bobrov, 10 years ago

Owner: Boris Bobrov removed
Status: in_progressreview

Could anybody please test now with the patch?

by Boris Bobrov, 10 years ago

Attachment: issue_5071.patch added

comment:9 by Christopher Allan Webber, 10 years ago

I accidentally merged and pushed this. I'm testing, anyway! But it looks right to me.

comment:10 by Christopher Allan Webber, 10 years ago

Resolution: fixed
Status: reviewclosed

Works great! Closing!

Note: See TracTickets for help on using tickets.