Frappe Install - init Bench Failed!

Dear Team,

I am new to ERPnext. i was trying to follow ERPnext guide as under for manual installation.

Everything works fine. I got into problem, when i run
bench init frappe-bench

Although, first i tried to do bench init fadu-bench (fadu is my son’s nick)
it return my error. so, i tried again as
bench init frappe-bench!
But didnt help. Log file attached.

error|690x387

my bench version is 4.1.0

post the full traceback.

Hi Kenneth,

Below is the trace. Please assist!

fawwad@debian:~$ bench init frappe-bench
INFO:bench.utils:virtualenv -q env -p /usr/bin/python
Already using interpreter /usr/bin/python
INFO:bench.utils:./env/bin/pip -q install --upgrade pip==9.0.3
You are using pip version 9.0.3, however version 10.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
INFO:bench.utils:./env/bin/pip -q install wheel
INFO:bench.utils:./env/bin/pip -q install six
INFO:bench.utils:./env/bin/pip -q install -e git+https://github.com/frappe/python-pdfkit.git#egg=pdfkit
INFO:bench.app:getting app frappe
INFO:bench.utils:git clone https://github.com/frappe/frappe.git   --origin upstream
Cloning into 'frappe'...
remote: Counting objects: 148035, done.
remote: Compressing objects: 100% (41/41), done.
remote: Total 148035 (delta 21), reused 32 (delta 19), pack-reused 147975
Receiving objects: 100% (148035/148035), 160.50 MiB | 647.00 KiB/s, done.
Resolving deltas: 100% (111862/111862), done.
Checking connectivity... done.
Checking out files: 100% (2184/2184), done.
('installing', u'frappe')
INFO:bench.app:installing frappe
INFO:bench.utils:frappe-bench/env/bin/pip install -q  -e frappe-bench/apps/frappe --no-cache-dir
Command "/home/fawwad/frappe-bench/env/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-nXRQ9h/scandir/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-yZw2je-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/fawwad/frappe-bench/env/include/site/python2.7/scandir" failed with error code 1 in /tmp/pip-build-nXRQ9h/scandir/
Traceback (most recent call last):
  File "/usr/local/bin/bench", line 11, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python2.7/dist-packages/bench/cli.py", line 40, in cli
    bench_command()
  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 "/usr/local/lib/python2.7/dist-packages/bench/commands/make.py", line 30, in init
    python 		 = python)
  File "/usr/local/lib/python2.7/dist-packages/bench/utils.py", line 75, in init
    get_app(frappe_path, branch=frappe_branch, bench_path=path, build_asset_files=False, verbose=verbose)
  File "/usr/local/lib/python2.7/dist-packages/bench/app.py", line 135, in get_app
    install_app(app=app_name, bench_path=bench_path, verbose=verbose)
  File "/usr/local/lib/python2.7/dist-packages/bench/app.py", line 181, in install_app
    find_links=find_links))
  File "/usr/local/lib/python2.7/dist-packages/bench/utils.py", line 159, in exec_cmd
    raise CommandFailedError(cmd)
bench.utils.CommandFailedError: frappe-bench/env/bin/pip install -q  -e frappe-bench/apps/frappe --no-cache-dir
fawwad@debian:~$ ^C
fawwad@debian:~$
1 Like

Hi Guys,

I am still looking for a solution. Please assist me. so, i may be able to test and realize ERPnext potential.
Looking forward for feedback.

I think you have missed installing python-dev and gcc on your system

apt install python-dev gcc

Delete the frappe-bench folder and try bench init again

1 Like

ok, let me give it a try.
thanks for feedback!

How can i delete frappe-bench folder ?

I tried below command
bench remove-app [frappe-bench]

It says - I should not run this command as root !
Will you please share the command to be run

rm -rf frappe-bench should the folder. Also don’t execute bench init frappe-bench as the root user. Execute it as the frappe user.

1 Like

Hi,

I tried your said steps!
It seems , its works. this is how my frappe-bench folder looks like now!

fawwad@erpnext:~/frappe-bench$ ls
apps config env logs patches.txt Procfile sites

I have five folders and two files!

If i compare it with the user guide, i cant find
package.json
package-lock.json

shall i proceed or you have some suggestion for me :slight_smile:

No, it’s perfect. You may proceed

Thanks dude for your assistance. much appreciated!!!

I am almost done with the installation.
Following user guide
i create my site as intellect.com (instead of foo.bar)

I am at the step
Installing Frappé Apps onto Sites

$ bench --site <MY_SITE> install-app <MY_APP_NAME>

e.g.

$ bench --site intellect.com install-app erpnext

when i am executing above command from my frappe-bench directoy , i encounter following problem!

fawwad@erpnext:~$ cd frappe-bench
fawwad@erpnext:~/frappe-bench$ bench --site intellect.com install-app erpnext
Traceback (most recent call last):
File “/usr/lib/python2.7/runpy.py”, line 162, 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/fawwad/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 97, in
main()
File “/home/fawwad/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 18, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/fawwad/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 722, in call
return self.main(*args, **kwargs)
File “/home/fawwad/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 697, in main
rv = self.invoke(ctx)
File “/home/fawwad/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/fawwad/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/fawwad/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/fawwad/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 535, in invoke
return callback(*args, **kwargs)
File “/home/fawwad/frappe-bench/env/local/lib/python2.7/site-packages/click/decorators.py”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/fawwad/frappe-bench/apps/frappe/frappe/commands/init.py”, line 25, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/fawwad/frappe-bench/apps/frappe/frappe/commands/site.py”, line 165, in install_app
_install_app(app, verbose=context.verbose)
File “/home/fawwad/frappe-bench/apps/frappe/frappe/installer.py”, line 113, in install_app
frappe.clear_cache()
File “/home/fawwad/frappe-bench/apps/frappe/frappe/init.py”, line 513, in clear_cache
frappe.cache_manager.clear_user_cache()
File “/home/fawwad/frappe-bench/apps/frappe/frappe/cache_manager.py”, line 29, in clear_user_cache
clear_global_cache()
File “/home/fawwad/frappe-bench/apps/frappe/frappe/cache_manager.py”, line 37, in clear_global_cache
clear_website_cache()
File “/home/fawwad/frappe-bench/apps/frappe/frappe/website/render.py”, line 287, in clear_cache
for method in frappe.get_hooks(“website_clear_cache”):
File “/home/fawwad/frappe-bench/apps/frappe/frappe/init.py”, line 835, in get_hooks
hooks = _dict(cache().get_value(“app_hooks”, load_app_hooks))
File “/home/fawwad/frappe-bench/apps/frappe/frappe/utils/redis_wrapper.py”, line 72, in get_value
val = generator()
File “/home/fawwad/frappe-bench/apps/frappe/frappe/init.py”, line 813, in load_app_hooks
for app in [app_name] if app_name else get_installed_apps(sort=True):
File “/home/fawwad/frappe-bench/apps/frappe/frappe/init.py”, line 777, in get_installed_apps
installed = json.loads(db.get_global(“installed_apps”) or “[]”)
File “/home/fawwad/frappe-bench/apps/frappe/frappe/database.py”, line 770, in get_global
return self.get_default(key, user)
File “/home/fawwad/frappe-bench/apps/frappe/frappe/database.py”, line 782, in get_default
d = self.get_defaults(key, parent)
File “/home/fawwad/frappe-bench/apps/frappe/frappe/database.py”, line 788, in get_defaults
defaults = frappe.defaults.get_defaults(parent)
File “/home/fawwad/frappe-bench/apps/frappe/frappe/defaults.py”, line 71, in get_defaults
globald = get_defaults_for()
File “/home/fawwad/frappe-bench/apps/frappe/frappe/defaults.py”, line 196, in get_defaults_for
where parent = %s order by creation"“”, (parent,), as_dict=1)
File “/home/fawwad/frappe-bench/apps/frappe/frappe/database.py”, line 166, in sql
self.connect()
File “/home/fawwad/frappe-bench/apps/frappe/frappe/database.py”, line 116, in connect
charset=‘utf8mb4’, use_unicode = True, conv = conversions, local_infile = self.local_infile)
File “/home/fawwad/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/init.py”, line 94, in Connect
return Connection(*args, **kwargs)
File “/home/fawwad/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py”, line 327, in init
self.connect()
File “/home/fawwad/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py”, line 629, in connect
raise exc
pymysql.err.OperationalError: (2003, “Can’t connect to MySQL server on u’localhost’ ([Errno 111] Connection refused)”)
fawwad@erpnext:~/frappe-bench$

Please assist

note: I tried to make a connection to my RDBMS from another terminal and i can make connection!

Try restarting you mysql server using sudo systemctl restart mysql and then try again

hi,

I tried the said command
sudo systemctl restart mysql

but i am unable to get through.

Do i have to remove something first !
I presume, there may be some conflict in site !
As i already have a folder with intellect name as

/home/fawwad/frappe-bench/sites/intellect.com/

If possible, may you please connect with me. so, i may share my screen.

one more try
I just tried to update my hosts file
127.0.0.1 intellect.com

I have changed it to
127.0.0.1 localhost

then i run the command
bench --site intellect.com install-app erpnext

this time around, it process and update the documents and finishes the process (apparently gracefully).

now, when i am trying to access website
as written

You’re all set!

Now you can simply access the site you just created using the link foo.bar:8000

intellect.com:8000

Nothing happen !! :frowning:

And it seems, i don’t have apache server as well ?
Dont we need it here !

Okay this wiki will solve most of your problems I presume. If problems still persist, post logs

This time, i tried your above linked
Easy Install on Fresh Debian 8

when i am running python install.py --develop
it suppose to run the script to do all installation and configuraiton but i end up with below errors. What would you suggest !

root@erpnext:/home/fawwad# python install.py --develop
/bin/sh: 1: sudo: not found
Traceback (most recent call last):
File “install.py”, line 420, in
install_bench(args)
File “install.py”, line 11, in install_bench
install_package(‘curl’)
File “install.py”, line 181, in install_package
‘yum’: [‘sudo yum install -y {0}’.format(package)]
File “install.py”, line 234, in run_os_command
returncode = subprocess.check_call(command, shell=True)
File “/usr/lib/python2.7/subprocess.py”, line 540, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command ‘sudo apt-get install -y curl’ returned non-zero exit status 127

apt install sudo

Ok, i install sudo and then add my user (fawwad) to sudo

then i run below command
sudo apt-get install python-minimal
it goes fine !

Later i run and gives following message. It seems it didnt install all required stuff.
fawwad@erpnext:~/Desktop$ python install.py --develop --user fawwad
Hit http://security.debian.org jessie/updates InRelease
Hit http://security.debian.org jessie/updates/main Sources
Hit http://security.debian.org jessie/updates/main amd64 Packages
Hit http://security.debian.org jessie/updates/main Translation-en
Reading package lists… Done
Reading package lists… Done
Building dependency tree
Reading state information… Done
Package build-essential is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

Package python-setuptools is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

Package python-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
python

E: Package ‘build-essential’ has no installation candidate
E: Package ‘python-setuptools’ has no installation candidate
E: Package ‘python-dev’ has no installation candidate
Traceback (most recent call last):
File “install.py”, line 420, in
install_bench(args)
File “install.py”, line 21, in install_bench
‘sudo yum install -y epel-release redhat-lsb-core git python-setuptools python-devel openssl-devel libffi-devel’
File “install.py”, line 234, in run_os_command
returncode = subprocess.check_call(command, shell=True)
File “/usr/lib/python2.7/subprocess.py”, line 540, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command ‘sudo apt-get install -y git build-essential python-setuptools python-dev libffi-dev libssl-dev’ returned non-zero exit status 100
fawwad@erpnext:~/Desktop$

You need to install python-setuptools & python-dev packages

This is how i do on CentOS
sudo yum install -y redhat-lsb-core git python-setuptools python-devel openssl-devel libffi-devel

try apt update && apt upgrade -y before running the install.py script

1 Like