Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Django doesn't work with the latest Oracle database (Oracle bug 36807094) #356

Open
csirmazbendeguz opened this issue Jul 3, 2024 · 11 comments · Fixed by django/django#18440
Labels
Client Library or Database An issue with Oracle Client library or Oracle Database

Comments

@csirmazbendeguz
Copy link

Hello!

Django doesn't work with the latest Oracle database.

When I run Django's test suite (runtests.py), the database raises an unexpected error ORA-00600.
The error is raised in the post_migrate signal when inserting rows into the AUTH_PERMISSION table.
Interestingly, it manages to create the tables, but it fails on Permission.objects.bulk_insert.

I tried thick mode, it doesn't work.
I tried disable_oob=True, it doesn't work.

  1. What versions are you using?

23.4.0.0
platform.platform: Windows-10-10.0.22631-SP0
sys.maxsize > 2**32: True
platform.python_version: 3.11.3
oracledb.version: 2.2.1

  1. Is it an error or a hang or a crash?

error

  1. What error(s) or behavior you are seeing?

ORA-00600

Stack trace: https://gist.github.com/csirmazbendeguz/220b6dd0d4058159f1e1b020e519ca2f

  1. Does your application call init_oracle_client()?

no

  1. Include a runnable Python script that shows the problem.
runtests.py "tests/migrations" --verbosity=3 --settings=test_oracle

https://code.djangoproject.com/wiki/OracleTestSetup

@csirmazbendeguz csirmazbendeguz added the bug Something isn't working label Jul 3, 2024
@felixxm
Copy link

felixxm commented Jul 3, 2024

Django doesn't work with the latest Oracle database.

To be precise, it crashes with Oracle Database 23ai Free.

@anthony-tuininga
Copy link
Member

Thanks for the report. We will look into it!

@anthony-tuininga
Copy link
Member

We have confirmed that it can be reproduced with 23ai, but not with 19c. The internal bug number is 36807094 for any who may wish to contact Oracle Support regarding this issue.

@felixxm
Copy link

felixxm commented Jul 4, 2024

We have confirmed that it can be reproduced with 23ai, but not with 19c. The internal bug number is 36807094 for any who may wish to contact Oracle Support regarding this issue.

Thanks 👍 I'll only add that it also works with Oracle 23c.

@anthony-tuininga
Copy link
Member

Thanks 👍 I'll only add that it also works with Oracle 23c.

Can you specify which version exactly? You can print the output of connection.version for both cases -- the one that succeeds and the one that fails. Thanks!

@csirmazbendeguz
Copy link
Author

@anthony-tuininga , I couldn't find any older versions on the official Oracle website, but the image 23.2 from here: https://hub.docker.com/r/gvenzl/oracle-free works for me.

@felixxm
Copy link

felixxm commented Jul 4, 2024

Thanks 👍 I'll only add that it also works with Oracle 23c.

Can you specify which version exactly? You can print the output of connection.version for both cases -- the one that succeeds and the one that fails. Thanks!

It works with:

  • Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.3.0.0.0
  • Oracle Database 23c Free, Release 23.0.0.0.0 - Developer-Release Version 23.2.0.0.0

and crashes with:

  • Oracle Database 23ai Free Release 23.0.0.0.0 - Develop, Learn, and Run for Free Version 23.4.0.24.05

@anthony-tuininga
Copy link
Member

Thanks, @felixxm!

@cjbj cjbj added question Further information is requested and removed bug Something isn't working labels Jul 4, 2024
@cjbj
Copy link
Member

cjbj commented Jul 4, 2024

Since the problem isn't in python-oracledb, I'm going to re-label this issue (to keep BUG for python-oracledb tasks).

(PS Django/Oracle users, please support django/django#17834 which is a PR to add connection pooling to Django !)

@cjbj cjbj changed the title Django doesn't work with the latest Oracle database Django doesn't work with the latest Oracle database (Oracle bug 36807094) Jul 4, 2024
@cjbj cjbj added Client Library or Database An issue with Oracle Client library or Oracle Database and removed question Further information is requested labels Jul 7, 2024
@cjbj
Copy link
Member

cjbj commented Jul 10, 2024

From investigation by @suraj-ora-2020 the problem doesn't occur with VARCHAR2. This is yet-another-reason to migrate Django away from NVARCHAR2. See end of 1.3 in
https://docs.oracle.com/en/database/oracle/dmu/23.1/dumag/ch1_overview.html#GUID-3CA04A80-4870-469F-9FBB-0578779E7622

“Oracle does not recommend the use of national character set data types

@felixxm
Copy link

felixxm commented Jul 10, 2024

From investigation by @suraj-ora-2020 the problem doesn't occur with VARCHAR2. This is yet-another-reason to migrate Django away from NVARCHAR2. See end of 1.3 in https://docs.oracle.com/en/database/oracle/dmu/23.1/dumag/ch1_overview.html#GUID-3CA04A80-4870-469F-9FBB-0578779E7622

“Oracle does not recommend the use of national character set data types

We could reconsider using VARCHAR2/CHAR datatypes instead of NVARCHAR2/NCHAR, but we need to have a clear (and as painless as possible) migration path for our users 😞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Client Library or Database An issue with Oracle Client library or Oracle Database
Projects
None yet
4 participants