Opened 13 years ago

Closed 13 years ago

Last modified 12 years ago

#16454 closed Bug (needsinfo)


Reported by: alexei.vlassov@… Owned by: nobody
Component: Database layer (models, ORM) Version: dev
Severity: Release blocker Keywords: oracle
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description syncdb fails with ORA-06552

Traceback (most recent call last):
  File "./", line 20, in <module>
  File "/media/sf_workspace_python/djadmin/3rdparty/apps/django/core/management/", line 442, in execute_manager
  File "/media/sf_workspace_python/djadmin/3rdparty/apps/django/core/management/", line 379, in execute
  File "/media/sf_workspace_python/djadmin/3rdparty/apps/django/core/management/", line 191, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/media/sf_workspace_python/djadmin/3rdparty/apps/django/core/management/", line 220, in execute
    output = self.handle(*args, **options)
  File "/media/sf_workspace_python/djadmin/3rdparty/apps/django/core/management/", line 351, in handle
    return self.handle_noargs(**options)
  File "/media/sf_workspace_python/djadmin/3rdparty/apps/south/management/commands/", line 90, in handle_noargs
  File "/media/sf_workspace_python/djadmin/3rdparty/apps/django/core/management/", line 220, in execute
    output = self.handle(*args, **options)
  File "/media/sf_workspace_python/djadmin/3rdparty/apps/django/core/management/", line 351, in handle
    return self.handle_noargs(**options)
  File "/media/sf_workspace_python/djadmin/3rdparty/apps/django/core/management/commands/", line 109, in handle_noargs
    emit_post_sync_signal(created_models, verbosity, interactive, db)
  File "/media/sf_workspace_python/djadmin/3rdparty/apps/django/core/management/", line 190, in emit_post_sync_signal
    interactive=interactive, db=db)
  File "/media/sf_workspace_python/djadmin/3rdparty/apps/django/dispatch/", line 172, in send
    response = receiver(signal=self, sender=sender, **named)
  File "/media/sf_workspace_python/djadmin/3rdparty/apps/django/contrib/auth/management/", line 56, in create_permissions
  File "/media/sf_workspace_python/djadmin/3rdparty/apps/django/db/models/", line 138, in create
    return self.get_query_set().create(**kwargs)
  File "/media/sf_workspace_python/djadmin/3rdparty/apps/django/db/models/", line 360, in create, using=self.db)
  File "/media/sf_workspace_python/djadmin/3rdparty/apps/django/db/models/", line 463, in save
    self.save_base(using=using, force_insert=force_insert, force_update=force_update)
  File "/media/sf_workspace_python/djadmin/3rdparty/apps/django/db/models/", line 556, in save_base
    result = manager._insert(values, return_id=update_pk, using=using)
  File "/media/sf_workspace_python/djadmin/3rdparty/apps/django/db/models/", line 198, in _insert
    return insert_query(self.model, values, **kwargs)
  File "/media/sf_workspace_python/djadmin/3rdparty/apps/django/db/models/", line 1456, in insert_query
    return query.get_compiler(using=using).execute_sql(return_id)
  File "/media/sf_workspace_python/djadmin/3rdparty/apps/django/db/models/sql/", line 810, in execute_sql
    cursor = super(SQLInsertCompiler, self).execute_sql(None)
  File "/media/sf_workspace_python/djadmin/3rdparty/apps/django/db/models/sql/", line 754, in execute_sql
    cursor.execute(sql, params)
  File "/media/sf_workspace_python/djadmin/3rdparty/apps/django/db/backends/", line 34, in execute
    return self.cursor.execute(sql, params)
  File "/media/sf_workspace_python/djadmin/3rdparty/apps/django/db/backends/oracle/", line 640, in execute
    return self.cursor.execute(query, self._param_generator(params))
django.db.utils.IntegrityError: ORA-01400: cannot insert NULL into ("***"."AUTH_PERMISSION"."ID")

params from django/db/backends/oracle/ line 640

['Can add permission', 1, 'add_permission', <cx_Oracle.NUMBER with value None>]

Django 1.4 pre-alpha SVN-16538

Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56)

cx_Oracle 5.0

Oracle Database 10g Enterprise Edition Release

Change History (5)

comment:1 by Aymeric Augustin, 13 years ago

Reading the last line of the traceback, I'd say the error is "ORA-01400".

Why did you mention "ORA-06552" in the first line of your message? Is it related to #4140?

comment:2 by Aymeric Augustin, 13 years ago

Resolution: needsinfo
Status: newclosed

I couldn't reproduce the problem with the following procedure:

  • startproject test16454
  • vi
    'default': {
        'ENGINE': '',
        'NAME': '',
        'USER': 'django',
        'PASSWORD': 'django',
  • sqlplus
create tablespace test16454 datafile 'test16454.dbf' size 20M;
  • ./ syncdb
Creating tables ...
Creating table auth_permission
Creating table auth_group_permissions
Creating table auth_group
Creating table auth_user_user_permissions
Creating table auth_user_groups
Creating table auth_user
Creating table django_content_type
Creating table django_session
Creating table django_site

You just installed Django's auth system, which means you don't have any superusers defined.
Would you like to create one now? (yes/no): yes
Username (leave blank to use 'aaugustin'): [[[ redacted ]]]
E-mail address: [[[ redacted ]]]
Password (again): 
Superuser created successfully.
Installing custom SQL ...
Installing indexes ...
No fixtures found.

Oracle Database 10g Express Edition Release

Since the original report doesn't contain any information about the context, there isn't much more I can do.

comment:3 by alexei.vlassov@…, 13 years ago

It's fixed for me with cx_Oracle 5.1

comment:4 by Aymeric Augustin, 13 years ago

Indeed, I tested with cx_Oracle 5.1. Unfortunately, I couldn't find anything in cx_Oracle's changelog to explain why the problem was fixed between 5.0 and 5.1.

comment:5 by Aymeric Augustin, 12 years ago

This was reported again and diagnosed in #17015.

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