Bench nowhere to be found after attempted upgrade

I was trying to upgrade from version 13 to 14 was following the documentation but i utterly pooched my system up when i messed up the Python update. Then I panicked and tried everything I could to get my system to work.

Now I am getting the infamous:

Sorry!

We will be back soon.

Don’t panic. It’s not you, it’s us.
Most likely, our engineers are updating the code, and it should take a minute for the new code to load into memory.

Try refreshing after a minute or two.

i believe the problem is my bench. I can’t get it to work at all. Anytime I try to execute a bench command I get the following error message:

Traceback (most recent call last):
File “/home/elvisglazier/.local/bin/bench”, line 5, in
from bench.cli import cli
ModuleNotFoundError: No module named ‘bench’

Any help would be amazing.

Hi,

Please follow the below steps to upgrade V13 to V14. Though you already done some of them, you may run all the steps in sequence.

ERPNext upgrade from Version 13 to Version 14 - Ubuntu

  1. Take backup.
  2. Make sure you don’t have any custom development without committed on github
  3. Check the Python version - For version 14 Python 3.10 is required.
  4. Check the node version. (v16.x is required)
  5. Check pip or pip3 version (22.x is required)
  6. Upgrade python version

sudo apt install software-properties-common -y

sudo add-apt-repository ppa:deadsnakes/ppa

sudo apt install python3.10 python3.10-dev python3.10-distutils

Confirm python version upgrade by

python3.10 --version

Python 3.10.6

Make Python 3.10 the default.

sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1

Make sure python command executes python3

sudo apt install python-is-python3

python -V

Python 3.10.6

python3 -V

Python 3.10.6

  1. Upgrade PIP

curl -sS https://bootstrap.pypa.io/get-pip.py | python3.10

pip3 install --upgrade pip

sudo apt-get remove python3-apt -y

sudo apt-get install python3-apt -y

check the PIP version and confirm.

pip --version

pip 22.2.2 from /home/erpnext/.local/lib/python3.10/site-packages/pip (python 3.10)

pip3 --version

pip 22.2.2 from /home/erpnext/.local/lib/python3.10/site-packages/pip (python 3.10)

  1. Upgrade Node

curl -sL https://deb.nodesource.com/setup_16.x | bash -

apt-get install nodejs redis-server -y

check node version and confirm

node --version

v16.17.0

  1. Upgrade NPM

npm upgrade

sudo npm install 16

sudo npm install -g npm@8.19.1

check npm version and confirm

npm --version

8.19.1

  1. Move your old python env folder to env-archive,

cd /opt/bench/frappe-bench/

mv env env-archive

  1. Create new virtual env for python-3.10

pip install virtualenv

virtualenv --python python3.10 env

env/bin/pip install -U pip

  1. Change git upstream from V13 to V14

env/bin/pip install -e apps/frappe -e apps/erpnext

pip3 install frappe-bench

bench switch-to-branch frappe erpnext version-14 ( edited this line. Please see the note 2 ** )

( If the above command don’t work, use this one ) bench switch-to-branch version-14 frappe erpnext --upgrade

check upstream and make sure upstream repository is V14

cd /opt/bench/frappe-bench/apps/erpnext

git status

Your branch is up to date with ‘upstream/version-14’.

cd /opt/bench/frappe-bench/apps/frappe

git status

Your branch is up to date with ‘upstream/version-14’.

  1. Install and upgrade V14. Please note that monolith is broken on V14 and you must install payments and hrms module in addition to ERPNext

bench get-app payments

bench get-app hrms

bench update --reset

bench --site sitename install-app hrms

bench --site sitename install-app payments

bench --site your_site_name migrate

sudo service supervisor restart

sudo service nginx restart

That is it. Check whether you ERPNext and Frappe upgrade to V14

Thank,

Divyesh Mangroliya

Thank you for the swift response. I don’t want to sound dumb but when I am running these commands what folder should I be in.

I ask because when I type:

cd /opt/bench/frappe-bench/apps/frappe

It comes back as:

-bash: cd: /opt/bench/frappe-bench/apps/frappe: No such file or directory

I have run all of these commands in the folder that has the following folders and files:

ls
env myfrappe patches.txt wkhtmltox_0.12.5-1.trusty_amd64.deb

I feel as though I am starting off wrong.

Python 3.10.15
python-is-python3 is already the newest version (3.11.4-1)
pip 24.2 from /home/elvisglazier/.local/lib/python3.10/site-packages/pip (python 3.10)
Node version v20.17.0
npm version 10.8.2

I cant do anything after step 10 because the folder doesn’t exist

Hi,

Sorry for not mentioning that you need to adjust the path according to your installation.

Most common path is /home/your_username/frappe-bench

Thanks,

Divyesh Mangroliya

That got me a little further.

Now when I do:

bench update --reset

I get the following output

elvisglazier@iekoserver:~/myfrappe$ bench update --reset
remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0 (from 0)
From GitHub - frappe/frappe: Low code web framework for real world applications, in Python and Javascript

  • branch version-14 → FETCH_HEAD
    Backing up sites…
    b"mysqldump: Error 1194: Table ‘tabError Log’ is marked as crashed and should be repaired when dumping table tabError Log at row: 19167\n"
    Backup failed for Site ieko. Database or site_config.json may be corrupted

This is my site_config.json file

{
“auto_update”: true,
“background_workers”: 1,
“db_name”: “_232abceab1ccffdc”,
“db_password”: “E7oDAgrYjDSviHvP”,
“db_type”: “mariadb”,
“encryption_key”: “j0yVq53RgrUAINSnj62GfcrgNvsxuBSe9rPqu0zn4Y8=”,
“error_report_email”: “elvis@ieko.ca”,
“host_name”: “http://localhost”,
“maintenance_mode”: 0,
“pause_scheduler”: 0,
“nginx_port”: 8000
}

Now I am getting an:

Internal Server Error