ERPNext error after updating from 13 dev to stable

erpnext@zafar-virtual-machine:~$ bench switch-to-branch version-13 frappe erpnext --upgrade
WARN: Command not being executed in bench directory
ERROR: frappe does not exist!
ERROR: erpnext does not exist!
erpnext@zafar-virtual-machine:~$ cd /opt/bench/erpnext
erpnext@zafar-virtual-machine:/opt/bench/erpnext$ bench switch-to-branch version-13 frappe erpnext --upgrade
Traceback (most recent call last):
File “/usr/lib/python3.8/runpy.py”, line 185, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File “/usr/lib/python3.8/runpy.py”, line 111, in _get_module_details
import(pkg_name)
File “/opt/bench/erpnext/apps/frappe/frappe/init.py”, line 25, in
from past.builtins import cmp
ModuleNotFoundError: No module named ‘past’

INFO: Fetching upstream unshallow for frappe
$ git remote set-branches upstream ‘*’
$ git fetch --all --unshallow --quiet
remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
From GitHub - frappe/frappe: Low code web framework for real world applications, in Python and Javascript

  • branch version-13 → FETCH_HEAD
    Switching for frappe
    $ git checkout -f version-13
    Already on ‘version-13’
    Your branch is up to date with ‘upstream/version-13’.
    INFO: Fetching upstream unshallow for erpnext
    $ git remote set-branches upstream ‘*’
    $ git fetch --all --unshallow --quiet
    remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
    From GitHub - frappe/erpnext: Free and Open Source Enterprise Resource Planning (ERP)
  • branch version-13 → FETCH_HEAD
    Switching for erpnext
    $ git checkout -f version-13
    Already on ‘version-13’
    Your branch is up to date with ‘upstream/version-13’.
    SUCCESS: Successfully switched branches for: frappe, erpnext
    Please run bench update --patch to be safe from any differences in database schema
    erpnext@zafar-virtual-machine:/opt/bench/erpnext$ sudo service nginx restart
    [sudo] password for erpnext:
    erpnext@zafar-virtual-machine:/opt/bench/erpnext$ sudo supervisorctl reload
    Restarted supervisord
    erpnext@zafar-virtual-machine:/opt/bench/erpnext$ bench update --patch
    Traceback (most recent call last):
    File “/usr/lib/python3.8/runpy.py”, line 185, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
    File “/usr/lib/python3.8/runpy.py”, line 111, in _get_module_details
    import(pkg_name)
    File “/opt/bench/erpnext/apps/frappe/frappe/init.py”, line 25, in
    from past.builtins import cmp
    ModuleNotFoundError: No module named ‘past’

Bench command cache doesn’t exist in this folder!
remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
From GitHub - frappe/frappe: Low code web framework for real world applications, in Python and Javascript

  • branch version-13 → FETCH_HEAD
    WARN: shallow_clone is set in your bench config.
    However without passing the --reset flag, your repositories will be unshallowed.
    To avoid this, cancel this operation and run bench update --reset.

Consider the consequences of git reset --hard on your apps before you run that.
To avoid seeing this warning, set shallow_clone to false in your common_site_config.json

Backing up sites…
Traceback (most recent call last):
File “/usr/lib/python3.8/runpy.py”, line 185, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File “/usr/lib/python3.8/runpy.py”, line 111, in _get_module_details
import(pkg_name)
File “/opt/bench/erpnext/apps/frappe/frappe/init.py”, line 25, in
from past.builtins import cmp
ModuleNotFoundError: No module named ‘past’
erpnext@zafar-virtual-machine:/opt/bench/erpnext$ sudo systemctl start supervisor
erpnext@zafar-virtual-machine:/opt/bench/erpnext$ sudo systemctl enable supervisor
Synchronizing state of supervisor.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable supervisor
erpnext@zafar-virtual-machine:/opt/bench/erpnext$ sudo bench setup production -erpnext-
Traceback (most recent call last):
File “/usr/lib/python3.8/runpy.py”, line 185, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File “/usr/lib/python3.8/runpy.py”, line 111, in _get_module_details
import(pkg_name)
File “/opt/bench/erpnext/apps/frappe/frappe/init.py”, line 25, in
from past.builtins import cmp
ModuleNotFoundError: No module named ‘past’

Usage: bench setup production [OPTIONS] USER
Try “bench setup production --help” for help.

Error: no such option: -e
erpnext@zafar-virtual-machine:/opt/bench/erpnext$ sudo bench setup production -your-user-
Traceback (most recent call last):
File “/usr/lib/python3.8/runpy.py”, line 185, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File “/usr/lib/python3.8/runpy.py”, line 111, in _get_module_details
import(pkg_name)
File “/opt/bench/erpnext/apps/frappe/frappe/init.py”, line 25, in
from past.builtins import cmp
ModuleNotFoundError: No module named ‘past’

Usage: bench setup production [OPTIONS] USER
Try “bench setup production --help” for help.

Error: no such option: -y
erpnext@zafar-virtual-machine:/opt/bench/erpnext$ sudo bench setup production -your-user-
Traceback (most recent call last):
File “/usr/lib/python3.8/runpy.py”, line 185, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File “/usr/lib/python3.8/runpy.py”, line 111, in _get_module_details
import(pkg_name)
File “/opt/bench/erpnext/apps/frappe/frappe/init.py”, line 25, in
from past.builtins import cmp
ModuleNotFoundError: No module named ‘past’

Usage: bench setup production [OPTIONS] USER
Try “bench setup production --help” for help.

Error: no such option: -y
erpnext@zafar-virtual-machine:/opt/bench/erpnext$ sudo bench setup production erpnext update
Traceback (most recent call last):
File “/usr/lib/python3.8/runpy.py”, line 185, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File “/usr/lib/python3.8/runpy.py”, line 111, in _get_module_details
import(pkg_name)
File “/opt/bench/erpnext/apps/frappe/frappe/init.py”, line 25, in
from past.builtins import cmp
ModuleNotFoundError: No module named ‘past’

Usage: bench setup production [OPTIONS] USER
Try “bench setup production --help” for help.

Error: Got unexpected extra argument (update)
erpnext@zafar-virtual-machine:/opt/bench/erpnext$ bench update
Traceback (most recent call last):
File “/usr/lib/python3.8/runpy.py”, line 185, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File “/usr/lib/python3.8/runpy.py”, line 111, in _get_module_details
import(pkg_name)
File “/opt/bench/erpnext/apps/frappe/frappe/init.py”, line 25, in
from past.builtins import cmp
ModuleNotFoundError: No module named ‘past’

Bench command cache doesn’t exist in this folder!
remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
From GitHub - frappe/frappe: Low code web framework for real world applications, in Python and Javascript

  • branch version-13 → FETCH_HEAD
    WARN: shallow_clone is set in your bench config.
    However without passing the --reset flag, your repositories will be unshallowed.
    To avoid this, cancel this operation and run bench update --reset.

Consider the consequences of git reset --hard on your apps before you run that.
To avoid seeing this warning, set shallow_clone to false in your common_site_config.json

Backing up sites…
Traceback (most recent call last):
File “/usr/lib/python3.8/runpy.py”, line 185, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File “/usr/lib/python3.8/runpy.py”, line 111, in _get_module_details
import(pkg_name)
File “/opt/bench/erpnext/apps/frappe/frappe/init.py”, line 25, in
from past.builtins import cmp
ModuleNotFoundError: No module named ‘past’
erpnext@zafar-virtual-machine:/opt/bench/erpnext$ sudo bench update
Traceback (most recent call last):
File “/usr/lib/python3.8/runpy.py”, line 185, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File “/usr/lib/python3.8/runpy.py”, line 111, in _get_module_details
import(pkg_name)
File “/opt/bench/erpnext/apps/frappe/frappe/init.py”, line 25, in
from past.builtins import cmp
ModuleNotFoundError: No module named ‘past’

Bench command cache doesn’t exist in this folder!
remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
From GitHub - frappe/frappe: Low code web framework for real world applications, in Python and Javascript

  • branch version-13 → FETCH_HEAD
    WARN: shallow_clone is set in your bench config.
    However without passing the --reset flag, your repositories will be unshallowed.
    To avoid this, cancel this operation and run bench update --reset.

Consider the consequences of git reset --hard on your apps before you run that.
To avoid seeing this warning, set shallow_clone to false in your common_site_config.json

Will continue execution in 8 seconds…
Backing up sites…
Traceback (most recent call last):
File “/usr/lib/python3.8/runpy.py”, line 185, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File “/usr/lib/python3.8/runpy.py”, line 111, in _get_module_details
import(pkg_name)
File “/opt/bench/erpnext/apps/frappe/frappe/init.py”, line 25, in
from past.builtins import cmp
ModuleNotFoundError: No module named ‘past’
erpnext@zafar-virtual-machine:/opt/bench/erpnext$
erpnext@zafar-virtual-machine:/opt/bench/erpnext$ bench build
Traceback (most recent call last):
File “/usr/lib/python3.8/runpy.py”, line 185, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File “/usr/lib/python3.8/runpy.py”, line 111, in _get_module_details
import(pkg_name)
File “/opt/bench/erpnext/apps/frappe/frappe/init.py”, line 25, in
from past.builtins import cmp
ModuleNotFoundError: No module named ‘past’

Usage: bench [OPTIONS] COMMAND [ARGS]…
Try “bench --help” for help.

Error: No such command “build”.
erpnext@zafar-virtual-machine:/opt/bench/erpnext$ ls
Procfile apps config env logs patches.txt sites
erpnext@zafar-virtual-machine:/opt/bench/erpnext$ cd /apps
-bash: cd: /apps: No such file or directory
erpnext@zafar-virtual-machine:/opt/bench/erpnext$ sudo /apps
sudo: /apps: command not found
erpnext@zafar-virtual-machine:/opt/bench/erpnext$ cd apps
erpnext@zafar-virtual-machine:/opt/bench/erpnext/apps$ ls
erpnext frappe posawesome
erpnext@zafar-virtual-machine:/opt/bench/erpnext/apps$ cd frappe
erpnext@zafar-virtual-machine:/opt/bench/erpnext/apps/frappe$ ls
CODEOWNERS Makefile pycache cypress frappe.egg-info node_modules requirements.txt sider.yml
CODE_OF_CONDUCT.md README.md attributions.md cypress.json generate_bootstrap_theme.js node_utils.js rollup socketio.js
LICENSE SECURITY.md bandit.yml frappe hooks.md package.json setup.py yarn.lock
erpnext@zafar-virtual-machine:/opt/bench/erpnext/apps/frappe$ bench build
Traceback (most recent call last):
File “/usr/lib/python3.8/runpy.py”, line 185, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File “/usr/lib/python3.8/runpy.py”, line 111, in _get_module_details
import(pkg_name)
File “/opt/bench/erpnext/apps/frappe/frappe/init.py”, line 25, in
from past.builtins import cmp
ModuleNotFoundError: No module named ‘past’

Usage: bench [OPTIONS] COMMAND [ARGS]…
Try “bench --help” for help.

Error: No such command “build”.
erpnext@zafar-virtual-machine:/opt/bench/erpnext/apps/frappe$ bench --build
Traceback (most recent call last):
File “/usr/lib/python3.8/runpy.py”, line 185, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File “/usr/lib/python3.8/runpy.py”, line 111, in _get_module_details
import(pkg_name)
File “/opt/bench/erpnext/apps/frappe/frappe/init.py”, line 25, in
from past.builtins import cmp
ModuleNotFoundError: No module named ‘past’

Usage: bench [OPTIONS] COMMAND [ARGS]…
Try “bench --help” for help.

Error: no such option: --build
erpnext@zafar-virtual-machine:/opt/bench/erpnext/apps/frappe$ cd frappe
erpnext@zafar-virtual-machine:/opt/bench/erpnext/apps/frappe/frappe$ ls
init.py boot.py config data_migration event_streaming installer.py modules.txt permissions.py realtime.py templates utils
pycache build.py contacts database exceptions.py integrations monitor.py printing recorder.py test_runner.py website
api.py cache_manager.py core defaults.py frappeclient.py middlewares.py oauth.py public search tests workflow
app.py change_log coverage.py deferred_insert.py geo migrate.py parallel_test_runner.py pythonrc.py sessions.py translate.py www
auth.py client.py custom desk handler.py model patches query_builder share.py translations
automation commands data email hooks.py modules patches.txt rate_limiter.py social twofactor.py
erpnext@zafar-virtual-machine:/opt/bench/erpnext/apps/frappe/frappe$ bench --build
Traceback (most recent call last):
File “/usr/lib/python3.8/runpy.py”, line 185, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File “/usr/lib/python3.8/runpy.py”, line 111, in _get_module_details
import(pkg_name)
File “/opt/bench/erpnext/apps/frappe/frappe/init.py”, line 25, in
from past.builtins import cmp
ModuleNotFoundError: No module named ‘past’

Usage: bench [OPTIONS] COMMAND [ARGS]…
Try “bench --help” for help.

Error: no such option: --build
erpnext@zafar-virtual-machine:/opt/bench/erpnext/apps/frappe/frappe$ bench build
Traceback (most recent call last):
File “/usr/lib/python3.8/runpy.py”, line 185, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File “/usr/lib/python3.8/runpy.py”, line 111, in _get_module_details
import(pkg_name)
File “/opt/bench/erpnext/apps/frappe/frappe/init.py”, line 25, in
from past.builtins import cmp
ModuleNotFoundError: No module named ‘past’

Usage: bench [OPTIONS] COMMAND [ARGS]…
Try “bench --help” for help.

Error: No such command “build”.
erpnext@zafar-virtual-machine:/opt/bench/erpnext/apps/frappe/frappe$ cd
erpnext@zafar-virtual-machine:~$ cd /opt/bench/erpnext
erpnext@zafar-virtual-machine:/opt/bench/erpnext$ bench switch-to-branch version-13 frappe erpnext --upgrade
Traceback (most recent call last):
File “/usr/lib/python3.8/runpy.py”, line 185, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File “/usr/lib/python3.8/runpy.py”, line 111, in _get_module_details
import(pkg_name)
File “/opt/bench/erpnext/apps/frappe/frappe/init.py”, line 25, in
from past.builtins import cmp
ModuleNotFoundError: No module named ‘past’

INFO: Fetching upstream unshallow for frappe
$ git remote set-branches upstream ‘*’
$ git fetch --all --unshallow --quiet
remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
From GitHub - frappe/frappe: Low code web framework for real world applications, in Python and Javascript

  • branch version-13 → FETCH_HEAD
    Switching for frappe
    $ git checkout -f version-13
    Already on ‘version-13’
    Your branch is up to date with ‘upstream/version-13’.
    INFO: Fetching upstream unshallow for erpnext
    $ git remote set-branches upstream ‘*’
    $ git fetch --all --unshallow --quiet
    remote: Enumerating objects: 34, done.
    remote: Counting objects: 100% (29/29), done.
    remote: Compressing objects: 100% (2/2), done.
    remote: Total 4 (delta 3), reused 3 (delta 2), pack-reused 0
    Unpacking objects: 100% (4/4), 345 bytes | 69.00 KiB/s, done.
    From GitHub - frappe/erpnext: Free and Open Source Enterprise Resource Planning (ERP)
  • branch version-13 → FETCH_HEAD
  • c2911998a1…04a25b0e19 version-13 → upstream/version-13 (forced update)
    Switching for erpnext
    $ git checkout -f version-13
    Already on ‘version-13’
    Your branch and ‘upstream/version-13’ have diverged,
    and have 1 and 1 different commits each, respectively.
    (use “git pull” to merge the remote branch into yours)
    SUCCESS: Successfully switched branches for: frappe, erpnext
    Please run bench update --patch to be safe from any differences in database schema
    erpnext@zafar-virtual-machine:/opt/bench/erpnext$ bench update --patch
    Traceback (most recent call last):
    File “/usr/lib/python3.8/runpy.py”, line 185, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
    File “/usr/lib/python3.8/runpy.py”, line 111, in _get_module_details
    import(pkg_name)
    File “/opt/bench/erpnext/apps/frappe/frappe/init.py”, line 25, in
    from past.builtins import cmp
    ModuleNotFoundError: No module named ‘past’

Bench command cache doesn’t exist in this folder!
remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
From GitHub - frappe/frappe: Low code web framework for real world applications, in Python and Javascript

  • branch version-13 → FETCH_HEAD
    WARN: shallow_clone is set in your bench config.
    However without passing the --reset flag, your repositories will be unshallowed.
    To avoid this, cancel this operation and run bench update --reset.

Consider the consequences of git reset --hard on your apps before you run that.
To avoid seeing this warning, set shallow_clone to false in your common_site_config.json

Backing up sites…
Traceback (most recent call last):
File “/usr/lib/python3.8/runpy.py”, line 185, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File “/usr/lib/python3.8/runpy.py”, line 111, in _get_module_details
import(pkg_name)
File “/opt/bench/erpnext/apps/frappe/frappe/init.py”, line 25, in
from past.builtins import cmp
ModuleNotFoundError: No module named ‘past’
erpnext@zafar-virtual-machine:/opt/bench/erpnext$ bench --site site-name migrate
Traceback (most recent call last):
File “/usr/lib/python3.8/runpy.py”, line 185, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File “/usr/lib/python3.8/runpy.py”, line 111, in _get_module_details
import(pkg_name)
File “/opt/bench/erpnext/apps/frappe/frappe/init.py”, line 25, in
from past.builtins import cmp
ModuleNotFoundError: No module named ‘past’
erpnext@zafar-virtual-machine:/opt/bench/erpnext$ bench --site erpnext.shahzadtex.com migrate
Traceback (most recent call last):
File “/usr/lib/python3.8/runpy.py”, line 185, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File “/usr/lib/python3.8/runpy.py”, line 111, in _get_module_details
import(pkg_name)
File “/opt/bench/erpnext/apps/frappe/frappe/init.py”, line 25, in
from past.builtins import cmp
ModuleNotFoundError: No module named ‘past’
erpnext@zafar-virtual-machine:/opt/bench/erpnext$ cd
erpnext@zafar-virtual-machine:~$ cd /opt/bench
erpnext@zafar-virtual-machine:/opt/bench$ bench --site erpnext.shahzadtex.com migrate
WARN: Command not being executed in bench directory
Usage: bench [OPTIONS] COMMAND [ARGS]…
Try “bench --help” for help.

Error: no such option: --site
erpnext@zafar-virtual-machine:/opt/bench$ ls
erpnext
erpnext@zafar-virtual-machine:/opt/bench$ cd erpnext
erpnext@zafar-virtual-machine:/opt/bench/erpnext$ bench --site erpnext.shahzadtex.com migrate
Traceback (most recent call last):
File “/usr/lib/python3.8/runpy.py”, line 185, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File “/usr/lib/python3.8/runpy.py”, line 111, in _get_module_details
import(pkg_name)
File “/opt/bench/erpnext/apps/frappe/frappe/init.py”, line 25, in
from past.builtins import cmp
ModuleNotFoundError: No module named ‘past’
erpnext@zafar-virtual-machine:/opt/bench/erpnext$ sudo supervisorctl restart all
erpnext-web:erpnext-node-socketio: stopped
erpnext-workers:erpnext-frappe-schedule: stopped
erpnext-workers:erpnext-frappe-long-worker-0: stopped
erpnext-web:erpnext-frappe-web: stopped
erpnext-workers:erpnext-frappe-default-worker-0: stopped
erpnext-redis:erpnext-redis-cache: stopped
erpnext-redis:erpnext-redis-queue: stopped
erpnext-redis:erpnext-redis-socketio: stopped
erpnext-workers:erpnext-frappe-short-worker-0: stopped
erpnext-redis:erpnext-redis-cache: started
erpnext-redis:erpnext-redis-queue: started
erpnext-redis:erpnext-redis-socketio: started
erpnext-web:erpnext-frappe-web: started
erpnext-web:erpnext-node-socketio: started
erpnext-workers:erpnext-frappe-schedule: started
erpnext-workers:erpnext-frappe-default-worker-0: started
erpnext-workers:erpnext-frappe-short-worker-0: started
erpnext-workers:erpnext-frappe-long-worker-0: started
erpnext@zafar-virtual-machine:/opt/bench/erpnext$ sudo service nginx restart
erpnext@zafar-virtual-machine:/opt/bench/erpnext$ bench --site erpnext.shahzadtex.com migrate
Traceback (most recent call last):
File “/usr/lib/python3.8/runpy.py”, line 185, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File “/usr/lib/python3.8/runpy.py”, line 111, in _get_module_details
import(pkg_name)
File “/opt/bench/erpnext/apps/frappe/frappe/init.py”, line 25, in
from past.builtins import cmp
ModuleNotFoundError: No module named ‘past’
erpnext@zafar-virtual-machine:/opt/bench/erpnext$ bench --site erpnext.shahzadtex.com set-maintenance-mode off
Traceback (most recent call last):
File “/usr/lib/python3.8/runpy.py”, line 185, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File “/usr/lib/python3.8/runpy.py”, line 111, in _get_module_details
import(pkg_name)
File “/opt/bench/erpnext/apps/frappe/frappe/init.py”, line 25, in
from past.builtins import cmp
ModuleNotFoundError: No module named ‘past’
erpnext@zafar-virtual-machine:/opt/bench/erpnext$ ls
Procfile apps config env logs patches.txt sites
erpnext@zafar-virtual-machine:/opt/bench/erpnext$ cd sites
erpnext@zafar-virtual-machine:/opt/bench/erpnext/sites$ ls
apps.txt assets common_site_config.json currentsite.txt erpnext.shahzadtex.com
erpnext@zafar-virtual-machine:/opt/bench/erpnext/sites$ bench --site erpnext.shahzadtex.com set-maintenance-mode off
Traceback (most recent call last):
File “/usr/lib/python3.8/runpy.py”, line 185, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File “/usr/lib/python3.8/runpy.py”, line 111, in _get_module_details
import(pkg_name)
File “/opt/bench/erpnext/apps/frappe/frappe/init.py”, line 25, in
from past.builtins import cmp
ModuleNotFoundError: No module named ‘past’
erpnext@zafar-virtual-machine:/opt/bench/erpnext/sites$ cd
erpnext@zafar-virtual-machine:~$ cd /opt/bench/erpnext
erpnext@zafar-virtual-machine:/opt/bench/erpnext$ bench --site erpnext.shahzadtex.com scheduler resume
Traceback (most recent call last):
File “/usr/lib/python3.8/runpy.py”, line 185, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File “/usr/lib/python3.8/runpy.py”, line 111, in _get_module_details
import(pkg_name)
File “/opt/bench/erpnext/apps/frappe/frappe/init.py”, line 25, in
from past.builtins import cmp
ModuleNotFoundError: No module named ‘past’
erpnext@zafar-virtual-machine:/opt/bench/erpnext$

@zee.malik2008 install future . try this command in the bench folder.

 ./env/bin/pip install future

thank you for help , what next because i am new in erpnext ,

erpnext@zafar-virtual-machine : /opt/bench/erpnext $ ./env/bin/pip install future

Collecting future

Downloading future-0.18.2.tar.gz (829 kB)

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 829.2/829.2 KB 388.7 kB/s eta 0:00:00

Preparing metadata (setup.py) … done

Building wheels for collected packages: future

Building wheel for future (setup.py) … done

Created wheel for future: filename=future-0.18.2-py3-none-any.whl size=491070 sha256=530c1b4db6c086e90829e3b9dd9e31c3355c268622e15b5ecad4f2caf65ea1c1

Stored in directory: /home/erpnext/.cache/pip/wheels/8e/70/28/3d6ccd6e315f65f245da085482a2e1c7d14b90b30f239e2cf4

Successfully built future

Installing collected packages: future

Successfully installed future-0.18.2

erpnext@zafar-virtual-machine : /opt/bench/erpnext $

Site stilll not working

@zee.malik2008 try migrating again

erpnext@zafar-virtual-machine:/opt/bench/erpnext$ bench --site erpnext.shahzadtex.com migrate
Traceback (most recent call last):
File “/usr/lib/python3.8/runpy.py”, line 185, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File “/usr/lib/python3.8/runpy.py”, line 111, in _get_module_details
import(pkg_name)
File “/opt/bench/erpnext/apps/frappe/frappe/init.py”, line 36, in
faker = lazy_import(‘faker’)
File “/opt/bench/erpnext/apps/frappe/frappe/utils/lazy_loader.py”, line 27, in lazy_import
raise ImportError(f’Module {name} Not found.')
ImportError: Module faker Not found.

erpnext@zafar-virtual-machine:/opt/bench/erpnext$ ./env/bin/pip install future
Collecting future
Downloading future-0.18.2.tar.gz (829 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 829.2/829.2 KB 388.7 kB/s eta 0:00:00
Preparing metadata (setup.py) … done
Building wheels for collected packages: future
Building wheel for future (setup.py) … done
Created wheel for future: filename=future-0.18.2-py3-none-any.whl size=491070 sha256=530c1b4db6c086e90829e3b9dd9e31c3355c268622e15b5ecad4f2caf65ea1c1
Stored in directory: /home/erpnext/.cache/pip/wheels/8e/70/28/3d6ccd6e315f65f245da085482a2e1c7d14b90b30f239e2cf4
Successfully built future
Installing collected packages: future
Successfully installed future-0.18.2
erpnext@zafar-virtual-machine:/opt/bench/erpnext$ sudo supervisorctl restart all
[sudo] password for erpnext:
erpnext-web:erpnext-node-socketio: stopped
erpnext-workers:erpnext-frappe-default-worker-0: stopped
erpnext-workers:erpnext-frappe-short-worker-0: stopped
erpnext-web:erpnext-frappe-web: stopped
erpnext-redis:erpnext-redis-cache: stopped
erpnext-redis:erpnext-redis-queue: stopped
erpnext-redis:erpnext-redis-socketio: stopped
erpnext-workers:erpnext-frappe-long-worker-0: stopped
erpnext-workers:erpnext-frappe-schedule: stopped
erpnext-redis:erpnext-redis-cache: started
erpnext-redis:erpnext-redis-queue: started
erpnext-redis:erpnext-redis-socketio: started
erpnext-web:erpnext-frappe-web: started
erpnext-web:erpnext-node-socketio: started
erpnext-workers:erpnext-frappe-schedule: started
erpnext-workers:erpnext-frappe-default-worker-0: started
erpnext-workers:erpnext-frappe-short-worker-0: started
erpnext-workers:erpnext-frappe-long-worker-0: started
erpnext@zafar-virtual-machine:/opt/bench/erpnext$ sudo service nginx restart
erpnext@zafar-virtual-machine:/opt/bench/erpnext$ bench --site erpnext.shahzadtex.com migrate
Traceback (most recent call last):
File “/usr/lib/python3.8/runpy.py”, line 185, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File “/usr/lib/python3.8/runpy.py”, line 111, in _get_module_details
import(pkg_name)
File “/opt/bench/erpnext/apps/frappe/frappe/init.py”, line 36, in
faker = lazy_import(‘faker’)
File “/opt/bench/erpnext/apps/frappe/frappe/utils/lazy_loader.py”, line 27, in lazy_import
raise ImportError(f’Module {name} Not found.‘)
ImportError: Module faker Not found.
erpnext@zafar-virtual-machine:/opt/bench/erpnext$ bench switch-to-branch version-13 frappe erpnext --upgrade
Traceback (most recent call last):
File “/usr/lib/python3.8/runpy.py”, line 185, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File “/usr/lib/python3.8/runpy.py”, line 111, in _get_module_details
import(pkg_name)
File “/opt/bench/erpnext/apps/frappe/frappe/init.py”, line 36, in
faker = lazy_import(‘faker’)
File “/opt/bench/erpnext/apps/frappe/frappe/utils/lazy_loader.py”, line 27, in lazy_import
raise ImportError(f’Module {name} Not found.’)
ImportError: Module faker Not found.

INFO: Fetching upstream unshallow for frappe
$ git remote set-branches upstream ‘*’
$ git fetch --all --unshallow --quiet
remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
From GitHub - frappe/frappe: Low code web framework for real world applications, in Python and Javascript

  • branch version-13 → FETCH_HEAD
    Switching for frappe
    $ git checkout -f version-13
    Already on ‘version-13’
    Your branch is up to date with ‘upstream/version-13’.
    INFO: Fetching upstream unshallow for erpnext
    $ git remote set-branches upstream ‘*’
    $ git fetch --all --unshallow --quiet
    remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
    From GitHub - frappe/erpnext: Free and Open Source Enterprise Resource Planning (ERP)
  • branch version-13 → FETCH_HEAD
    Switching for erpnext
    $ git checkout -f version-13
    Already on ‘version-13’
    Your branch and ‘upstream/version-13’ have diverged,
    and have 1 and 1 different commits each, respectively.
    (use “git pull” to merge the remote branch into yours)
    SUCCESS: Successfully switched branches for: frappe, erpnext
    Please run bench update --patch to be safe from any differences in database schema
    erpnext@zafar-virtual-machine:/opt/bench/erpnext$ sudo service nginx restart
    [sudo] password for erpnext:
    erpnext@zafar-virtual-machine:/opt/bench/erpnext$ sudo supervisorctl reload
    Restarted supervisord
    erpnext@zafar-virtual-machine:/opt/bench/erpnext$ bench update --patch
    Traceback (most recent call last):
    File “/usr/lib/python3.8/runpy.py”, line 185, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
    File “/usr/lib/python3.8/runpy.py”, line 111, in _get_module_details
    import(pkg_name)
    File “/opt/bench/erpnext/apps/frappe/frappe/init.py”, line 36, in
    faker = lazy_import(‘faker’)
    File “/opt/bench/erpnext/apps/frappe/frappe/utils/lazy_loader.py”, line 27, in lazy_import
    raise ImportError(f’Module {name} Not found.')
    ImportError: Module faker Not found.

Bench command cache doesn’t exist in this folder!
remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
From GitHub - frappe/frappe: Low code web framework for real world applications, in Python and Javascript

  • branch version-13 → FETCH_HEAD
    WARN: shallow_clone is set in your bench config.
    However without passing the --reset flag, your repositories will be unshallowed.
    To avoid this, cancel this operation and run bench update --reset.

Consider the consequences of git reset --hard on your apps before you run that.
To avoid seeing this warning, set shallow_clone to false in your common_site_config.json

Backing up sites…
Traceback (most recent call last):
File “/usr/lib/python3.8/runpy.py”, line 185, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File “/usr/lib/python3.8/runpy.py”, line 111, in _get_module_details
import(pkg_name)
File “/opt/bench/erpnext/apps/frappe/frappe/init.py”, line 36, in
faker = lazy_import(‘faker’)
File “/opt/bench/erpnext/apps/frappe/frappe/utils/lazy_loader.py”, line 27, in lazy_import
raise ImportError(f’Module {name} Not found.‘)
ImportError: Module faker Not found.
erpnext@zafar-virtual-machine:/opt/bench/erpnext$ sudo systemctl start supervisor
erpnext@zafar-virtual-machine:/opt/bench/erpnext$ sudo systemctl enable supervisor
Synchronizing state of supervisor.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable supervisor
erpnext@zafar-virtual-machine:/opt/bench/erpnext$ sudo bench setup production erpnext
Traceback (most recent call last):
File “/usr/lib/python3.8/runpy.py”, line 185, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File “/usr/lib/python3.8/runpy.py”, line 111, in _get_module_details
import(pkg_name)
File “/opt/bench/erpnext/apps/frappe/frappe/init.py”, line 36, in
faker = lazy_import(‘faker’)
File “/opt/bench/erpnext/apps/frappe/frappe/utils/lazy_loader.py”, line 27, in lazy_import
raise ImportError(f’Module {name} Not found.’)
ImportError: Module faker Not found.

Setting Up prerequisites…
Setting Up supervisor…
supervisor.conf already exists and this will overwrite it. Do you want to continue? [y/N]: y
Setting Up NGINX…
nginx.conf already exists and this will overwrite it. Do you want to continue? [y/N]: y
Port configuration list:

Site erpnext.shahzadtex.com assigned port: 80
Setting Up symlinks and reloading services…
$ /usr/bin/supervisorctl reread
No config updates to processes
$ /usr/bin/supervisorctl update
$ sudo /usr/sbin/nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
$ sudo systemctl reload nginx
erpnext@zafar-virtual-machine:/opt/bench/erpnext$ sudo service nginx restart
erpnext@zafar-virtual-machine:/opt/bench/erpnext$ bench update
Traceback (most recent call last):
File “/usr/lib/python3.8/runpy.py”, line 185, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File “/usr/lib/python3.8/runpy.py”, line 111, in _get_module_details
import(pkg_name)
File “/opt/bench/erpnext/apps/frappe/frappe/init.py”, line 36, in
faker = lazy_import(‘faker’)
File “/opt/bench/erpnext/apps/frappe/frappe/utils/lazy_loader.py”, line 27, in lazy_import
raise ImportError(f’Module {name} Not found.')
ImportError: Module faker Not found.

Bench command cache doesn’t exist in this folder!
remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
From GitHub - frappe/frappe: Low code web framework for real world applications, in Python and Javascript

  • branch version-13 → FETCH_HEAD
    WARN: shallow_clone is set in your bench config.
    However without passing the --reset flag, your repositories will be unshallowed.
    To avoid this, cancel this operation and run bench update --reset.

Consider the consequences of git reset --hard on your apps before you run that.
To avoid seeing this warning, set shallow_clone to false in your common_site_config.json

Backing up sites…
Traceback (most recent call last):
File “/usr/lib/python3.8/runpy.py”, line 185, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File “/usr/lib/python3.8/runpy.py”, line 111, in _get_module_details
import(pkg_name)
File “/opt/bench/erpnext/apps/frappe/frappe/init.py”, line 36, in
faker = lazy_import(‘faker’)
File “/opt/bench/erpnext/apps/frappe/frappe/utils/lazy_loader.py”, line 27, in lazy_import
raise ImportError(f’Module {name} Not found.‘)
ImportError: Module faker Not found.
erpnext@zafar-virtual-machine:/opt/bench/erpnext$ bench build
Traceback (most recent call last):
File “/usr/lib/python3.8/runpy.py”, line 185, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File “/usr/lib/python3.8/runpy.py”, line 111, in _get_module_details
import(pkg_name)
File “/opt/bench/erpnext/apps/frappe/frappe/init.py”, line 36, in
faker = lazy_import(‘faker’)
File “/opt/bench/erpnext/apps/frappe/frappe/utils/lazy_loader.py”, line 27, in lazy_import
raise ImportError(f’Module {name} Not found.’)
ImportError: Module faker Not found.

Usage: bench [OPTIONS] COMMAND [ARGS]…
Try “bench --help” for help.

Error: No such command “build”.
erpnext@zafar-virtual-machine:/opt/bench/erpnext$ bench update --reset
Traceback (most recent call last):
File “/usr/lib/python3.8/runpy.py”, line 185, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File “/usr/lib/python3.8/runpy.py”, line 111, in _get_module_details
import(pkg_name)
File “/opt/bench/erpnext/apps/frappe/frappe/init.py”, line 36, in
faker = lazy_import(‘faker’)
File “/opt/bench/erpnext/apps/frappe/frappe/utils/lazy_loader.py”, line 27, in lazy_import
raise ImportError(f’Module {name} Not found.')
ImportError: Module faker Not found.

Bench command cache doesn’t exist in this folder!
remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
From GitHub - frappe/frappe: Low code web framework for real world applications, in Python and Javascript

  • branch version-13 → FETCH_HEAD
    Backing up sites…
    Traceback (most recent call last):
    File “/usr/lib/python3.8/runpy.py”, line 185, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
    File “/usr/lib/python3.8/runpy.py”, line 111, in _get_module_details
    import(pkg_name)
    File “/opt/bench/erpnext/apps/frappe/frappe/init.py”, line 36, in
    faker = lazy_import(‘faker’)
    File “/opt/bench/erpnext/apps/frappe/frappe/utils/lazy_loader.py”, line 27, in lazy_import
    raise ImportError(f’Module {name} Not found.')
    ImportError: Module faker Not found.

Hi @zee.malik2008,

Check some step if not perform, if perform then do not apply.

Upgrade the system

  • sudo apt update
  • sudo apt upgrade

  • sudo service nginx restart
  • sudo supervisorctl reload
  • bench setup requirements
  • bench update --patch
  • bench migrate
  • bench update --build

More process flow check for:

Thank You!

2 Likes

I am already follow these commands

So try this.
hope this help you.

First uninstall fake-factory (I use pip) pip uninstall fake-factory
Then check if it is uninstalled using pip freeze and it should not be there
Then, proceed with installing Faker by pip install Faker

Thanks.

50%20PM

Updated but still facing issue

run this command:
bench set-maintenance-mode off

thanks.

I have run this command and restart server. but still Status: 50350%20PM

Why this command does not work.
It should work.

Please check this topic:

And

Thanks.

Command runing with no error but Status :503 not removed
erpnext@zafar-virtual-machine : ~ $ cd /opt/bench/erpnext

erpnext@zafar-virtual-machine : /opt/bench/erpnext $ pip install Faker

Collecting Faker

Downloading Faker-13.3.3-py3-none-any.whl (1.5 MB)

|████████████████████████████████| 1.5 MB 262 kB/s

Requirement already satisfied: python-dateutil>=2.4 in /usr/lib/python3/dist-packages (from Faker) (2.7.3)

Installing collected packages: Faker

Successfully installed Faker-13.3.3

erpnext@zafar-virtual-machine : /opt/bench/erpnext $ sudo bench setup production erpnext

Setting Up prerequisites…

Setting Up supervisor…

supervisor.conf already exists and this will overwrite it. Do you want to continue? [y/N]: y

Setting Up NGINX…

nginx.conf already exists and this will overwrite it. Do you want to continue? [y/N]: y

Port configuration list:

Site erpnext.shahzadtex.com assigned port: 80

Setting Up symlinks and reloading services…

$ /usr/bin/supervisorctl reread

No config updates to processes

$ /usr/bin/supervisorctl update

$ sudo /usr/sbin/nginx -t

nginx: the configuration file /etc/nginx/nginx.conf syntax is ok

nginx: configuration file /etc/nginx/nginx.conf test is successful

$ sudo systemctl reload nginx

erpnext@zafar-virtual-machine : /opt/bench/erpnext $ sudo supervisorctl reload

Restarted supervisord

erpnext@zafar-virtual-machine : /opt/bench/erpnext $ sudo service nginx restart

erpnext@zafar-virtual-machine : /opt/bench/erpnext $ bench set-maintenance-mode off

erpnext@zafar-virtual-machine : /opt/bench/erpnext $ bench set-maintenance-mode off

erpnext@zafar-virtual-machine : /opt/bench/erpnext $ sudo service supervisor restart

[sudo] password for erpnext:

erpnext@zafar-virtual-machine : /opt/bench/erpnext $

Please try another way like:

Disable maintenance mode by: bench set-config maintenance_mode 0

Thanks.

Thank you so much for help, but still not fixed.
erpnext@zafar-virtual-machine : ~ $ cd /opt/bench/erpnext

erpnext@zafar-virtual-machine : /opt/bench/erpnext $ bench set-config maintenance_mode 0

erpnext@zafar-virtual-machine : /opt/bench/erpnext $ sudo supervisorctl reload

[sudo] password for erpnext:

Restarted supervisord

erpnext@zafar-virtual-machine : /opt/bench/erpnext $ sudo service nginx restart

erpnext@zafar-virtual-machine : /opt/bench/erpnext $

should i need to reset ?

still not working please help to fix this i run bench migrate angain.

erpnext@zafar-virtual-machine:/opt/bench/erpnext$ bench migrate
Migrating erpnext.shahzadtex.com
Updating DocTypes for frappe : [============================= ] 72%

There was an issue while migrating the DocType: Form Tour

Traceback (most recent call last):
File “/opt/bench/erpnext/apps/frappe/frappe/database/mariadb/schema.py”, line 91, in alter
frappe.db.sql(query)
File “/opt/bench/erpnext/apps/frappe/frappe/database/database.py”, line 152, in sql
self._cursor.execute(query)
File “/opt/bench/erpnext/env/lib/python3.8/site-packages/pymysql/cursors.py”, line 148, in execute
result = self._query(query)
File “/opt/bench/erpnext/env/lib/python3.8/site-packages/pymysql/cursors.py”, line 310, in _query
conn.query(q)
File “/opt/bench/erpnext/env/lib/python3.8/site-packages/pymysql/connections.py”, line 548, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File “/opt/bench/erpnext/env/lib/python3.8/site-packages/pymysql/connections.py”, line 775, in _read_query_result
result.read()
File “/opt/bench/erpnext/env/lib/python3.8/site-packages/pymysql/connections.py”, line 1156, in read
first_packet = self.connection._read_packet()
File “/opt/bench/erpnext/env/lib/python3.8/site-packages/pymysql/connections.py”, line 725, in _read_packet
packet.raise_for_error()
File “/opt/bench/erpnext/env/lib/python3.8/site-packages/pymysql/protocol.py”, line 221, in raise_for_error
err.raise_mysql_exception(self._data)
File “/opt/bench/erpnext/env/lib/python3.8/site-packages/pymysql/err.py”, line 143, in raise_mysql_exception
raise errorclass(errno, errval)
pymysql.err.IntegrityError: (1062, “Duplicate entry ‘Item’ for key ‘reference_doctype’”)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/lib/python3.8/runpy.py”, line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File “/usr/lib/python3.8/runpy.py”, line 87, in _run_code
exec(code, run_globals)
File “/opt/bench/erpnext/apps/frappe/frappe/utils/bench_helper.py”, line 104, in
main()
File “/opt/bench/erpnext/apps/frappe/frappe/utils/bench_helper.py”, line 19, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/opt/bench/erpnext/env/lib/python3.8/site-packages/click/core.py”, line 829, in call
return self.main(*args, **kwargs)
File “/opt/bench/erpnext/env/lib/python3.8/site-packages/click/core.py”, line 782, in main
rv = self.invoke(ctx)
File “/opt/bench/erpnext/env/lib/python3.8/site-packages/click/core.py”, line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/opt/bench/erpnext/env/lib/python3.8/site-packages/click/core.py”, line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/opt/bench/erpnext/env/lib/python3.8/site-packages/click/core.py”, line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/opt/bench/erpnext/env/lib/python3.8/site-packages/click/core.py”, line 610, in invoke
return callback(*args, **kwargs)
File “/opt/bench/erpnext/env/lib/python3.8/site-packages/click/decorators.py”, line 21, in new_func
return f(get_current_context(), *args, **kwargs)
File “/opt/bench/erpnext/apps/frappe/frappe/commands/init.py”, line 27, in _func
ret = f(frappe.dict(ctx.obj), *args, **kwargs)
File “/opt/bench/erpnext/apps/frappe/frappe/commands/site.py”, line 309, in migrate
migrate(
File “/opt/bench/erpnext/apps/frappe/frappe/migrate.py”, line 72, in migrate
frappe.model.sync.sync_all(verbose=verbose)
File “/opt/bench/erpnext/apps/frappe/frappe/model/sync.py”, line 19, in sync_all
sync_for(app, force, verbose=verbose, reset_permissions=reset_permissions)
File “/opt/bench/erpnext/apps/frappe/frappe/model/sync.py”, line 70, in sync_for
import_file_by_path(doc_path, force=force, ignore_version=True, reset_permissions=reset_permissions)
File “/opt/bench/erpnext/apps/frappe/frappe/modules/import_file.py”, line 130, in import_file_by_path
import_doc(
File “/opt/bench/erpnext/apps/frappe/frappe/modules/import_file.py”, line 257, in import_doc
doc.insert()
File “/opt/bench/erpnext/apps/frappe/frappe/model/document.py”, line 270, in insert
self.run_post_save_methods()
File “/opt/bench/erpnext/apps/frappe/frappe/model/document.py”, line 1004, in run_post_save_methods
self.run_method(“on_update”)
File “/opt/bench/erpnext/apps/frappe/frappe/model/document.py”, line 869, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/opt/bench/erpnext/apps/frappe/frappe/model/document.py”, line 1161, in composer
return composed(self, method, *args, **kwargs)
File “/opt/bench/erpnext/apps/frappe/frappe/model/document.py”, line 1144, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/opt/bench/erpnext/apps/frappe/frappe/model/document.py”, line 866, in fn
return method_object(*args, **kwargs)
File “/opt/bench/erpnext/apps/frappe/frappe/core/doctype/doctype/doctype.py”, line 302, in on_update
raise e
File “/opt/bench/erpnext/apps/frappe/frappe/core/doctype/doctype/doctype.py”, line 299, in on_update
frappe.db.updatedb(self.name, Meta(self))
File “/opt/bench/erpnext/apps/frappe/frappe/database/mariadb/database.py”, line 309, in updatedb
db_table.sync()
File “/opt/bench/erpnext/apps/frappe/frappe/database/schema.py”, line 41, in sync
self.alter()
File “/opt/bench/erpnext/apps/frappe/frappe/database/mariadb/schema.py”, line 99, in alter
frappe.throw(
(“{0} field cannot be set as unique in {1}, as there are non-unique existing values”).format(
File “/opt/bench/erpnext/apps/frappe/frappe/init.py”, line 444, in throw
msgprint(msg, raise_exception=exc, title=title, indicator=‘red’, is_minimizable=is_minimizable, wide=wide, as_list=as_list)
File “/opt/bench/erpnext/apps/frappe/frappe/init.py”, line 423, in msgprint
_raise_exception()
File “/opt/bench/erpnext/apps/frappe/frappe/init.py”, line 378, in _raise_exception
raise raise_exception(msg)
frappe.exceptions.ValidationError: reference_doctype field cannot be set as unique in tabForm Tour, as there are non-unique existing values

Hi @zee.malik2008,

Please check you Form Tour doctype.
If show unique = 1 then remove it from reference_doctype field.

in ERP View:

Thank You!