Bench is getting deleted

Hi,
I am facing a strange issue. Everytime I update ERPNext, it gives error that bench commands like migrate do not exist. After that no bench commands work.
Can anybody guide what may be the issue here and how do I resolve it?

-Amit

Have you done any changes in frappe app?

Let’s be clear about your exact issue.

Is it complaining about
a) bench command, or
b) bench working but not recognising the command

Bench is working but it is not recognising commands.

Make sure you are in the correct directory. See below, I demonstrate how I get the error

Please also copy the error and other info. It will help to find your issue quicker.

$ pwd
/home/myhome/erpnext/frappe-bench/apps/erpnext
$ bench version
Usage: bench [OPTIONS] COMMAND [ARGS]...

Error: No such command "version".
cd ../../
$ pwd
/home/myhome/erpnext/frappe-bench
$ bench version
erpnext 12.1.6
frappe 12.x.x-develop

I am in frappe-bench directory. The issue starts half way through update.

Sorry I can’t help further.

Your input here is less than required to provide proper assistance. You first say that the command is not found, and now that errors are happening after bench starts. I have asked you to provide details of your logs which you have not done. Without futher information the least people can do is guess. If you want people to help you really have to do more.

thanks for the reply.
The chronology of the events is:

  1. Start bench update.
  2. It downloads all the required changes
  3. Bench update starts to migrate the changes.
  4. Here is where is starts complaining that the migrate command is not recognised.
  5. If I try to run bench update, it doesnot even recognise update command or any other bench command for that matter.

-Amit

Please post your your console logs. This contains important information that can assist you.