[INSTALL PROBLEM]: Debian 8 - fresh install Frappe and ERPNext 7

Same error as DrTrills, …“cannot lock /etc/passwd”…
Fresh install of debian 8. Also, in debian 8, nginx is not installed by default and this script does not install it, I had to run “apt-get install nginx” manually.

@Chris_Nuss @DrTrills Thanks for the info, but I’m unable to reproduce this. Can I know what you guys are installing on? Digital Ocean VPS? Local VM? I’m using a Debian 8.5 x64 Digital Ocean Droplet and it’s working fine at that step.

Hi @vjFaLk I am hosting on Google Compute Engine debian 8, on small VM 1.7GB memory.

@vjFaLk - running a virtual machine in virtualbox. Debian 8 “Jessie” with all updates from the “main contrib and non-free” repos. Tried again this morning on my fresh virtualbox snapshot and got this error… I fixed this on my previous attempt (I am starting on a fresh snapshot each time) by just installing pyasn1 via pip… maybe this needs to be added to the script as well as the install of nginx as it is not installed in debian 8 by default?

ERROR! Unexpected Exception: (pyasn1 0.1.7 (/usr/lib/python2.7/dist-packages), Requirement.parse('pyasn1>=0.1.8'), set(['cryptography']))
the full traceback was:

Traceback (most recent call last):
  File "/usr/local/bin/ansible-playbook", line 73, in <module>
    mycli = getattr(__import__("ansible.cli.%s" % sub, fromlist=[myclass]), myclass)
  File "/usr/local/lib/python2.7/dist-packages/ansible/cli/playbook.py", line 30, in <module>
    from ansible.executor.playbook_executor import PlaybookExecutor
  File "/usr/local/lib/python2.7/dist-packages/ansible/executor/playbook_executor.py", line 27, in <module>
    from ansible.executor.task_queue_manager import TaskQueueManager
  File "/usr/local/lib/python2.7/dist-packages/ansible/executor/task_queue_manager.py", line 28, in <module>
    from ansible.executor.play_iterator import PlayIterator
  File "/usr/local/lib/python2.7/dist-packages/ansible/executor/play_iterator.py", line 29, in <module>
    from ansible.playbook.block import Block
  File "/usr/local/lib/python2.7/dist-packages/ansible/playbook/__init__.py", line 25, in <module>
    from ansible.playbook.play import Play
  File "/usr/local/lib/python2.7/dist-packages/ansible/playbook/play.py", line 27, in <module>
    from ansible.playbook.base import Base
  File "/usr/local/lib/python2.7/dist-packages/ansible/playbook/base.py", line 35, in <module>
    from ansible.parsing.dataloader import DataLoader
  File "/usr/local/lib/python2.7/dist-packages/ansible/parsing/dataloader.py", line 32, in <module>
    from ansible.parsing.vault import VaultLib
  File "/usr/local/lib/python2.7/dist-packages/ansible/parsing/vault/__init__.py", line 67, in <module>
    from cryptography.hazmat.primitives.hashes import SHA256 as c_SHA256
  File "/usr/local/lib/python2.7/dist-packages/cryptography/hazmat/primitives/hashes.py", line 15, in <module>
    from cryptography.hazmat.backends.interfaces import HashBackend
  File "/usr/local/lib/python2.7/dist-packages/cryptography/hazmat/backends/__init__.py", line 7, in <module>
    import pkg_resources
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2958, in <module>
    @_call_aside
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2944, in _call_aside
    f(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2971, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 637, in _build_master
    return cls._build_from_requirements(__requires__)
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 650, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 834, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
ContextualVersionConflict: (pyasn1 0.1.7 (/usr/lib/python2.7/dist-packages), Requirement.parse('pyasn1>=0.1.8'), set(['cryptography']))
Traceback (most recent call last):
  File "install.py", line 342, in <module>
    install_bench(args)
  File "install.py", line 98, in install_bench
    run_playbook('develop/create_user.yml', extra_vars=extra_vars)
  File "install.py", line 292, in run_playbook
    success = subprocess.check_call(args, cwd=os.path.join(cwd, 'playbooks'))
  File "/usr/lib/python2.7/subprocess.py", line 540, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ansible-playbook', '-c', 'local', 'develop/create_user.yml', '-e', '@/tmp/extra_vars.json']' returned non-zero exit status 250

I did:

sudo pip install pyasn1 --upgrade

then ran the install script again and it worked! First time ever that I have been able to install a production version of erpnext!

I rekon that there might need to be a check for the pyasn1 version and then upgrade if required? Not sure though as I don’t know the script at all.

Hey thanks for testing all this out! We actually do install nginx for every setup! There shouldn’t have been a problem regarding that.

For a reference point, I installed as root with the -user frappe option with problem.

I also may have installed nginx & sudo via apt-get, and added user frappe to the sudo list.

can’t quite remember now exactly, but doing either of those shouldn’t hurt any new install.

@vjFaLk

i tried to install on fresh Debian 8, and get following error:
TASK [setup] *******************************************************************
ok: [localhost]

TASK [Check whether a site exists] *********************************************
ok: [localhost]

TASK [Create new site] *********************************************************
fatal: [localhost]: FAILED! => {“changed”: true, “cmd”: [“bench”, “new-site”, “site1.local”, “–admin-password”, “admin0admin”, “–mariadb-root-password”], “delta”: “0:00:00.712308”, “end”: “2016-08-08 00:13:46.640121”, “failed”: true, “rc”: 2, “start”: “2016-08-08 00:13:45.927813”, “stderr”: “Error: --mariadb-root-password option requires an argument”, “stdout”: “”, “stdout_lines”: [], “warnings”: []}

NO MORE HOSTS LEFT *************************************************************
to retry, use: --limit @production/install.retry

PLAY RECAP *********************************************************************
localhost : ok=44 changed=22 unreachable=0 failed=1

Traceback (most recent call last):
File “install.py”, line 342, in
install_bench(args)
File “install.py”, line 111, in install_bench
run_playbook(‘production/install.yml’, sudo=True, extra_vars=extra_vars)
File “install.py”, line 292, in run_playbook
success = subprocess.check_call(args, cwd=os.path.join(cwd, ‘playbooks’))
File “/usr/lib/python2.7/subprocess.py”, line 540, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command ‘[‘ansible-playbook’, ‘-c’, ‘local’, ‘production/install.yml’, ‘-e’, ‘@/tmp/extra_vars.json’, ‘–become’, ‘–become-user=frappe’]’ returned non-zero exit status 2

Any advise?

When asked to set a password during the beginning of the installation did you enter nothing? Run the installer again and enter the passwords.

1 Like

thanks @vjFaLk
i reinstall, following this instruction,

By now, i just simply press enter when asking password and administrative password.
The installation goes well, without error.

Think, i need to change the password :slight_smile:

2 Likes

Hey it finally worked! I skipped the passwords first time around, then it worked and later on asked me for DB passwords which worked!

This is awesome thanks everyone! Now to test it out and work on a data migration plan! Currently hosted on Debian 8 - Google Compute Engine

1 Like

Not sure if I should make a new thread, but is anyone else having issues updating?

$ cd /home/frappe/frappe-bench/
user@erpv7deb8:/home/frappe/frappe-bench$ bench update
Traceback (most recent call last):
  File "/usr/local/bin/bench", line 9, in <module>
    load_entry_point('bench', 'console_scripts', 'bench')()
  File "/home/frappe/.bench/bench/cli.py", line 40, in cli
    bench_command()
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1057, in invoke
    Command.invoke(self, ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/home/frappe/.bench/bench/commands/__init__.py", line 21, in bench_command
    setup_logging(bench_path=bench_path)
  File "/home/frappe/.bench/bench/utils.py", line 268, in setup_logging
    hdlr = logging.FileHandler(log_file)
  File "/usr/lib/python2.7/logging/__init__.py", line 911, in __init__
    StreamHandler.__init__(self, self._open())
  File "/usr/lib/python2.7/logging/__init__.py", line 936, in _open
    stream = open(self.baseFilename, self.mode)
IOError: [Errno 13] Permission denied: '/home/frappe/frappe-bench/logs/bench.log'
userl@erpv7deb8:/home/frappe/frappe-bench$ bench update --pull
Traceback (most recent call last):
  File "/usr/local/bin/bench", line 9, in <module>
    load_entry_point('bench', 'console_scripts', 'bench')()
  File "/home/frappe/.bench/bench/cli.py", line 40, in cli
    bench_command()
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1057, in invoke
    Command.invoke(self, ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/home/frappe/.bench/bench/commands/__init__.py", line 21, in bench_command
    setup_logging(bench_path=bench_path)
  File "/home/frappe/.bench/bench/utils.py", line 268, in setup_logging
    hdlr = logging.FileHandler(log_file)
  File "/usr/lib/python2.7/logging/__init__.py", line 911, in __init__
    StreamHandler.__init__(self, self._open())
  File "/usr/lib/python2.7/logging/__init__.py", line 936, in _open
    stream = open(self.baseFilename, self.mode)
IOError: [Errno 13] Permission denied: '/home/frappe/frappe-bench/logs/bench.log'
user@erpv7deb8:/home/frappe/frappe-bench$

Seems like a ownership issue. Did you run something as sudo before?

Just run sudo chown -R frappe:frappe /home/frappe/frappe-bench and try updating again.

Hey @vjFaLk thanks for the reply!

I am playing with the permissions now and it is still giving some errors though I think I am on the right path here. It is giving me:

@erpv7deb8:/home/frappe/frappe-bench$ bench update
INFO:bench.utils:updating bench
Updating b34b1e1..7f8c66d
error: Your local changes to the following files would be overwritten by merge:
       	bench/commands/utils.py
Please, commit your changes or stash them before you can merge.
Aborting
Traceback (most recent call last):
  File "/usr/local/bin/bench", line 9, in <module>
    load_entry_point('bench', 'console_scripts', 'bench')()
  File "/home/frappe/.bench/bench/cli.py", line 40, in cli
    bench_command()
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/home/frappe/.bench/bench/commands/update.py", line 34, in update
    update_bench()
  File "/home/frappe/.bench/bench/utils.py", line 230, in update_bench
    exec_cmd("git pull", cwd=cwd)
  File "/home/frappe/.bench/bench/utils.py", line 130, in exec_cmd
    raise CommandFailedError(cmd)
bench.utils.CommandFailedError: git pull

I did git stash to hide this (i didn’t do any customizations) but still no luck. Will keep trying different things. Any ideas are very welcome!

Thanks for all your support so far!

I had the same problem. The issue was that I was using the @vjFaLK’s repo instead of the frappe/bench repo. I tried cleaning it up via git commands but ended up getting my shorts all twisted up, so to say.

Since I was just testing it out with some users to see if it would work for them, I didn’t have any essential data, so I wiped it and moved to the frappe/bench repo master branch and reinstalled.

Worked like a charm, no issues at all with the install from the main repo.

@ericmoon Don’t use my repo! Haha, that could cause other issues.

@DrTrills The fix is simple, just go into the .bench / bench-repo folder inside your home folder and run:

git reset --hard
git clean -fdx
git checkout master
git pull

And then try updating again from the frappe-bench folder.

Hi @vjFaLk,
As I was having the same messages as the people above

error: Your local changes to the following files would be overwritten by merge:
bench/commands/utils.py
Please, commit your changes or stash them before you can merge.
Aborting

I did the above mentioned steps (and thanks for the suggestions.), they all worked well, but I am faced now with the following message. Any suggestions?

frappe@ERPShiny:~/frappe-bench$ bench update
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 5, in
from pkg_resources import load_entry_point
File “/usr/local/lib/python2.7/dist-packages/pkg_resources/init.py”, line 2953, in
@_call_aside
File “/usr/local/lib/python2.7/dist-packages/pkg_resources/init.py”, line 2939, in _call_aside
f(*args, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/pkg_resources/init.py”, line 2966, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File “/usr/local/lib/python2.7/dist-packages/pkg_resources/init.py”, line 635, in _build_master
ws.require(requires)
File “/usr/local/lib/python2.7/dist-packages/pkg_resources/init.py”, line 943, in require
needed = self.resolve(parse_requirements(requirements))
File “/usr/local/lib/python2.7/dist-packages/pkg_resources/init.py”, line 829, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The ‘bench’ distribution was not found and is required by the application

thanks in advance

Hmm that’s quite odd. Can you run ls -a inside the .bench folder and give me the output?

Hi @vjFaLk, thanks for your prompt reply.

Here is the output.

frappe@ERPShiny:~/.bench$ ls -a
. … bench completion.sh .git .gitignore install_scripts LICENSE.md MANIFEST.in playbooks README.md requirements.txt setup.py .travis.yml vm
frappe@ERPShiny:~/.bench$

Best,

Hi @vjFaLk,
So I managed to make it work by first reinstalling bench.

git clone https://github.com/frappe/bench bench-repo
sudo pip install -e bench-repo

Then doing
./env/bin/pip install -e ./apps/frappe

It seems like it is working now and I can do bench update without problem.

1 Like