Update from version 10 to 11 failing due to Pagemaster / custom app

we’ve tried to remove Pagemaster app, uninstall it and all possible but nothing helps and the update to version 11 fails. We do not necessarily need at all Pagemaster and in this case because this is a demo site, that we are using testing the update / upgrade, it is not a catastrophe if we loose some info.

How to get pass this situation?

The commands we have tried:
bench remove-from-installed-apps pagemaster
bench uninstall-app pagemaster
bench remove-app pagemaster
bench --site site1.local uninstall-app pagemaster

Tried both with the root user and frappe user. No difference.

Then have also tried to remove the app from the folder “apps”, moving it to the home folder:

mv pagemaster/ /home/

nano sites/apps.txt
=> edit and remove the “pagemaster” in the content
=> Save.

Install again and then remove:
bench --site site1.local install-app pagemaster
=> didn’t work either

INFO:bench.app:installing erpnext
INFO:bench.utils:./env/bin/pip install -q -e ./apps/erpnext
INFO:bench.app:installing pagemaster
INFO:bench.utils:./env/bin/pip install -q -e ./apps/pagemaster
Command “python setup.py egg_info” failed with error code 1 in /home/frappe/frappe-bench/apps/pagemaster/
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 11, in
load_entry_point(‘bench’, ‘console_scripts’, ‘bench’)()
File “/home/frappe/.bench/bench/cli.py”, line 40, in cli
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 722, in call
return self.main(*args, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 697, in main
rv = self.invoke(ctx)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 535, in invoke
return callback(*args, **kwargs)
File “/home/frappe/.bench/bench/commands/update.py”, line 60, in update
_update(pull, patch, build, bench, auto, restart_supervisor, restart_systemd, requirements, no_backup, force=force, reset=reset)
File “/home/frappe/.bench/bench/commands/update.py”, line 76, in _update
File “/home/frappe/.bench/bench/utils.py”, line 435, in update_requirements
install_app(app, bench_path=bench_path)
File “/home/frappe/.bench/bench/app.py”, line 171, in install_app
File “/home/frappe/.bench/bench/utils.py”, line 159, in exec_cmd
raise CommandFailedError(cmd)
bench.utils.CommandFailedError: ./env/bin/pip install -q -e ./apps/pagemaster

Have you tried doing a clean install and moving your data?

Now this is a bit tricky; I faced something similar while upgrading; I should update the linked post. The issue appears to be from fields in the database referencing the app. Take a backup of the database as follows

mysqldump -u root p -database_name > dbbackup.sql

get notepad++ and then open the sql file. Run a search for this app; you will find the tables containing it. If you do; update here and let’s talk about purging it; essentially you are removing all references to the app.

Thanks, no we have not. We’ve tried to test how to do the update indeed.

Also we did take the backup, and db backup was fine but the backup of files failed.

erpnext@server:~/frappe-bench/sites/site1.local/public$ tar cvf ~/site1.local-files.tar files
(used this command, unfortunately didn’t save the error out of this)

Maybe the failure of the backing up the files wouldn’t matter in this case. Later yes, but now we are practising with our demo installation.
Also wondering if we need to take another server following this advice on the linked post, or can we use the same server to have a parallel installation?

I think for simplicity; use winscp to take out your file backups and use mysqldump for the database. Winscp makes things easy. Winscp will also be used to copy the sql file

What type of server did you install on?

It’s in fresh Linode 16.04 LTS, nothing else there.

OK, …meanwhile here we got the mysqldump done, besides the log table notes that I think are not important, Pagemaster is notified at least in these tables:

tabDesktop Icon
tabNavbar Item
tabPageMaster Blog Post
tabPageMaster Page
tabPageMaster Page Item

I would say, since its a demo, destroy the linode and spin up another one. Like I said, this is a bit nasty, except someone has a better deal. What I did when I had this was run select statements against the tables and simply remove references to the troubling app. Remove it from doctypes and defaultvalue and try.

We have other installations that are not only demo, thus we would be testing first how things go with the demo. Otherwise we could just simply even delete the whole instance, but we do not want to practise with the more important installations.

Not very familiar with the db select statements but let’s see.

We made upgraded the other installation by first deleting the Pagemaster before starting doing anything else and that seemed to help. Now we could indeed just delete the demo installation.
What we do learn from this that we need to careful what type of custom apps are developed and installed since upgrading may come really challenging.