bug: V13 new install: frappe.exceptions.LinkValidationError: Could not find User Id
See original GitHub issueDescription of the issue
On setting up a brand new V13 instance from the develop branch (both only frappe, and with erpnext), running through the setup wizard as Administrator & setting a User ID, I received the below stack trace.
It seems frappe.core.doctype.user.user.create_contact
is being run as a background job before the user exists in the db, and ignore_links
is not True
Context information (for bug reports)
Output of bench version
Frappe Framework: v13.x.x-develop () (develop)
Steps to reproduce the issue
- On a fresh develop frappe instance run
bench --site <site> --force reinstall
- Log in as Administrator and run through the wizard steps
- Enter an email address & password
Observed result
You will always get the below stack trace but it doesn’t appear to affect the setup process. The user is created in the db
Expected result
The Contact
creation should be triggered synchronously after the User
creation rather than asynchronously as a background job.
Stacktrace / full error message
23:44:04 web.1 | 10.0.2.2 - - [14/Feb/2021 23:44:04] "POST /api/method/frappe.geo.country_info.get_country_timezone_info HTTP/1.1" 200 -
23:44:11 web.1 | 10.0.2.2 - - [14/Feb/2021 23:44:11] "GET /api/method/frappe.desk.form.load.getdoc?doctype=Currency&name=GBP&_=1613346239256 HTTP/1.1" 200 -
23:44:13 web.1 | 10.0.2.2 - - [14/Feb/2021 23:44:13] "POST /api/method/frappe.desk.page.setup_wizard.setup_wizard.load_user_details HTTP/1.1" 200 -
23:44:35 web.1 | 10.0.2.2 - - [14/Feb/2021 23:44:35] "POST /api/method/frappe.core.doctype.user.user.test_password_strength HTTP/1.1" 200 -
23:44:36 web.1 | * Detected change in '/home/frappe/erpnextv13/apps/frappe/frappe/utils/__pycache__/password_strength.cpython-36.pyc', reloading
23:44:37 web.1 | * Restarting with inotify reloader
23:44:38 web.1 | * Debugger is active!
23:44:38 web.1 | * Debugger PIN: 692-805-653
23:44:38 web.1 | 10.0.2.2 - - [14/Feb/2021 23:44:38] "POST /api/method/frappe.core.doctype.user.user.test_password_strength HTTP/1.1" 200 -
23:44:42 web.1 | * Detected change in '/home/frappe/erpnextv13/apps/frappe/frappe/utils/__pycache__/formatters.cpython-36.pyc', reloading
23:44:44 worker_default.1 | Traceback (most recent call last):
23:44:44 worker_default.1 | File "/home/frappe/erpnextv13/apps/frappe/frappe/utils/background_jobs.py", line 100, in execute_job
23:44:44 worker_default.1 | method(**kwargs)
23:44:44 worker_default.1 | File "/home/frappe/erpnextv13/apps/frappe/frappe/core/doctype/user/user.py", line 1097, in create_contact
23:44:44 worker_default.1 | contact.insert(ignore_permissions=True, ignore_links=ignore_links, ignore_mandatory=ignore_mandatory)
23:44:44 worker_default.1 | File "/home/frappe/erpnextv13/apps/frappe/frappe/model/document.py", line 232, in insert
23:44:44 worker_default.1 | self._validate_links()
23:44:44 worker_default.1 | File "/home/frappe/erpnextv13/apps/frappe/frappe/model/document.py", line 817, in _validate_links
23:44:44 worker_default.1 | frappe.LinkValidationError)
23:44:44 worker_default.1 | File "/home/frappe/erpnextv13/apps/frappe/frappe/__init__.py", line 416, in throw
23:44:44 worker_default.1 | msgprint(msg, raise_exception=exc, title=title, indicator='red', is_minimizable=is_minimizable, wide=wide, as_list=as_list)
23:44:44 worker_default.1 | File "/home/frappe/erpnextv13/apps/frappe/frappe/__init__.py", line 395, in msgprint
23:44:44 worker_default.1 | _raise_exception()
23:44:44 worker_default.1 | File "/home/frappe/erpnextv13/apps/frappe/frappe/__init__.py", line 349, in _raise_exception
23:44:44 worker_default.1 | raise raise_exception(msg)
23:44:44 worker_default.1 | frappe.exceptions.LinkValidationError: Could not find User Id: [REDACTED]
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:5 (5 by maintainers)
Top Results From Across the Web
frappe.exceptions.LinkValidationError: Could not find User Id ...
I have upgraded frappe from v12 to v13 and this error occurs in the error log every time a new user is created....
Read more >Setup wizard needs retries to complete · Issue #751 - GitHub
I think the frappe.exceptions.LinkValidationError: Could not find User Id: user1@example.org is misleading. It has nothing to do with wizard ...
Read more >Configuration - Frappe Framework
Configuration. Frappe sites can share the same application server, each behind different database solutions, configurations and locations, with different ...
Read more >ERPNext 12.18.0 / 13.0.0 Cross Site Scripting - Packet Storm
When an API call causes an error the server sometimes sends back exception messages containing the user input which is not sanitized.
Read more >Git - OpenForge
sudo apt-get install mariadb-server mariadb-common libmariadbclient-dev ... -frappe is freely available to use under the MIT License. +MIT License.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Same error 😟 but it did retry itself (I didn’t touch the web page) and logged in okay
Okay so there appeared to be two problems on top of each other:
I’ll update the error description