Patches.txt file is not allowing me to update erpnext

I am using:
ERPNext: v10.1.5 (master)
Frappe Framework: v10.1.2 (master)

When I try to do bench update, it complains that there is an untracked file called patches.txt
I deleted it
Then I tryied bench update again. This time it appears to go further, telling me it will repalce celery with python QR, and that procfile will be replaced. I accepted the changes and it again complains about the patches.txt file
I go and see, and the patches.txt file appeared again. If I delete it and try again, it appears again

This file appears in the frappe-bench folder, NOT in an app folder

a little help would be appreciated

I have tried using stash for changes, (Which I have not made) and does not work.
I have not tried rebase or bench update reset, but would this wipe out a custom filed I added to a form?


I had this same issue and managed to get around it.

Though I can’t remember what I did exactly to resolve it :wink:

That said doing a bench update reset shouldn’t reset or remove any custom fields. It will only reset the files to that on the branch and should not make any changes to the custom fields which are stored in the database as Custom fields. I have a few custom fields on a few forms and I have never lost them when doing a bench update reset.

If in any doubt do take a good backup first though …

1 Like

Can you post the exact trace you are getting?

Also, can you try executing this command: bench update --reset

frappe-bench folder is not a git repository so git commands won’t work. patches.txt is in each app folder which is used for migrations. You should not delete it.

Please share traceback or screenshots of your terminal session to get better help.

I tried bench update --reset being at the frappe-bench folder and got this:

INFO:bench.utils:updating bench
INFO:bench.utils:git pull
remote: Counting objects: 6, done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 6 (delta 4), reused 5 (delta 4), pack-reused 0
Unpacking objects: 100% (6/6), done.
From GitHub - frappe/bench: CLI to manage Multi-tenant deployments for Frappe apps
8cb621c…8de6f0d master → origin/master
Updating d43bae4…8de6f0d
error: The following untracked working tree files would be overwritten by merge:
Please move or remove them before you can merge.
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 11, in
load_entry_point(‘bench’, ‘console_scripts’, ‘bench’)()
File “/home/frappeans/.bench/bench/”, line 40, in cli
File “/usr/local/lib/python2.7/dist-packages/click/”, line 722, in call
return self.main(*args, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/click/”, line 697, in main
rv = self.invoke(ctx)
File “/usr/local/lib/python2.7/dist-packages/click/”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python2.7/dist-packages/click/”, line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python2.7/dist-packages/click/”, line 535, in invoke
return callback(*args, **kwargs)
File “/home/frappeans/.bench/bench/commands/”, line 34, in update
File “/home/frappeans/.bench/bench/”, line 275, in update_bench
exec_cmd(“git pull”, cwd=cwd)
File “/home/frappeans/.bench/bench/”, line 145, in exec_cmd
raise CommandFailedError(cmd)
bench.utils.CommandFailedError: git pull

i think you have to pull changes

from frappe-bench directory

cd …/.bench

git commit -a

git pull

then try to update again

1 Like

Thank you very much @Mahmoud_Ghoneem

I did what you said:

Went to my /home/my_username/.bench directory and from there:
git commit -a
git pull (Here, it complained about a patches.txt file again in the .bench folder. Then I deleted the patches.txt file and then it worked)
git pull
Then I went to frappe-bench directory and from there, I first tried bench update, but it said I had made modifications to erpnext, which I had not. Si I went and executed:
bench update --reset
and finally the updated process was successfull

Thank you all for your help!

1 Like