Bench Manager - [beta]

Hi,

I “almost” succesfully installed Bench Manager, but every time I clic on Bench Settings, something goes wrong…

However I’m able to create new sites and update, apparently with no error.

I’m not changing any value, this happens every time I clic to enter at Bench Settings.

@flexy2ky instead of using 127.0.0.1, try putting in the IP address of your AWS instance.

@Francisco_Buendia please post the error log

This has been fixed, update bench manager and try again!

@codingCoffee i tried the option you gave but it didnt work so i formatted my instance and reinstalled (thankfully i have a backup). I tried to install bench manager again. I also noticed that two additional steps have been introduced. I tried to run the first command from the bench-manager directory and this is what i got:

ubuntu@ip-172-31-37-46:/home/frappe/frappe-bench/sites/bench-manager.local$ sudo git pull --rebase origin develop
fatal: Not a git repository (or any of the parent directories): .git

i ran the other commands successfully and although my site is still running (thankfully), bench manager doesn’t seem to be installed.

@flexy2ky you need to execute the git command in the bench_manager directory, present in apps directory, and not the sites directory.
Also there is not need to use sudo for executing a git command!

I recommend you to go through the Frappé Tutorial to understand the difference between apps and sites

@codingCoffee i think when you find someone who’s willing to learn you should not be unnecessarily harsh. I’m a noob and i don’t know too much yet. My foray into Frappe is not only to improve my knowledge but its also to help the expanding ERPNext community.

My decision to install the bench manager is based on my assumption that if i can’t code, at least i can help test. So when you push such responses with what i gauge as a harsh tone it discourages me and i think maybe some other guys out there who think like me. I have a fully working erpnext instance for production and whatever i am doing right now is on a test/dummy instance which i can restore in minutes should i make any mistake.

So rather than query my wrong use of commands (which in some cases its necessary), you should direct me properly as you can’t tell if the knowledge you pass would make me better at it.

Nothing in your document said the installation should be run from the app directory so i followed my first instinct. I will follow your directions and try to run it as i feel your effort is commendable and so i should play my role, no matter who small in helping you perfect the app.

1 Like

@flexy2ky looks like we got off on the wrong foot, we developers too refer to the same tutorials to get acquainted with the stack, hence the recommendation. Please give it a try and if even after that your issue persists, I’d be more than happy to help.

@codingCoffee Yes i think we did get off on the wrong foot. I am indeed here to learn and help in any way i can.

I’ve run the command in the right directory now and this is the error i got:

ubuntu@ip-172-31-37-46:/home/frappe/frappe-bench/apps/bench_manager$ git pull --rebase origin develop
fatal: BUG: get_tempfile_fd() called for inactive object
ubuntu@ip-172-31-37-46:/home/frappe/frappe-bench/apps/bench_manager$

i also noticed that when i ran the install command at the beginning, i could not use “app-git” as ubuntu returned the command with the error "No such command “app-git” it only ran when i used “app-get” and the bench-manager.local installed successfully without errors. Could there be something different?

Try deleting the .git/index.lock file.

git-app was a typo, it is get-app indeed, fixed it!

@codingCoffee I deleted the file like you asked and ran the git pull --rebase origin develop command from the bench_manager directory and this is what i got:

ubuntu@ip-172-31-37-46:/home/frappe/frappe-bench/apps/bench_manager$ git pull --rebase origin develop
error: cannot open .git/FETCH_HEAD: Permission denied

I then used the sudo command (again it’s a test environment so i decided to try everything) and this is what i got:

ubuntu@ip-172-31-37-46:/home/frappe/frappe-bench/apps/bench_manager$ sudo git pull --rebase origin develop
fatal: ‘origin’ does not appear to be a git repository
fatal: Could not read from remote repository.

let me know if you need me to anything else.

@flexy2ky if it would not be too much trouble, could you delete the bench_manager app, and the site tied to it (bench-manager.local), and reinstall both, following the commands in the README?
You wont have to use git commands this time around. You will directly be able to use bench update to update the app

@codingCoffee Is it installable in the master or in the develop only

@codingCoffee I removed the bench_manager app and the site tied to it as requested. However when i tried to reinstall the app using the command in README, i got the following error:

ubuntu@ip-172-31-37-46:/home/frappe/frappe-bench$ bench new-site bench-manager.local
Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 64, in get_app_commands
app_command_module = importlib.import_module(app + ‘.commands’)
File “/usr/lib/python2.7/importlib/init.py”, line 37, in import_module
import(name)
ImportError: No module named bench_manager.commands
Traceback (most recent call last):
File “/usr/lib/python2.7/runpy.py”, line 174, in _run_module_as_main
main”, fname, loader, pkg_name)
File “/usr/lib/python2.7/runpy.py”, line 72, in _run_code
exec code in run_globals
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 94, in
main()
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 18, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 722, in call
return self.main(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 697, in main
rv = self.invoke(ctx)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 535, in invoke
return callback(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py”, line 26, in new_site
frappe.init(site=site, new_site=True)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 158, in init
setup_module_map()
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 856, in setup_module_map
for module in get_module_list(app):
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 730, in get_module_list
return get_file_items(os.path.join(os.path.dirname(get_module(app_name).file), “modules.txt”))
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 688, in get_module
return importlib.import_module(modulename)
File “/usr/lib/python2.7/importlib/init.py”, line 37, in import_module
import(name)
ImportError: No module named bench_manager

This action caused a fatal error as my instance was no longer reachable from the website, i switched to a second demo instance on google cloud (i have quite a few of them) that didn’t have any errors and ran the commands. They worked until the point where i was supposed to run $ bench update. I got the following error:

admin@erpnext:/home/frappe/frappe-bench$ sudo bench update
INFO:bench.utils:updating bench
INFO:bench.utils:git pull
Already up-to-date.
remote: Counting objects: 1159, done.
remote: Compressing objects: 100% (30/30), done.
remote: Total 1159 (delta 918), reused 936 (delta 913), pack-reused 216
Receiving objects: 100% (1159/1159), 1.20 MiB | 0 bytes/s, done.
Resolving deltas: 100% (964/964), completed with 256 local objects.
From GitHub - frappe/frappe: Low code web framework for real world applications, in Python and Javascript
6b9a95a…3cfbae5 master → upstream/master
09404a7…24e5d72 develop → upstream/develop
e7f49f5…3cfbae5 hotfix → upstream/hotfix

  • [new branch] revert-4072-hotfix → upstream/revert-4072-hotfix
    ad704aa…df8de9f staging → upstream/staging
  • [new tag] v8.10.6 → v8.10.6
  • [new tag] v8.10.0 → v8.10.0
  • [new tag] v8.10.1 → v8.10.1
  • [new tag] v8.10.2 → v8.10.2
  • [new tag] v8.10.3 → v8.10.3
  • [new tag] v8.10.4 → v8.10.4
  • [new tag] v8.10.5 → v8.10.5
  • [new tag] v8.9.4 → v8.9.4
    INFO:bench.utils:./env/bin/pip install Pillow
    Requirement already satisfied: Pillow in ./env/lib/python2.7/site-packages
    Requirement already satisfied: olefile in ./env/lib/python2.7/site-packages (from Pillow)
    Cannot proceed with update: You have local changes in app “frappe” that are not committed.
    Here are your choices:
  1. Merge the frappe app manually with “git pull” / “git pull --rebase” and fix conflicts.
  2. Temporarily remove your changes with “git stash” or discard them completely
    with “bench update --reset” or for individual repositries “git reset --hard”
  3. If your changes are helpful for others, send in a pull request via GitHub and
    wait for them to be merged in the core.
    admin@erpnext:/home/frappe/frappe-bench$

By the way, note that i again had to use the sudo command as running bench without sudo returns a permission denied error on all my instances in all cases and i understand that this is a standard restriction on ubuntu.

Check if there is bench_manager in apps.txt in sites folder and remove it

@Mohammed_Redha thanks for the quick tip. I followed your instruction and not only is my site back up, i was able to complete the bench manager installation. I am however faced with the same problem as above when i run the bench update from /home/frappe/frappe-bench directory. i get the following error after running the process:

INFO:bench.utils:./env/bin/pip install Pillow
Requirement already satisfied: Pillow in ./env/lib/python2.7/site-packages
Requirement already satisfied: olefile in ./env/lib/python2.7/site-packages (from Pillow)

Cannot proceed with update: You have local changes in app “frappe” that are not committed.

Here are your choices:

  1. Merge the frappe app manually with “git pull” / “git pull --rebase” and fix conflicts.
  2. Temporarily remove your changes with “git stash” or discard them completely
    with “bench update --reset” or for individual repositries “git reset --hard”
  3. If your changes are helpful for others, send in a pull request via GitHub and
    wait for them to be merged in the core.

you can give ma a quick advise on what to do here.

try this:

admin@erpnext:/home/frappe/frappe-bench$ cd apps/frappe
admin@erpnext:/home/frappe/frappe-bench/apps/frappe$ git checkout .
admin@erpnext:/home/frappe/frappe-bench/apps/frappe$ cd ..
admin@erpnext:/home/frappe/frappe-bench/apps$ cd ..
admin@erpnext:/home/frappe/frappe-bench$sudo bench update

@Mohammed_Redha now it’s saying i have local changes in app erpnext that are not committed. do i run the same process in the erpnext directory?

If you want to save these changes you have to commit.

If it is not, do same process in the erpnext directory