#5664 (Error 400 and Incorrect Confirmation:Inconsistency when Editing Person)
by Johana Amorin · in Developers · assigned to Luc Saffre
Résumé
Public demo site cosi1e: When trying to edit a person's data in the Persons section, an error occurs with the following message: "Bad request: Object Does not exist: invalid primary key "id number" for sepa.AccountsByPartner". Although the error message appears, the changes made are saved correctly in the database. After receiving the error message, the system prompts to exit without saving the changes, but when reviewing the table, the changes are reflected.
Steps to Play:
-Navigate to the detail window of a person.
-Edit an existing record (e.g., change the first or last name).
-Save the changes.
-The above error message appears.
-Select "Exit without saving changes".
-Review the people table and note that the changes have been applied.
Concepts sous-jacents
Commentaires
- 2 ans, 3 mois ago by Johana Amorin about #5664 (Error 400 and Incorrect Confirmation:Inconsistency when Editing Person) : ok, I was able to work by entering it manually. I was checking the behavior of the database and I didn't see anything according to the error, sometimes the errors related to primary keys can be in the input data of the forms, I will check it tomorrow.
- 2 ans, 3 mois ago by Luc Saffre about #5664 (Error 400 and Incorrect Confirmation:Inconsistency when Editing Person) : Let's have a Jitsi session tomorrow.
- 2 ans, 3 mois ago by Luc Saffre about #5664 (Error 400 and Incorrect Confirmation:Inconsistency when Editing Person) : I tried it again on my machine and it works as the guide says. I found a minor bug in getlino, but this bug is not the reason for your problem. So I don't know what's wrong on your machine.
- 2 ans, 3 mois ago by Johana Amorin about #5664 (Error 400 and Incorrect Confirmation:Inconsistency when Editing Person) : I have entered the correct paths manually and the site has been created correctly. Does it work for you @luc as the guide says?
- 2 ans, 3 mois ago by Johana Amorin about #5664 (Error 400 and Incorrect Confirmation:Inconsistency when Editing Person) (1 reply) : I deleted the configuration file and ran "getlino configure --clone --devtools --appy" as non-root, then I followed again the steps of "set up a site with a MySQL database". But the site is not created in my local folder but in 2 but in /usr/local/lino/lino_local/cosi2. then I get: "Virtualenv share...
- 2 ans, 4 mois ago by Johana Amorin about #5664 (Error 400 and Incorrect Confirmation:Inconsistency when Editing Person) (2 replies) : The site is not created in my local folder /home/joyamorin/lino/lino_local/cosi2 but in /usr/local/lino/lino_local/cosi2. Shared virtualenv []: When I click OK on the steps, I get: from lino_local.settings import * ModuleNotFoundError: No module named 'lino_local.settings' Error: . /usr/local/lino/l...
- 2 ans, 4 mois ago by Johana Amorin about #5664 (Error 400 and Incorrect Confirmation:Inconsistency when Editing Person) : Anayway I have answered the ramainning question with ENTER, I going to try removing the file
- 2 ans, 4 mois ago by Luc Saffre about #5664 (Error 400 and Incorrect Confirmation:Inconsistency when Editing Person) (1 reply) : I guess that you have been answering "y" when 'getlino configure' asked for env_link. Compare with the output on [url dev.lino-framework.org/topics/mysql.html How to set up a site with a MySQL database]. Oops! Now I see that there is a typo on this page! It says "Hit y and answer all remaining quest...
- 2 ans, 4 mois ago by Johana Amorin about #5664 (Error 400 and Incorrect Confirmation:Inconsistency when Editing Person) : ok, now I have the error "ERROR 1396 (HY000): Operation CREATE USER failed for 'y'@'y", meaning that the user already exists, if I remove it using DROP USER 'y'@'y'; and run getlino again it creates it correctly and I get "FileNotFoundError: [Errno 2] No such file or directory: 'y/bin/pull.sh'", app...
- 2 ans, 4 mois ago by Luc Saffre about #5664 (Error 400 and Incorrect Confirmation:Inconsistency when Editing Person) : I fixed the bug in getlino and released v 24.6.0. . If you are using a clone of getlino, then say "go getlino" and "git pull". Otherwise say "pip install -U getlino". And then try to run "getlino configure" again.
- 2 ans, 4 mois ago by Luc Saffre about #5664 (Error 400 and Incorrect Confirmation:Inconsistency when Editing Person) : Congratulations, you found another bug: #5669 (getlino breaks when no group www-data exists)
- 2 ans, 4 mois ago by Johana Amorin about #5664 (Error 400 and Incorrect Confirmation:Inconsistency when Editing Person) : I´m checking this
- 2 ans, 4 mois ago by Johana Amorin about #5664 (Error 400 and Incorrect Confirmation:Inconsistency when Editing Person) (1 reply) : ok, when a run getlino confugure as root, when a get to the question "Set group owner for y to 'y'' [y or n] Yes" i get Traceback (most recent call last): File "/home/joyamorin/lino/env/bin/getlino", line 33, in <module> sys.exit(load_entry_point('getlino==24.4.0', 'console_scripts', 'getlino')()) File "/home/joyamorin/lino/env/lib/python3.10/site-packages/click/core.py", line 1157, in __call_...
- 2 ans, 4 mois ago by Luc Saffre about #5664 (Error 400 and Incorrect Confirmation:Inconsistency when Editing Person) : But I just discovered that my yesterday's comment seems to be wrong, even in a site with mysql I could no longer reproduce the issue found on coi1e. So it's not too late for the better-than-luc award.
- 2 ans, 4 mois ago by Luc Saffre about #5664 (Error 400 and Incorrect Confirmation:Inconsistency when Editing Person) : I wrote a page [url dev.lino-framework.org/topics/mysql.html How to set up a site with a MySQL database in your developer environment].
- 2 ans, 4 mois ago by Johana Amorin about #5664 (Error 400 and Incorrect Confirmation:Inconsistency when Editing Person) : Yes
- 2 ans, 4 mois ago by Johana Amorin about #5664 (Error 400 and Incorrect Confirmation:Inconsistency when Editing Person) (1 reply) : I would like to check the error to see the flow, in which repository is it?
- 2 ans, 4 mois ago by Luc Saffre about #5664 (Error 400 and Incorrect Confirmation:Inconsistency when Editing Person) : Ha! now it's too late for the better-than-luc award. The issue comes indeed only with mysql, not with sqlite. To reproduce it, I used getlino configure and getlino startsite. It was a bit tricky to use, though, maybe just because i had some older getlino conf file on my machine.
- 2 ans, 4 mois ago by Luc Saffre about #5664 (Error 400 and Incorrect Confirmation:Inconsistency when Editing Person) : But with sqlite i get "OperationalError: attempt to write a readonly database" as soon as i try to sign in. Although nginx/uwsgi.ini has processes = 1. I don't see a quick solution, so i'll now switch back to mysql.
- 2 ans, 4 mois ago by Luc Saffre about #5664 (Error 400 and Incorrect Confirmation:Inconsistency when Editing Person) : One difference between cosi1e and apc is DATABASES. The cosi1e is using MySQL. I'm trying it with sqlite now.
- 2 ans, 4 mois ago by Luc Saffre about #5664 (Error 400 and Incorrect Confirmation:Inconsistency when Editing Person) : I converted the settings *package* of the apc demo project into a simple settings.py file and changed from extjs to react front end. Which caused a dozen trivial changes in the doctests. Having the settings of demo projects in a package (with moduleds demo, doctest and others) is a deprecated approa...
- 2 ans, 4 mois ago by Luc Saffre about #5664 (Error 400 and Incorrect Confirmation:Inconsistency when Editing Person) : In apc I changed the settings to be exactly as in cosi1e (languages = 'en fr de', default_ui = "lino_react.react", the_demo_date=None, yield ('accounting', 'start_year', 2020)), then ran pm prep and tried again. No error on my machine! I re-ran buildcache and collectstatic and supervisor restart on ...
- 2 ans, 4 mois ago by Luc Saffre about #5664 (Error 400 and Incorrect Confirmation:Inconsistency when Editing Person) : This problem SHOULD be reproducible in the apc project in the book. But it ISN'T. I'm trying to find out why.
- 2 ans, 4 mois ago by Luc Saffre about #5664 (Error 400 and Incorrect Confirmation:Inconsistency when Editing Person) : The message "Invalid primary key 177 for sepa.AccountsByPartner" indicates that the exception has to do with the "Bank accounts" tab where we have the slave table sepa.AccountsByPartner.
- 2 ans, 4 mois ago by Luc Saffre about #5664 (Error 400 and Incorrect Confirmation:Inconsistency when Editing Person) : Good work, @joy. The error itself is probably trivial, but it did not get logged in the lino.log file, which is a more serious bug. I could reproduce the problem on the demo site, but not locally on my machine (i tried cosi5 and apc). The public demo site is up-to-date (it gets updated every morning...
- 2 ans, 4 mois ago by Johana Amorin about #5664 (Error 400 and Incorrect Confirmation:Inconsistency when Editing Person) : I am checking an error message in the console: Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'map') in ActionHandler.tsx:634.
- 2 ans, 4 mois ago by Johana Amorin about #5664 (Error 400 and Incorrect Confirmation:Inconsistency when Editing Person) : Created new Ticket #5664 (Error 400 and Incorrect Confirmation:Inconsistency when Editing Person).