-
-
Notifications
You must be signed in to change notification settings - Fork 340
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
ORA-01400: cannot insert NULL into ("OT_TOOL_DEV"."SILK_REQUEST"."PROF_FILE") #450
Comments
Same problem |
When made the fiel nulleable silk summary returns: ORA-00932: inconsistent datatypes: expected - got NCLOB |
I've just bumped into this and dug into the underlying cause. It's a side effect of silk originally defining the prof_file FileField as null=True and later changing it to be blank=True and there being a bug in django handling such migrations under Oracle (under Oracle empty strings are saved as NULL values so Django shouldn't have changed the column to become NOT NULL). I've logged a django ticket for the issue: https://code.djangoproject.com/ticket/33080 You can work around it by making the column nullable: After I made this change silk was able to log requests without error for me. Although you say in a comment that you got an ORA-00932 when you made the field nullable I think you must have made some other change or something else going on - prof_file is stored as NVCHAR2(300) and not NCLOB (did you try making the change by editing the models for silk instead of just changing the database column?) |
Regarding the NCLOB issue - that is a separate Oracle-related quirk which I've now also experienced - you get that trying to access silk's summary view of requests (i.e. it is a different issue) and it's triggered by these two lines individually in views/summary.py ... That is an issue caused by Oracle not liking GROUP BY on NCLOB (basically NCLOB is how TextField columns are represented under oracle by django and doing a count of a many to many related type causes django to generate a query which does a group by of all fields for the model you're querying against). See: https://code.djangoproject.com/ticket/24096 It's possible to alter code to work around this issue by either using .defer on all text field columns (I think django have ruled out, based on that ticket, doing that automatically) or using .only on just the id column so that's the only field fetched by the query. So a quick change to the two lines I mentioned above would be to: That would incur the performance penalty of the field values on r being deferred, so loaded by another query when accessed on r (so the author of silk may be disinclined to put that change in just to help out anyone with the misfortune to be needing to deal with Oracle!). |
Should be solved by #258 |
django-silk with Oracle not working properly.
IntegrityError at /
ORA-01400: cannot insert NULL into ("OT_TOOL_DEV"."SILK_REQUEST"."PROF_FILE")
pip install https://github.com/jazzband/django-silk.git@09338c1e3ecea1f521eeaee79e6e4a78960fc0d3#egg=django_silk
django-silk (4.1.1.dev3+g09338c1)
Python 3.8.0
Django 2.2.16
The text was updated successfully, but these errors were encountered: