question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug: V13 new install: frappe.exceptions.LinkValidationError: Could not find User Id

See original GitHub issue

Description 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

  1. On a fresh develop frappe instance run bench --site <site> --force reinstall
  2. Log in as Administrator and run through the wizard steps
  3. 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:open
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
nameduser0commented, Apr 11, 2022

web: bench serve --port 8000 --noreload in Procfile

Same error 😟 but it did retry itself (I didn’t touch the web page) and logged in okay

0reactions
nameduser0commented, Apr 11, 2022

Okay so there appeared to be two problems on top of each other:

  • The original exception above which still happens and is not resolved
  • The socketio problem which was mine and prevented the wizard from showing progress and completing

I’ll update the error description

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found