LingL icon indicating copy to clipboard operation
LingL copied to clipboard

Report error when un-archive

Open chengxicn opened this issue 3 years ago • 19 comments

After imported lwt db, all the texts were archived. (It seems no batch un-archived option )

One by one click un-archived,Some text un-archived succeed, but one text reports error :


IntegrityError at /text_list/
UNIQUE constraint failed: sentences.text_id, sentences.order, sentences.owner_id
Request Method:	GET
Request URL:	http://127.0.0.1:8000/text_list/?unarchive=328
Django Version:	3.2.3
Exception Type:	IntegrityError
Exception Value:	
UNIQUE constraint failed: sentences.text_id, sentences.order, sentences.owner_id
Exception Location:	/Users/lingl/.pyenv/versions/3.8.10/envs/venv3810/lib/python3.8/site-packages/django/db/backends/sqlite3/base.py, line 423, in execute
Python Executable:	/Applications/LingL-2021.6.23.app/Contents/MacOS/LingLibre
Python Version:	3.8.10
Python Path:	
['/Applications/LingL-2021.6.23.app/Contents/MacOS/lib/library.zip',
 '/Applications/LingL-2021.6.23.app/Contents/MacOS/lib']
Server time:	Thu, 24 Jun 2021 16:12:53 +0000

Environment:


Request Method: GET
Request URL: http://127.0.0.1:8000/text_list/?unarchive=328

Django Version: 3.2.3
Python Version: 3.8.10
Installed Applications:
['django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django.contrib.sites',
 'lwt',
 'tags_input',
 'mathfilters',
 'allauth',
 'allauth.account',
 'allauth.socialaccount',
 'crispy_forms']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware']



Traceback (most recent call last):
  File "/Users/lingl/.pyenv/versions/3.8.10/envs/venv3810/lib/python3.8/site-packages/django/db/backends/utils.py", line 84, in _execute
    <source code not available>
  File "/Users/lingl/.pyenv/versions/3.8.10/envs/venv3810/lib/python3.8/site-packages/django/db/backends/sqlite3/base.py", line 423, in execute
    <source code not available>

The above exception (UNIQUE constraint failed: sentences.text_id, sentences.order, sentences.owner_id) was the direct cause of the following exception:
  File "/Users/lingl/.pyenv/versions/3.8.10/envs/venv3810/lib/python3.8/site-packages/django/core/handlers/exception.py", line 47, in inner
    <source code not available>
  File "/Users/lingl/.pyenv/versions/3.8.10/envs/venv3810/lib/python3.8/site-packages/django/core/handlers/base.py", line 181, in _get_response
    <source code not available>
  File "/Users/lingl/.pyenv/versions/3.8.10/envs/venv3810/lib/python3.8/site-packages/django/contrib/auth/decorators.py", line 21, in _wrapped_view
    <source code not available>
  File "/Users/lingl/lingl/LingL/lwt/views/_nolang_redirect_decorator.py", line 15, in wrap
    <source code not available>
  File "/Users/lingl/lingl/LingL/lwt/views/text.py", line 448, in text_list
    <source code not available>
  File "/Users/lingl/lingl/LingL/lwt/views/_utilities_views.py", line 430, in splitText
    <source code not available>
  File "/Users/lingl/.pyenv/versions/3.8.10/envs/venv3810/lib/python3.8/site-packages/django/db/models/manager.py", line 85, in manager_method
    <source code not available>
  File "/Users/lingl/.pyenv/versions/3.8.10/envs/venv3810/lib/python3.8/site-packages/django/db/models/query.py", line 453, in create
    <source code not available>
  File "/Users/lingl/.pyenv/versions/3.8.10/envs/venv3810/lib/python3.8/site-packages/django/db/models/base.py", line 726, in save
    <source code not available>
  File "/Users/lingl/.pyenv/versions/3.8.10/envs/venv3810/lib/python3.8/site-packages/django/db/models/base.py", line 763, in save_base
    <source code not available>
  File "/Users/lingl/.pyenv/versions/3.8.10/envs/venv3810/lib/python3.8/site-packages/django/db/models/base.py", line 868, in _save_table
    <source code not available>
  File "/Users/lingl/.pyenv/versions/3.8.10/envs/venv3810/lib/python3.8/site-packages/django/db/models/base.py", line 906, in _do_insert
    <source code not available>
  File "/Users/lingl/.pyenv/versions/3.8.10/envs/venv3810/lib/python3.8/site-packages/django/db/models/manager.py", line 85, in manager_method
    <source code not available>
  File "/Users/lingl/.pyenv/versions/3.8.10/envs/venv3810/lib/python3.8/site-packages/django/db/models/query.py", line 1270, in _insert
    <source code not available>
  File "/Users/lingl/.pyenv/versions/3.8.10/envs/venv3810/lib/python3.8/site-packages/django/db/models/sql/compiler.py", line 1416, in execute_sql
    <source code not available>
  File "/Users/lingl/.pyenv/versions/3.8.10/envs/venv3810/lib/python3.8/site-packages/django/db/backends/utils.py", line 98, in execute
    <source code not available>
  File "/Users/lingl/.pyenv/versions/3.8.10/envs/venv3810/lib/python3.8/site-packages/django/db/backends/utils.py", line 66, in execute
    <source code not available>
  File "/Users/lingl/.pyenv/versions/3.8.10/envs/venv3810/lib/python3.8/site-packages/django/db/backends/utils.py", line 75, in _execute_with_wrappers
    <source code not available>
  File "/Users/lingl/.pyenv/versions/3.8.10/envs/venv3810/lib/python3.8/site-packages/django/db/backends/utils.py", line 84, in _execute
    <source code not available>
  File "/Users/lingl/.pyenv/versions/3.8.10/envs/venv3810/lib/python3.8/site-packages/django/db/utils.py", line 90, in __exit__
    <source code not available>
  File "/Users/lingl/.pyenv/versions/3.8.10/envs/venv3810/lib/python3.8/site-packages/django/db/backends/utils.py", line 84, in _execute
    <source code not available>
  File "/Users/lingl/.pyenv/versions/3.8.10/envs/venv3810/lib/python3.8/site-packages/django/db/backends/sqlite3/base.py", line 423, in execute
    <source code not available>

Exception Type: IntegrityError at /text_list/
Exception Value: UNIQUE constraint failed: sentences.text_id, sentences.order, sentences.owner_id

chengxicn avatar Jun 24 '21 16:06 chengxicn

Yes, you can only un-archive one file after another for the moment. Un-archiving still needs some work to improve its speed and I was afraid the users would be stuck at a loading screen for too long (and I haven't implemented a progress bar yet)... And it's easier to debug since we can pinpoint which file is crashing the program... But I will modify this in the future when the un-archiving will work consistently without any problems (and with speed).

I couldn't reproduce your error. What I have done:

  1. using a blank program, install the demo.
  2. then install your save file
  3. Un-archiving text "Killing floor-02 (12/12)". For me it's working. So can you tell exactly which steps you've done? What text is crashing the program?

gustavklopp avatar Jun 25 '21 04:06 gustavklopp

I tried "Delete Your Account" then create account again, then "Install LWT Demo", still crashing, Let me delete all and try more to reproduce


Request Method: | POST
-- | --
http://127.0.0.1:8000/backuprestore/
3.2.3
MultipleObjectsReturned
get() returned more than one Languages -- it returned 13!
/Users/lingl/.pyenv/versions/3.8.10/envs/venv3810/lib/python3.8/site-packages/django/db/models/query.py, line 439, in get
/Applications/LingL-2021.6.23.app/Contents/MacOS/LingLibre
3.8.10
['/Applications/LingL-2021.6.23.app/Contents/MacOS/lib/library.zip',  '/Applications/LingL-2021.6.23.app/Contents/MacOS/lib']
Fri, 25 Jun 2021 15:54:44 +0000


chengxicn avatar Jun 25 '21 15:06 chengxicn

You don't have to delete your account, since each new LingL version doesn't reuse the database of the previous version. When upgrading to new LingL version, the new one uses its own database inside and you will create a new account when launching it. (https://github.com/gustavklopp/LingL#3-upgrading)

gustavklopp avatar Jun 25 '21 16:06 gustavklopp

I've tried 7.1 version, it crashed again when importing lwt db:


IntegrityError at /backuprestore/
UNIQUE constraint failed: texts.title, texts.owner_id
Request Method:	POST
Request URL:	http://127.0.0.1:8000/backuprestore/
Django Version:	3.2.3
Exception Type:	IntegrityError
Exception Value:	
UNIQUE constraint failed: texts.title, texts.owner_id
Exception Location:	/Users/lingl/.pyenv/versions/3.8.10/envs/venv3810/lib/python3.8/site-packages/django/db/backends/sqlite3/base.py, line 423, in execute
Python Executable:	/Applications/LingL-2021.7.1.app/Contents/MacOS/LingLibre
Python Version:	3.8.10
Python Path:	
['/Applications/LingL-2021.7.1.app/Contents/MacOS/lib/library.zip',
 '/Applications/LingL-2021.7.1.app/Contents/MacOS/lib']
Server time:	Fri, 02 Jul 2021 18:23:03 +0000

Environment:


Request Method: POST
Request URL: http://127.0.0.1:8000/backuprestore/

Django Version: 3.2.3
Python Version: 3.8.10
Installed Applications:
['django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django.contrib.sites',
 'django.contrib.humanize',
 'lwt',
 'tags_input',
 'mathfilters',
 'allauth',
 'allauth.account',
 'allauth.socialaccount',
 'crispy_forms']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware']



Traceback (most recent call last):
  File "/Users/lingl/.pyenv/versions/3.8.10/envs/venv3810/lib/python3.8/site-packages/django/db/backends/utils.py", line 84, in _execute
    <source code not available>
  File "/Users/lingl/.pyenv/versions/3.8.10/envs/venv3810/lib/python3.8/site-packages/django/db/backends/sqlite3/base.py", line 423, in execute
    <source code not available>

The above exception (UNIQUE constraint failed: texts.title, texts.owner_id) was the direct cause of the following exception:
  File "/Users/lingl/.pyenv/versions/3.8.10/envs/venv3810/lib/python3.8/site-packages/django/core/handlers/exception.py", line 47, in inner
    <source code not available>
  File "/Users/lingl/.pyenv/versions/3.8.10/envs/venv3810/lib/python3.8/site-packages/django/core/handlers/base.py", line 181, in _get_response
    <source code not available>
  File "/Users/lingl/lingl/LingL/lwt/views/backuprestore.py", line 196, in backuprestore
    <source code not available>
  File "/Users/lingl/lingl/LingL/lwt/views/_import_oldlwt.py", line 173, in import_oldlwt
    <source code not available>
  File "/Users/lingl/.pyenv/versions/3.8.10/envs/venv3810/lib/python3.8/site-packages/django/db/models/manager.py", line 85, in manager_method
    <source code not available>
  File "/Users/lingl/.pyenv/versions/3.8.10/envs/venv3810/lib/python3.8/site-packages/django/db/models/query.py", line 514, in bulk_create
    <source code not available>
  File "/Users/lingl/.pyenv/versions/3.8.10/envs/venv3810/lib/python3.8/site-packages/django/db/models/query.py", line 1293, in _batched_insert
    <source code not available>
  File "/Users/lingl/.pyenv/versions/3.8.10/envs/venv3810/lib/python3.8/site-packages/django/db/models/query.py", line 1270, in _insert
    <source code not available>
  File "/Users/lingl/.pyenv/versions/3.8.10/envs/venv3810/lib/python3.8/site-packages/django/db/models/sql/compiler.py", line 1416, in execute_sql
    <source code not available>
  File "/Users/lingl/.pyenv/versions/3.8.10/envs/venv3810/lib/python3.8/site-packages/django/db/backends/utils.py", line 98, in execute
    <source code not available>
  File "/Users/lingl/.pyenv/versions/3.8.10/envs/venv3810/lib/python3.8/site-packages/django/db/backends/utils.py", line 66, in execute
    <source code not available>
  File "/Users/lingl/.pyenv/versions/3.8.10/envs/venv3810/lib/python3.8/site-packages/django/db/backends/utils.py", line 75, in _execute_with_wrappers
    <source code not available>
  File "/Users/lingl/.pyenv/versions/3.8.10/envs/venv3810/lib/python3.8/site-packages/django/db/backends/utils.py", line 84, in _execute
    <source code not available>
  File "/Users/lingl/.pyenv/versions/3.8.10/envs/venv3810/lib/python3.8/site-packages/django/db/utils.py", line 90, in __exit__
    <source code not available>
  File "/Users/lingl/.pyenv/versions/3.8.10/envs/venv3810/lib/python3.8/site-packages/django/db/backends/utils.py", line 84, in _execute
    <source code not available>
  File "/Users/lingl/.pyenv/versions/3.8.10/envs/venv3810/lib/python3.8/site-packages/django/db/backends/sqlite3/base.py", line 423, in execute
    <source code not available>

Exception Type: IntegrityError at /backuprestore/
Exception Value: UNIQUE constraint failed: texts.title, texts.owner_id

chengxicn avatar Jul 02 '21 18:07 chengxicn

Try with today's release but I think the problem is due to a bug in your database: the text 'Killing floor-27 (01/10)' is noted twice. I don't know how it's happened but in LingL you can't have 2 different texts with the same title (for the same owner).

gustavklopp avatar Jul 06 '21 16:07 gustavklopp

Is the release right ? The modify dates in zip are Jun 22 and 24. Can't run the files `cc@MacBook-Pro ~ % /Users/cc/Downloads/exe.macosx-11.4-x86_64-3.8/LingLibre ; exit; zsh: killed /Users/cc/Downloads/exe.macosx-11.4-x86_64-3.8/LingLibre Saving session... ...copying shared history... ...saving history...truncating history files... ...completed.

`

chengxicn avatar Jul 06 '21 17:07 chengxicn

tried delete 'Killing floor-27 (01/10)' and import to 7.1 version, it continue crash, seems there are several texts cause the error.

chengxicn avatar Jul 06 '21 18:07 chengxicn

No, it was only this text which was in double. I've deleted the duplicate of this text in your save and I can confirm your save is working for me on my system: lwt-backup-chengxicn_FIXED.sql.gz

I've reuploaded the executable for Mac: https://github.com/gustavklopp/LingL/releases

Yes, Github isn't showing the right date, it's a bug, never fixed by them. You should only check the date in the title: "mac LingLibre 2021.07.06" executable means that the executable was created on July, 6th. 2021.

gustavklopp avatar Jul 07 '21 05:07 gustavklopp

I tried the latest release and I have the same error.

Steps to reproduce:

  1. Restore from this LWT backup: lwt-backup-2021-07-12-09-49-16.sql.gz
  2. Open 'My Texts'
  3. Try to open 'Der Luftpirat und sein lenkbares Luftschiff (04/36)'
  4. Click 'Yes' At this point, two things can happen: (a) crash with the stack trace below or (b) stuck loading forever

This happens with any text, whether it's a normal text or an imported long text.

You mentioned deleting duplicates. I browsed LWT's SQL file and I couldn't find any, but I could have missed something.

Stacktrace:

Environment:


Request Method: GET
Request URL: http://127.0.0.1:8000/text_read/10/

Django Version: 3.2
Python Version: 3.8.9
Installed Applications:
['django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django.contrib.sites',
 'django.contrib.humanize',
 'lwt',
 'tags_input',
 'mathfilters',
 'allauth',
 'allauth.account',
 'allauth.socialaccount',
 'crispy_forms']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware']



Traceback (most recent call last):
  File "C:\Users\bureau\AppData\Local\Programs\Python\Python38\lib\site-packages\django\db\backends\utils.py", line 84, in _execute
    <source code not available>
  File "C:\Users\bureau\AppData\Local\Programs\Python\Python38\lib\site-packages\django\db\backends\sqlite3\base.py", line 423, in execute
    <source code not available>

The above exception (UNIQUE constraint failed: sentences.text_id, sentences.order, sentences.owner_id) was the direct cause of the following exception:
  File "C:\Users\bureau\AppData\Local\Programs\Python\Python38\lib\site-packages\django\core\handlers\exception.py", line 47, in inner
    <source code not available>
  File "C:\Users\bureau\AppData\Local\Programs\Python\Python38\lib\site-packages\django\core\handlers\base.py", line 181, in _get_response
    <source code not available>
  File "C:\Users\bureau\AppData\Local\Programs\Python\Python38\lib\site-packages\django\contrib\auth\decorators.py", line 21, in _wrapped_view
    <source code not available>
  File "C:\Users\Bureau\LingL\lwt\views\_nolang_redirect_decorator.py", line 15, in wrap
    <source code not available>
  File "C:\Users\Bureau\LingL\lwt\views\text_read.py", line 92, in text_read
    <source code not available>
  File "C:\Users\Bureau\LingL\lwt\views\_utilities_views.py", line 529, in splitText
    <source code not available>
  File "C:\Users\bureau\AppData\Local\Programs\Python\Python38\lib\site-packages\django\db\models\manager.py", line 85, in manager_method
    <source code not available>
  File "C:\Users\bureau\AppData\Local\Programs\Python\Python38\lib\site-packages\django\db\models\query.py", line 514, in bulk_create
    <source code not available>
  File "C:\Users\bureau\AppData\Local\Programs\Python\Python38\lib\site-packages\django\db\models\query.py", line 1293, in _batched_insert
    <source code not available>
  File "C:\Users\bureau\AppData\Local\Programs\Python\Python38\lib\site-packages\django\db\models\query.py", line 1270, in _insert
    <source code not available>
  File "C:\Users\bureau\AppData\Local\Programs\Python\Python38\lib\site-packages\django\db\models\sql\compiler.py", line 1410, in execute_sql
    <source code not available>
  File "C:\Users\bureau\AppData\Local\Programs\Python\Python38\lib\site-packages\django\db\backends\utils.py", line 98, in execute
    <source code not available>
  File "C:\Users\bureau\AppData\Local\Programs\Python\Python38\lib\site-packages\django\db\backends\utils.py", line 66, in execute
    <source code not available>
  File "C:\Users\bureau\AppData\Local\Programs\Python\Python38\lib\site-packages\django\db\backends\utils.py", line 75, in _execute_with_wrappers
    <source code not available>
  File "C:\Users\bureau\AppData\Local\Programs\Python\Python38\lib\site-packages\django\db\backends\utils.py", line 84, in _execute
    <source code not available>
  File "C:\Users\bureau\AppData\Local\Programs\Python\Python38\lib\site-packages\django\db\utils.py", line 90, in __exit__
    <source code not available>
  File "C:\Users\bureau\AppData\Local\Programs\Python\Python38\lib\site-packages\django\db\backends\utils.py", line 84, in _execute
    <source code not available>
  File "C:\Users\bureau\AppData\Local\Programs\Python\Python38\lib\site-packages\django\db\backends\sqlite3\base.py", line 423, in execute
    <source code not available>

Exception Type: IntegrityError at /text_read/10/
Exception Value: UNIQUE constraint failed: sentences.text_id, sentences.order, sentences.owner_id

edoreld avatar Jul 12 '21 08:07 edoreld

I tried the latest release and I have the same error.

Steps to reproduce:

  1. Restore from this LWT backup: lwt-backup-2021-07-12-09-49-16.sql.gz
  2. Open 'My Texts'
  3. Try to open 'Der Luftpirat und sein lenkbares Luftschiff (04/36)'
  4. Click 'Yes' At this point, two things can happen: (a) crash with the stack trace below or (b) stuck loading forever

This happens with any text, whether it's a normal text or an imported long text.

You mentioned deleting duplicates. I browsed LWT's SQL file and I couldn't find any, but I could have missed something.

Stacktrace:

Environment:


Request Method: GET
Request URL: http://127.0.0.1:8000/text_read/10/

Django Version: 3.2
Python Version: 3.8.9
Installed Applications:
['django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django.contrib.sites',
 'django.contrib.humanize',
 'lwt',
 'tags_input',
 'mathfilters',
 'allauth',
 'allauth.account',
 'allauth.socialaccount',
 'crispy_forms']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware']



Traceback (most recent call last):
  File "C:\Users\bureau\AppData\Local\Programs\Python\Python38\lib\site-packages\django\db\backends\utils.py", line 84, in _execute
    <source code not available>
  File "C:\Users\bureau\AppData\Local\Programs\Python\Python38\lib\site-packages\django\db\backends\sqlite3\base.py", line 423, in execute
    <source code not available>

The above exception (UNIQUE constraint failed: sentences.text_id, sentences.order, sentences.owner_id) was the direct cause of the following exception:
  File "C:\Users\bureau\AppData\Local\Programs\Python\Python38\lib\site-packages\django\core\handlers\exception.py", line 47, in inner
    <source code not available>
  File "C:\Users\bureau\AppData\Local\Programs\Python\Python38\lib\site-packages\django\core\handlers\base.py", line 181, in _get_response
    <source code not available>
  File "C:\Users\bureau\AppData\Local\Programs\Python\Python38\lib\site-packages\django\contrib\auth\decorators.py", line 21, in _wrapped_view
    <source code not available>
  File "C:\Users\Bureau\LingL\lwt\views\_nolang_redirect_decorator.py", line 15, in wrap
    <source code not available>
  File "C:\Users\Bureau\LingL\lwt\views\text_read.py", line 92, in text_read
    <source code not available>
  File "C:\Users\Bureau\LingL\lwt\views\_utilities_views.py", line 529, in splitText
    <source code not available>
  File "C:\Users\bureau\AppData\Local\Programs\Python\Python38\lib\site-packages\django\db\models\manager.py", line 85, in manager_method
    <source code not available>
  File "C:\Users\bureau\AppData\Local\Programs\Python\Python38\lib\site-packages\django\db\models\query.py", line 514, in bulk_create
    <source code not available>
  File "C:\Users\bureau\AppData\Local\Programs\Python\Python38\lib\site-packages\django\db\models\query.py", line 1293, in _batched_insert
    <source code not available>
  File "C:\Users\bureau\AppData\Local\Programs\Python\Python38\lib\site-packages\django\db\models\query.py", line 1270, in _insert
    <source code not available>
  File "C:\Users\bureau\AppData\Local\Programs\Python\Python38\lib\site-packages\django\db\models\sql\compiler.py", line 1410, in execute_sql
    <source code not available>
  File "C:\Users\bureau\AppData\Local\Programs\Python\Python38\lib\site-packages\django\db\backends\utils.py", line 98, in execute
    <source code not available>
  File "C:\Users\bureau\AppData\Local\Programs\Python\Python38\lib\site-packages\django\db\backends\utils.py", line 66, in execute
    <source code not available>
  File "C:\Users\bureau\AppData\Local\Programs\Python\Python38\lib\site-packages\django\db\backends\utils.py", line 75, in _execute_with_wrappers
    <source code not available>
  File "C:\Users\bureau\AppData\Local\Programs\Python\Python38\lib\site-packages\django\db\backends\utils.py", line 84, in _execute
    <source code not available>
  File "C:\Users\bureau\AppData\Local\Programs\Python\Python38\lib\site-packages\django\db\utils.py", line 90, in __exit__
    <source code not available>
  File "C:\Users\bureau\AppData\Local\Programs\Python\Python38\lib\site-packages\django\db\backends\utils.py", line 84, in _execute
    <source code not available>
  File "C:\Users\bureau\AppData\Local\Programs\Python\Python38\lib\site-packages\django\db\backends\sqlite3\base.py", line 423, in execute
    <source code not available>

Exception Type: IntegrityError at /text_read/10/
Exception Value: UNIQUE constraint failed: sentences.text_id, sentences.order, sentences.owner_id

edoreld avatar Jul 12 '21 08:07 edoreld

Try today release. One important point:

Restore from this LWT backup: lwt-backup-2021-07-12-09-49-16.sql.gz

Don't forget at this point to edit the imported language and to use the built-in language for LingL: You'll get the best results (in term of dictionaries, parsing of the text etc..)

Open 'My Texts' Try to open 'Der Luftpirat und sein lenkbares Luftschiff (04/36)' Click 'Yes'

gustavklopp avatar Jul 12 '21 10:07 gustavklopp

Stuck with the "Unarchiving in progress" popup.

Steps to reproduce:

  • I downloaded the latest release, then re-imported the lwt backup from my previous comment.
  • I edited the language, chose French and then re-chose German to force the defaults. I saved it.
  • Then, I went to texts and I tried to edit a random one. It asked me to unarchive, so I said yes.

What happens? A pop-up appears, saying "Unarchiving in progress. Please wait". So far it's been around 3 minutes and still the text isn't being opened.

I tried refreshing the page and opening another text. In this case, I got the same error as before (stacktrace at the bottom of this post)

Also worth noting:

  • If I click on "Edit", instead of "Read" on a text, it asks me to unarchive, and the unarchiving seems to work (though I find the editing interface weird)

Stacktrace

Environment:


Request Method: GET
Request URL: http://127.0.0.1:8000/text_read/5/

Django Version: 3.2
Python Version: 3.8.9
Installed Applications:
['django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django.contrib.sites',
 'django.contrib.humanize',
 'lwt',
 'tags_input',
 'mathfilters',
 'allauth',
 'allauth.account',
 'allauth.socialaccount',
 'crispy_forms']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware']



Traceback (most recent call last):
  File "C:\Users\bureau\AppData\Local\Programs\Python\Python38\lib\site-packages\django\db\backends\utils.py", line 84, in _execute
    <source code not available>
  File "C:\Users\bureau\AppData\Local\Programs\Python\Python38\lib\site-packages\django\db\backends\sqlite3\base.py", line 423, in execute
    <source code not available>

The above exception (UNIQUE constraint failed: sentences.text_id, sentences.order, sentences.owner_id) was the direct cause of the following exception:
  File "C:\Users\bureau\AppData\Local\Programs\Python\Python38\lib\site-packages\django\core\handlers\exception.py", line 47, in inner
    <source code not available>
  File "C:\Users\bureau\AppData\Local\Programs\Python\Python38\lib\site-packages\django\core\handlers\base.py", line 181, in _get_response
    <source code not available>
  File "C:\Users\bureau\AppData\Local\Programs\Python\Python38\lib\site-packages\django\contrib\auth\decorators.py", line 21, in _wrapped_view
    <source code not available>
  File "C:\Users\Bureau\LingL\lwt\views\_nolang_redirect_decorator.py", line 15, in wrap
    <source code not available>
  File "C:\Users\Bureau\LingL\lwt\views\text_read.py", line 92, in text_read
    <source code not available>
  File "C:\Users\Bureau\LingL\lwt\views\_utilities_views.py", line 529, in splitText
    <source code not available>
  File "C:\Users\bureau\AppData\Local\Programs\Python\Python38\lib\site-packages\django\db\models\manager.py", line 85, in manager_method
    <source code not available>
  File "C:\Users\bureau\AppData\Local\Programs\Python\Python38\lib\site-packages\django\db\models\query.py", line 514, in bulk_create
    <source code not available>
  File "C:\Users\bureau\AppData\Local\Programs\Python\Python38\lib\site-packages\django\db\models\query.py", line 1293, in _batched_insert
    <source code not available>
  File "C:\Users\bureau\AppData\Local\Programs\Python\Python38\lib\site-packages\django\db\models\query.py", line 1270, in _insert
    <source code not available>
  File "C:\Users\bureau\AppData\Local\Programs\Python\Python38\lib\site-packages\django\db\models\sql\compiler.py", line 1410, in execute_sql
    <source code not available>
  File "C:\Users\bureau\AppData\Local\Programs\Python\Python38\lib\site-packages\django\db\backends\utils.py", line 98, in execute
    <source code not available>
  File "C:\Users\bureau\AppData\Local\Programs\Python\Python38\lib\site-packages\django\db\backends\utils.py", line 66, in execute
    <source code not available>
  File "C:\Users\bureau\AppData\Local\Programs\Python\Python38\lib\site-packages\django\db\backends\utils.py", line 75, in _execute_with_wrappers
    <source code not available>
  File "C:\Users\bureau\AppData\Local\Programs\Python\Python38\lib\site-packages\django\db\backends\utils.py", line 84, in _execute
    <source code not available>
  File "C:\Users\bureau\AppData\Local\Programs\Python\Python38\lib\site-packages\django\db\utils.py", line 90, in __exit__
    <source code not available>
  File "C:\Users\bureau\AppData\Local\Programs\Python\Python38\lib\site-packages\django\db\backends\utils.py", line 84, in _execute
    <source code not available>
  File "C:\Users\bureau\AppData\Local\Programs\Python\Python38\lib\site-packages\django\db\backends\sqlite3\base.py", line 423, in execute
    <source code not available>

Exception Type: IntegrityError at /text_read/5/
Exception Value: UNIQUE constraint failed: sentences.text_id, sentences.order, sentences.owner_id

edoreld avatar Jul 12 '21 11:07 edoreld

It' working on Linux. The problem is that I've built the program on Windows with an outdated Python version (3.8.9) (because that's all that my Windows has). Same thing with macOS, it's built with 3.8.10. It should be built with Python 3.8.11 (apparently because I'm using advanced functions now like multi-processing) but Python 3.8.11 exists neither on Windows, nor macOS. Great! I'll try to overcome this but it will need some time (maybe python 3.9.0?).

In the interval, it would be great if someone could try building it on his own Windows or macOS machine (hopefully with a Python version >=3.8.11)

gustavklopp avatar Jul 13 '21 05:07 gustavklopp

I built it with python version 3.9.2.

Unfortunately, nothing seems to have improved:

  • Stuck on "Unarchiving in progress" when opening a text imported from LWT OR "Unique constraint violated" error
  • Unable to create a new text (Stuck on "Processing text. Please wait"

Any ideas?

By the way, you can use Docker to overcome python version limitations on old versions of Windows.

edoreld avatar Jul 13 '21 06:07 edoreld

Thanks!

I built it with python version 3.9.2.

and if you only run it (python manage.py runserver) (without building with CX_Freeze)? Else can you try python 3.9.0? This version is available on pyenv for Linux, Windows and macOS. And I confirm it's working on Linux.

By the way, you can use Docker to overcome python version limitations on old versions of Windows.

First that was what I've built but I realized it could be an obstacle for non-technical audience since you need to know how to run Docker.

gustavklopp avatar Jul 13 '21 08:07 gustavklopp

Ok, I've decided to delete the executables for macOS and Windows since my PC isn't powerful enough to create those (I'm using virtual machine). And as time goes, windows and mac become more and more memory hungry so... You can create the executable if you are on one of these platforms and I will update the release page with pleasure, so that other people can benefit from this. You can still run LingLibre without the executables (see Readme: #2.1-use-the-built-in-server-inside-django that I've updated)

gustavklopp avatar Jul 13 '21 14:07 gustavklopp

I tried running it with Django, and while I was able to log in to the server, I'm finding a new error that I'm a bit puzzled about.

When I try to import my LWT backup, it says the stacktrace at the bottom of this post.

Also, it gets stuck on Processing text when adding some random text of the German language. Maybe the solution would be to move to Linux :P?

Environment:


Request Method: POST
Request URL: http://127.0.0.1:8000/backuprestore/

Django Version: 3.2.4
Python Version: 3.9.2
Installed Applications:
['django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django.contrib.sites',
 'django.contrib.humanize',
 'lwt',
 'tags_input',
 'mathfilters',
 'allauth',
 'allauth.account',
 'allauth.socialaccount',
 'crispy_forms']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware']



Traceback (most recent call last):
  File "C:\Users\Edoreld\Documents\LingL\venv\lib\site-packages\django\db\backends\utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
  File "C:\Users\Edoreld\Documents\LingL\venv\lib\site-packages\django\db\backends\sqlite3\base.py", line 423, in execute
    return Database.Cursor.execute(self, query, params)

The above exception (UNIQUE constraint failed: texts_texttags.texts_id, texts_texttags.texttags_id) was the direct cause of the following exception:
  File "C:\Users\Edoreld\Documents\LingL\venv\lib\site-packages\django\core\handlers\exception.py", line 47, in inner
    response = get_response(request)
  File "C:\Users\Edoreld\Documents\LingL\venv\lib\site-packages\django\core\handlers\base.py", line 181, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "C:\Users\Edoreld\Documents\LingL\lwt\views\backuprestore.py", line 201, in backuprestore
    result_nb = import_oldlwt(request.user, fp)
  File "C:\Users\Edoreld\Documents\LingL\lwt\views\_import_other_softwares.py", line 246, in import_oldlwt
    ThroughModel.objects.bulk_create(args)
  File "C:\Users\Edoreld\Documents\LingL\venv\lib\site-packages\django\db\models\manager.py", line 85, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "C:\Users\Edoreld\Documents\LingL\venv\lib\site-packages\django\db\models\query.py", line 514, in bulk_create
    returned_columns = self._batched_insert(
  File "C:\Users\Edoreld\Documents\LingL\venv\lib\site-packages\django\db\models\query.py", line 1293, in _batched_insert
    self._insert(item, fields=fields, using=self.db, ignore_conflicts=ignore_conflicts)
  File "C:\Users\Edoreld\Documents\LingL\venv\lib\site-packages\django\db\models\query.py", line 1270, in _insert
    return query.get_compiler(using=using).execute_sql(returning_fields)
  File "C:\Users\Edoreld\Documents\LingL\venv\lib\site-packages\django\db\models\sql\compiler.py", line 1416, in execute_sql
    cursor.execute(sql, params)
  File "C:\Users\Edoreld\Documents\LingL\venv\lib\site-packages\django\db\backends\utils.py", line 98, in execute
    return super().execute(sql, params)
  File "C:\Users\Edoreld\Documents\LingL\venv\lib\site-packages\django\db\backends\utils.py", line 66, in execute
    return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
  File "C:\Users\Edoreld\Documents\LingL\venv\lib\site-packages\django\db\backends\utils.py", line 75, in _execute_with_wrappers
    return executor(sql, params, many, context)
  File "C:\Users\Edoreld\Documents\LingL\venv\lib\site-packages\django\db\backends\utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
  File "C:\Users\Edoreld\Documents\LingL\venv\lib\site-packages\django\db\utils.py", line 90, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "C:\Users\Edoreld\Documents\LingL\venv\lib\site-packages\django\db\backends\utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
  File "C:\Users\Edoreld\Documents\LingL\venv\lib\site-packages\django\db\backends\sqlite3\base.py", line 423, in execute
    return Database.Cursor.execute(self, query, params)

Exception Type: IntegrityError at /backuprestore/
Exception Value: UNIQUE constraint failed: texts_texttags.texts_id, texts_texttags.texttags_id

edoreld avatar Jul 17 '21 09:07 edoreld

Python Version: 3.9.2

I'm building on Python 3.9.0 specifically and your backup file is working for me. Can you try with Python 3.9.0 and the today's release?

Maybe the solution would be to move to Linux :P?

I wouldn´t say the contrary... ;) Well, managing different platforms is really a pain...

gustavklopp avatar Jul 23 '21 08:07 gustavklopp

By the way, you can use Docker to overcome python version limitations on old versions of Windows.

Big news: I've created a Docker version! Please follow the instructions if you want to try it.

gustavklopp avatar Aug 01 '21 08:08 gustavklopp