Code

Opened 6 years ago

Closed 6 years ago

#7332 closed (wontfix)

No superuser created on syncdb if database permission errors

Reported by: fergus.ferrier@… Owned by: nobody
Component: Core (Management commands) Version: 0.96
Severity: Keywords: syncdb, superuser
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Ran manage.py syncdb - it completed some tasks but failed on ALTER TABLE statements as I'd forgotten some permissions for the DB user. Same again for indexes - fixed and re-ran.

Then, the app worked fine however at no point was I asked to set a superuser account and the auth_user table was empty.

Workaround: remove DB contents and start again with proper user permissions.

Attachments (0)

Change History (1)

comment:1 Changed 6 years ago by russellm

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to wontfix
  • Status changed from new to closed

This is one of those unfortunate cases where the effort involved in correctly identifying and dealing with the problem vastly exceeds the benefits of fixing the problem. Identifying mid-sync failures will always be fraught with difficulty, and if we get it wrong we could mess up the database (either producing database errors, or by inserting duplicate data into the management tables).

As the reporter states, the simple workaround is to flush the database and start from scratch; the slight less attractive workaround is to let the user manually fix any defects in the database. Neither of these options are particularly attractive, but both of them will be more reliable than an automated system.

The specific problem here is that the user wasn't prompted to create a superuser - this only happens when the auth application is synchronized for the first time. If this is the only problem that has been experienced, the solution may be to simply make the process of adding a superuser easier. There is an accepted ticket to add a 'create superuser' command to manage.py (#5614) which will meet this goal.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.