Opened 8 years ago

Closed 7 years ago

Last modified 7 years ago

#5327 closed defect (fixed)

Failure to delete user after using pump api

Reported by: Jonas Haraldsson Owned by:
Priority: major Milestone:
Component: programming Keywords: api, db
Cc: tsyesika Parent Tickets:


User account deletion will fail with:
IntegrityError: (IntegrityError) FOREIGN KEY constraint failed u'DELETE FROM core__users WHERE = ?' (7,) if the user have authenticated a client through the pump api.

gmg 0.8 with sqlite db

Change History (3)

comment:1 by ayleph, 8 years ago

Cc: tsyesika added

CC'ing tsyesika on this one as it's related to the API. I haven't confirmed the error though.

comment:2 by Jessica Tallon, 7 years ago

Is this still an issue as a lot of database changes have occurred. Please test against the current master.

comment:3 by Loic Dachary, 7 years ago

Resolution: fixed
Status: newclosed

Manually created a new 0.8.1 mediagoblin instance and a user loic. Authenticated via PyPump as follows:

>>> from pypump import PyPump, Client
>>> client = Client(webfinger="", type="native", name="")
>>> pump = PyPump(client=client, verifier_callback=simple_verifier)
Go to:
Verifier: yDTFtqzMgcMkyOuYlYlolKEJP6h0nx
>>> me = pump.Person("")
>>> me.summary

On the machine running the mediagoblin instance:

root@gmg:~/mediagoblin-docker# docker exec -t -i testpump.web.1 bash
root@441c517a3f31:/# cd /srv/
cd /srv/
root@441c517a3f31:/srv/ sudo -u mediagoblin bin/gmg --help
< sudo -u mediagoblin bin/gmg --help
usage: gmg [-h] [-cf CONF_FILE]


GNU MediaGoblin utilities.

positional arguments:
                        sub-command help
    shell               Run a shell with some tools pre-setup
    adduser             Creates an user
    assetlink           Link assets for themes and plugins for static serving
    reprocess           Reprocess media entries
    serve               PasteScript replacement
    batchaddmedia       Add many media entries at once
    deletemedia         Delete media entries
    changepw            Changes a user's password
    deleteuser          Deletes a user
    dbupdate            Set up or update the SQL database
    makeadmin           Makes user an admin
    addmedia            Reprocess media entries

optional arguments:
  -h, --help            show this help message and exit
  -cf CONF_FILE, --conf_file CONF_FILE
                        Config file used to set up environment. Default to
                        mediagoblin_local.ini if readable, otherwise
root@441c517a3f31:/srv/ sudo -u mediagoblin bin/gmg deleteuser --help
usage: gmg deleteuser [-h] username

positional arguments:
  username    Username to delete

optional arguments:
  -h, --help  show this help message and exit
root@441c517a3f31:/srv/ sudo -u mediagoblin bin/gmg deleteuser loic
The user loic has been deleted

The problem no longer exists in 0.8.1.

Last edited 7 years ago by Loic Dachary (previous) (diff)
Note: See TracTickets for help on using tickets.