Opened 5 months ago

Last modified 5 weeks ago

#5603 new defect

Error when running dbupdate after adding audio media-type

Reported by: Andrew Owned by:
Priority: major Milestone:
Component: programming Keywords: migration, audio
Cc: michael@… Parent Tickets:


One of my coworkers is running into this issue while trying to add audio support to our GMG instance. I'm posting it for them because it's currently not possible to sign up for new accounts on this bug tracker. Thanks! : )

I am following these instructions for audio:

We have video, image, and pdf media types enabled. I am trying to add
audio. I have added the dependencies. I get an AssertionError when
adding under the [plugins] section of
my mediagoblin_local.ini file.

"/srv/ccs-mediagoblin/mediagoblin/mediagoblin/db/", line
132, in migrations_to_run

assert self.database_current_migration is not None


The full traceback is identical to this unanswered mailing list message:

Version: gmg 0.9.0 stable

I think it is referencing the pdf version being 0 in the database.

psql mediagoblin
psql (9.3.24)
Type "help" for help.

mediagoblin=> SELECT * FROM coremigrations WHERE

name | version

mediagoblin.media_types.pdf | 0

(1 row)

Changing 0 to 1 does not have an effect.

If I remove the line from
mediagoblin_local.ini, the ./bin/gmg dbupdate command completes.

I did some of my own research about this issue. I wonder if this is related to the following file being nearly empty:


It contains only: "MIGRATIONS = {}", whereas the 'video' analog contains more.

Any insights into this issue are appreciated. Thanks! : )


Change History (8)

comment:1 Changed 5 months ago by Ben Sturmfels

Thanks Andrew, I thought we'd fixed the registration issue, so I'll be taking another look at it.

Firstly, can you tell us what operating system you're on and whether MediaGoblin is running under Python 2 or Python 3 please?

We're planning to release MediaGoblin 0.10.0 in a few days time, so I'd suggest we look at upgrading you from 0.9.0 to "master". If your setup is similar to that described in our "Deploying" docs with an unpriviledged user called "mediagoblin", that might look like this:

git fetch && git checkout master
sudo su mediagoblin --shell=/bin/bash
$ cd /srv/
$ git submodule update && ./bin/python develop --upgrade && ./bin/gmg dbupdate

Drop in to IRC and happy to give you a hand if required. We've had another report of a similar issue today.

comment:2 Changed 5 months ago by Andrew

Thanks for your help Ben. We're running Trisquel 7, which is based on Ubuntu 14.04, and are using Python2.

The person you spoke with in #mediagoblin is my coworker. It sounds like we should be making an upgrade to our installation.

Thanks again for your help! : )

comment:3 Changed 5 months ago by Ben Sturmfels

Hi Andrew,

I'd be very happy to roll my sleeves up and help the FSF with this MediaGoblin upgrade if that would be useful.

Trisquel 7 has Python 3.4 I believe, which I'd highly recommend if you're doing a MediaGoblin upgrade anyway.


comment:4 Changed 5 months ago by Ben Sturmfels

By the way, Trac registrations are now fixed. Issue was just that the upstream changes hadn't been pulled down.

comment:5 Changed 5 months ago by Andrew

Thanks! : ) I'll pass that info along to my coworker

comment:6 Changed 5 months ago by thomzane

Two updates:

  • I also tried to just upload an ogg and it worked! This dbupgrade problem is not a blocker at the moment.
  • I have rebased our changes onto v0.10.0. Upgrading the site will take a bit longer.

We will see if this dbupgrade problem is still an issue after the upgrade.

comment:7 Changed 5 weeks ago by thomzane

I have dev upgraded to Trisquel 9 (based on Ubuntu 18.04), MediaGoblin 0.10.0, and Python 3.6.9. This database issue persists.

I was able to upload audio files to 0.9.0. Now I get "Internal Server Error" when accessing a page that would have them visible.

comment:8 Changed 5 weeks ago by thomzane

I fixed it! I was able to enable audio media type and play audio files in 0.10.0.

psql mediagoblin

INSERT INTO coremigrations (name, version) VALUES('', '0');


./bin/gmg dbupdate

INFO [alembic.runtime.migration] Context impl PostgresqlImpl.
INFO [alembic.runtime.migration] Will assume transactional DDL.
INFO [alembic.runtime.migration] Running upgrade 52bf0ccbedc1 -> e9212d3a12d3, Audio media type initial migration

Note: See TracTickets for help on using tickets.