Opened 4 years ago

Closed 4 years ago

#27105 closed Cleanup/optimization (fixed)

Misleading error in ContentTypes get_for_model

Reported by: Andy Baker Owned by: nobody
Component: contrib.contenttypes Version: 1.9
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

This (line 75):

except (OperationalError, ProgrammingError, IntegrityError):

is gives the following message:

"Error creating new content types. Please make sure contenttypes "
"is migrated before trying to migrate apps individually."

However - it's catching a much broader set of issues. I was baffled for a while - my actual issue was that MySQL was unstable: "Lost connection to MySQL server at 'reading initial communication packet" but I had to disable the exception handling to figure that out.

We should probably examine the error inside the except block and narrow down the range of cases that result in this message.

Change History (1)

comment:1 Changed 4 years ago by Tim Graham

Resolution: fixed
Status: newclosed
Type: UncategorizedCleanup/optimization
Version: 1.101.9

This is fixed in Django 1.10 by 61a16e02702fff4665969388f3b61af8cb1a20ae.

Note: See TracTickets for help on using tickets.
Back to Top