Installer fails adding admin user with error "foreign key constraint fails" #208
-
|
I noticed quite a few new commits when I pulled today, but the installer still doesn't complete for me. I was able to dig a little deeper and hopefully this will help someone understand the cause. The installer fails in Page 6 after showing "Populating the database with demo data", I think when trying to add the admin user to the www_users table. I tried running the "add admin user" query from page_6.php (starting on line 210) directly in Adminer (AdminerEvo), with anything comming from the SESSION replaced with fixed text. This resulted in the following error:
Fwiw, I'm using MariaDb 10.6 on FreeBSD, which may be stricter than typical Linux. Does this tell anyone anything? Cheers, Edited query: |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 4 replies
-
|
Also fwiw 178 tables are created according to Adminer (not 175 as reported seperately by @efeoli #204 (comment)) |
Beta Was this translation helpful? Give feedback.
-
|
Noticed error in httpd-error.log. Is it expected that the referer is "...Page=5" even though the script running is page_6.php?
|
Beta Was this translation helpful? Give feedback.
-
|
Well this is weird. I have run the installer with sql-mode set as sql-mode="STRICT_ALL_TABLES" using php 8.3.13 and it ran fine. This is supposed to be the strictest. There were a couple of SQL errors which I have corrected, but not with the user. Try getting these from github and see if it works now. Thanks |
Beta Was this translation helpful? Give feedback.
-
|
Thanks Tim. I'm getting closer, the database is now populated but the admin user password entered during the install procedure isn't accepted for login. Started with git pull... Deleted the old config.php, then dropped and re-created the "weberp" database (utf8mb4_unicode_ci collation), and browsed to the installer. Defaults were used except username and password, and admin user email and password. So far so good, looks like database was populated.... "Restarted" webERP and attempted to login but not successful. Examined www_users table in database and "seems" ok. Can you advise how to hack code to still login if password match fails? I was thinking if I could login as admin, I could create a new user with same password then see if I can login as new user, and also check the encrypted passwords in the database to see if they match looking for an issue with password encryption... |
Beta Was this translation helpful? Give feedback.
-
|
Thanks, I'm in! I was expecting the admin user password to be what I entered (iirc only the chart of accounts tooltip says it will be ignored if you specify loading demo data). Should I see the "invalid" ID message though? This is the first successful login after trying with the "wrong" password a couple times. I poked around some and didn't notice any errors, so I'll restore my old demo database and see what happens (btw, if you like the demo database I would happily contribute it to the project - one small cohesive product with about 25 parts in three BOM levels and including a few few purchase, manufacturing and sales orders). |
Beta Was this translation helpful? Give feedback.





Ah, the demo data will overwrite your choices, so the user/password will be admin/weberp
Is this what you entered?
Tim