Bug 240820 - www/py-django111: SQLite backend broken after 3.26
Summary: www/py-django111: SQLite backend broken after 3.26
Status: Closed Overcome By Events
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Kai Knoblich
URL: https://code.djangoproject.com/ticket...
Depends on:
Reported: 2019-09-25 16:29 UTC by rozhuk.im
Modified: 2020-04-28 04:04 UTC (History)
3 users (show)

See Also:
koobs: maintainer-feedback+
koobs: maintainer-feedback+
koobs: merge-quarterly?

patch (1.21 KB, patch)
2019-09-25 16:29 UTC, rozhuk.im
rozhuk.im: maintainer-approval?
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Comment 1 rozhuk.im 2020-02-19 16:28:56 UTC
Comment 2 rozhuk.im 2020-04-16 07:51:24 UTC
maintainer timeout
Comment 3 Kubilay Kocak freebsd_committer freebsd_triage 2020-04-20 01:27:43 UTC
^Triage: Note, teams don't timeout

@Kai Do you have cycles for this?
Comment 4 Kai Knoblich freebsd_committer 2020-04-22 06:41:18 UTC
(In reply to rozhuk.im from comment #0)
(In reply to Kubilay Kocak from comment #3)


for the record here's a short overview:

* The original PR #10733 with a slighty different patch (= diff against Django 2.x branch) got merged (2018-12-07) into the 2.x branch of Django but not in the 1.11 branch.

* Two PRs #11610 (2019-07-30) and #11986 (2019-10-29), which contain the attached patch of this bug, were created by different users to get it merged into the Django 1.11 branch. Both PRs were rejected by upstream.

Considering those facts and the following points:

1) SQLite 3.26 was introduced to the Ports tree via ports r486622 (2018-12-04).

2) This bug was reported nine months later after databases/sqlite3 was updated to 3.26.

3) The issue with SQLite seems to be happen in some rare cases when using foreign key restraints. Upstream recommends as a workaround to rebuild the whole tables by not using migrations as described in [1].

4) Django 1.11 is End-of-Life since April 2020 and there's already progress in the Ports tree to switch the consumers of Django 1.11 to Django 2.2 (current LTS release), see also bug #245309.

5) I also tried to reproduce the issue with Django 1.11 and migrations from SQLite 3.25 to SQLite 3.31 but without any luck so far.

Originally I was under the impression that the original PR #10733 was merged into all branches of Django but on further review it came to light that this isn't the case.

After discussing the whole situation with koobs@ we believe the best way is to leave the www/py-django111 port in its current state. because Django 1.11 is End-of-Life, the issue isn't reproducible and there's a workaround as noted at 3) which might be another reason why upstream didn't backport that patch for Django 1.11.

[1] https://docs.djangoproject.com/en/2.1/releases/2.0/#foreign-key-constraints-are-now-enabled-on-sqlite
Comment 5 rozhuk.im 2020-04-22 08:31:04 UTC
(In reply to Kai Knoblich from comment #4)

We are using FreeBSD + django in our product.

We was on django 1.08 and then try to migrate to 1.11 got this bug, that is why 9 months delay.
Now we are on 1.11 and I dont know how long we will use it.

It 100% reproduces in our project.
And this patch fix problem for us.
I'm trying to upstream all our patches to reduce support time in future. 
(all new python ports from me)

>> My backport was rejected mainly for two reasons:
>>   - Faulty analysis implying that it doesn't solve the problem (yes, it does)
>>   - Django LTS "security only" support policy (this backport doesn't qualify as a security issue)

Anyway, thanks for your time.