Opened 14 years ago

Closed 14 years ago

#12827 closed (duplicate)

ORA-12899 error with oracle syncdb

Reported by: Jacek Furmankiewicz <jacek99@…> Owned by: nobody
Component: Database layer (models, ORM) Version: 1.1
Severity: Keywords: oracle syncdb
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Karen Tracey)

I pointed settings.py to an Oracle DB and tried to run syncdb for the first time.
Got this error:

cx_Oracle.DatabaseError: ORA-12899: value too large for column "CENTRAL_JACEKF"."AUTH_PERMISSION"."NAME" (actual: 60, maximum: 50)

Traceback (most recent call last):
  File "./manage.py", line 12, in <module>
    execute_manager(settings)
  File "/usr/local/lib/python2.6/dist-packages/Django-1.1.1-py2.6.egg/django/core/management/__init__.py", line 362, in execute_manager
    utility.execute()
  File "/usr/local/lib/python2.6/dist-packages/Django-1.1.1-py2.6.egg/django/core/management/__init__.py", line 303, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python2.6/dist-packages/Django-1.1.1-py2.6.egg/django/core/management/base.py", line 195, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/usr/local/lib/python2.6/dist-packages/Django-1.1.1-py2.6.egg/django/core/management/base.py", line 222, in execute
    output = self.handle(*args, **options)
  File "/usr/local/lib/python2.6/dist-packages/Django-1.1.1-py2.6.egg/django/core/management/base.py", line 351, in handle
    return self.handle_noargs(**options)
  File "/usr/local/lib/python2.6/dist-packages/Django-1.1.1-py2.6.egg/django/core/management/commands/syncdb.py", line 99, in handle_noargs
    emit_post_sync_signal(created_models, verbosity, interactive)
  File "/usr/local/lib/python2.6/dist-packages/Django-1.1.1-py2.6.egg/django/core/management/sql.py", line 205, in emit_post_sync_signal
    interactive=interactive)
  File "/usr/local/lib/python2.6/dist-packages/Django-1.1.1-py2.6.egg/django/dispatch/dispatcher.py", line 166, in send
    response = receiver(signal=self, sender=sender, **named)
  File "/usr/local/lib/python2.6/dist-packages/Django-1.1.1-py2.6.egg/django/contrib/auth/management/__init__.py", line 28, in create_permissions
    defaults={'name': name, 'content_type': ctype})
  File "/usr/local/lib/python2.6/dist-packages/Django-1.1.1-py2.6.egg/django/db/models/manager.py", line 123, in get_or_create
    return self.get_query_set().get_or_create(**kwargs)
  File "/usr/local/lib/python2.6/dist-packages/Django-1.1.1-py2.6.egg/django/db/models/query.py", line 335, in get_or_create
    obj.save(force_insert=True)
  File "/usr/local/lib/python2.6/dist-packages/Django-1.1.1-py2.6.egg/django/db/models/base.py", line 410, in save
    self.save_base(force_insert=force_insert, force_update=force_update)
  File "/usr/local/lib/python2.6/dist-packages/Django-1.1.1-py2.6.egg/django/db/models/base.py", line 495, in save_base
    result = manager._insert(values, return_id=update_pk)
  File "/usr/local/lib/python2.6/dist-packages/Django-1.1.1-py2.6.egg/django/db/models/manager.py", line 177, in _insert
    return insert_query(self.model, values, **kwargs)
  File "/usr/local/lib/python2.6/dist-packages/Django-1.1.1-py2.6.egg/django/db/models/query.py", line 1087, in insert_query
    return query.execute_sql(return_id)
  File "/usr/local/lib/python2.6/dist-packages/Django-1.1.1-py2.6.egg/django/db/models/sql/subqueries.py", line 320, in execute_sql
    cursor = super(InsertQuery, self).execute_sql(None)
  File "/usr/local/lib/python2.6/dist-packages/Django-1.1.1-py2.6.egg/django/db/models/sql/query.py", line 2369, in execute_sql
    cursor.execute(sql, params)
  File "/usr/local/lib/python2.6/dist-packages/Django-1.1.1-py2.6.egg/django/db/backends/util.py", line 19, in execute
    return self.cursor.execute(sql, params)
  File "/usr/local/lib/python2.6/dist-packages/Django-1.1.1-py2.6.egg/django/db/backends/oracle/base.py", line 443, in execute
    raise e
cx_Oracle.DatabaseError: ORA-12899: value too large for column "CENTRAL_JACEKF"."AUTH_PERMISSION"."NAME" (actual: 60, maximum: 50)

Ununtu 9.10. Oracle 10g

Change History (3)

comment:1 by Jacek Furmankiewicz <jacek99@…>, 14 years ago

Verified that in the DB the AUTH_PERMISSION.NAME column was created as NVARCHAR2(50). Other rows are present in the table, so it's just one of the default INSERTs that must have blown the limit

comment:2 by Jacek Furmankiewicz <jacek99@…>, 14 years ago

I changed the column to NVARCHAR(60), but that was not enough. Got another error that required 63 chars. So changing it to NVARCHAR2(63) in the DB via ALTER TABLE allowed me to get past this error.

comment:3 by Karen Tracey, 14 years ago

Description: modified (diff)
Resolution: duplicate
Status: newclosed

Reformatted description -- please use WikiFormatting and preview before submitting.

This really has nothing to do with Oracle specifically -- any DB that enforces the defined limit will show the problem. The problem of permission names being rather short is already noted in #8162.

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