For example:
{{{
env src/tmp/qdel$ python ./manage.py syncdb
Creating tables ...
Traceback (most recent call last):
File "./manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/home/slacy/src/tmp/env/local/lib/python2.7/site-
packages/django/core/management/__init__.py", line 443, in
execute_from_command_line
utility.execute()
File "/home/slacy/src/tmp/env/local/lib/python2.7/site-
packages/django/core/management/__init__.py", line 382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/slacy/src/tmp/env/local/lib/python2.7/site-
packages/django/core/management/base.py", line 196, in run_from_argv
self.execute(*args, **options.__dict__)
File "/home/slacy/src/tmp/env/local/lib/python2.7/site-
packages/django/core/management/base.py", line 232, in execute
output = self.handle(*args, **options)
File "/home/slacy/src/tmp/env/local/lib/python2.7/site-
packages/django/core/management/base.py", line 371, in handle
return self.handle_noargs(**options)
File "/home/slacy/src/tmp/env/local/lib/python2.7/site-
packages/django/core/management/commands/syncdb.py", line 110, in
handle_noargs
emit_post_sync_signal(created_models, verbosity, interactive, db)
File "/home/slacy/src/tmp/env/local/lib/python2.7/site-
packages/django/core/management/sql.py", line 189, in
emit_post_sync_signal
interactive=interactive, db=db)
File "/home/slacy/src/tmp/env/local/lib/python2.7/site-
packages/django/dispatch/dispatcher.py", line 172, in send
response = receiver(signal=self, sender=sender, **named)
File "/home/slacy/src/tmp/env/local/lib/python2.7/site-
packages/django/contrib/auth/management/__init__.py", line 54, in
create_permissions
auth_app.Permission.objects.bulk_create(objs)
File "/home/slacy/src/tmp/env/local/lib/python2.7/site-
packages/django/db/models/manager.py", line 140, in bulk_create
return self.get_query_set().bulk_create(*args, **kwargs)
File "/home/slacy/src/tmp/env/local/lib/python2.7/site-
packages/django/db/models/query.py", line 416, in bulk_create
self.model._base_manager._insert(objs_without_pk, fields=[f for f in
fields if not isinstance(f, AutoField)], using=self.db)
File "/home/slacy/src/tmp/env/local/lib/python2.7/site-
packages/django/db/models/manager.py", line 203, in _insert
return insert_query(self.model, objs, fields, **kwargs)
File "/home/slacy/src/tmp/env/local/lib/python2.7/site-
packages/django/db/models/query.py", line 1576, in insert_query
return query.get_compiler(using=using).execute_sql(return_id)
File "/home/slacy/src/tmp/env/local/lib/python2.7/site-
packages/django/db/models/sql/compiler.py", line 910, in execute_sql
cursor.execute(sql, params)
File "/home/slacy/src/tmp/env/local/lib/python2.7/site-
packages/django/db/backends/util.py", line 40, in execute
return self.cursor.execute(sql, params)
File "/home/slacy/src/tmp/env/local/lib/python2.7/site-
packages/django/db/backends/postgresql_psycopg2/base.py", line 52, in
execute
return self.cursor.execute(query, args)
django.db.utils.DatabaseError: value too long for type character
varying(50)
}}}
* Doesn't tell me which model
* Doesn't say "generated table name is too long"
* Works if django.contrib.auth isn't in INSTALLED_APPS, fails otherwise.
* Can fail if model name < 50 characters when the app name is long.
(since table name is concatenation of app & model class names)
I'd guess that the solution is to catch the DatabaseError in
contrib/auth/management/__init__.py create_permissions() and log some
useful message there then re-raise.
--
Ticket URL: <https://code.djangoproject.com/ticket/18959>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* needs_better_patch: => 0
* resolution: => duplicate
* needs_tests: => 0
* needs_docs: => 0
Comment:
Duplicate of #17763.
--
Ticket URL: <https://code.djangoproject.com/ticket/18959#comment:1>
* keywords: => permission
* status: closed => reopened
* version: 1.4 => master
* resolution: duplicate =>
* stage: Unreviewed => Design decision needed
Comment:
After a second thought I think it might be worth it to display a more
meaningful error message, as proposed, until #17763 is fixed since it
might take a while for native migration to land.
I agree that the actual error message is quite confusing, it wouldn't hurt
to explain the limitation.
Re-opening as DDN.
--
Ticket URL: <https://code.djangoproject.com/ticket/18959#comment:2>
* cc: charette.s@… (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/18959#comment:3>
* stage: Design decision needed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/18959#comment:5>
* type: Uncategorized => Cleanup/optimization
--
Ticket URL: <https://code.djangoproject.com/ticket/18959#comment:6>
Comment (by rasca):
Related to #18866 that tracks the verbose_name errores
--
Ticket URL: <https://code.djangoproject.com/ticket/18959#comment:7>
Comment (by anubhav9042):
As I have understood it worksforme or else if someone can help me
reproduce the problem/error if I am wrong, then it would be very helpful.
--
Ticket URL: <https://code.djangoproject.com/ticket/18959#comment:8>
* status: new => assigned
* owner: nobody => anubhav9042
--
Ticket URL: <https://code.djangoproject.com/ticket/18959#comment:9>
* status: assigned => closed
* resolution: => duplicate
Comment:
I tried to reproduce this, but I think it's actually a duplicate of
#18866. The `auth_permission.name` column is limited to 50 characters, but
it's based on the `verbose_name` which is now validated for length < 39 so
the permission name won't be too long.
--
Ticket URL: <https://code.djangoproject.com/ticket/18959#comment:10>