Error when setting up Frappe

Hello,

After a lot of head aches and taking a walk through the insane asylum, I finally could install ERPNext in Centos 7, by combining the “easy” (???) install with the manual install.

Now, I need to launch bench using “bench start” in console so it starts listening on port 8000. When I connect to that port using the web browser, a wizard appears to configure the system. After all steps are complete, a screen appears telling that Frappe is being configured. After some minutes, this message appears:

Setup failed

Could not start up: Error in setup

As usual in ERPNext, no more explanation is made. It’s only limited to show that an error occured, something obscure has happened in the universe. I think I should try to contact Superman or the Avengers, I don’t know.

Is a superheroe here that could explain me what is happening now?

Regards
Jaime

Have you tried going through the wizard with ERPNext in production mode?

@mslake

I tried, but as always happens in ERPNext, the screen gets full of errors and trace backs when I tried to setup production mode.

I first tried with “bench setup production frappe” but this is shown:

root@vps [/home/frappe/frappe-bench]# bench setup production frappe
Traceback (most recent call last):
  File "/usr/bin/bench", line 10, in <module>
    sys.exit(cli())
  File "/usr/lib/python2.7/site-packages/bench/cli.py", line 40, in cli
    bench_command()
  File "/usr/lib64/python2.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib64/python2.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/lib64/python2.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib64/python2.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib64/python2.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib64/python2.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/bench/commands/setup.py", line 57, in setup_production
    setup_production(user=user, yes=yes)
  File "/usr/lib/python2.7/site-packages/bench/config/production_setup.py", line 7, in setup_production
    generate_supervisor_config(bench_path=bench_path, user=user, yes=yes)
  File "/usr/lib/python2.7/site-packages/bench/config/supervisor.py", line 9, in generate_supervisor_config
    template = bench.env.get_template('supervisor.conf')
  File "/usr/lib64/python2.7/site-packages/jinja2/environment.py", line 830, in get_template
    return self._load_template(name, self.make_globals(globals))
  File "/usr/lib64/python2.7/site-packages/jinja2/environment.py", line 804, in _load_template
    template = self.loader.load(self, name, globals)
  File "/usr/lib64/python2.7/site-packages/jinja2/loaders.py", line 113, in load
    source, filename, uptodate = self.get_source(environment, name)
  File "/usr/lib64/python2.7/site-packages/jinja2/loaders.py", line 235, in get_source
    raise TemplateNotFound(template)
jinja2.exceptions.TemplateNotFound: supervisor.conf
root@vps [/home/frappe/frappe-bench]#

Then, going to manual installation, I’m getting crazy too:

I got stuck in the very first step. When I called “bench setup supervisor” this was shown:

root@vps [/home/frappe/frappe-bench]# bench setup supervisor
Traceback (most recent call last):
  File "/usr/bin/bench", line 10, in <module>
    sys.exit(cli())
  File "/usr/lib/python2.7/site-packages/bench/cli.py", line 40, in cli
    bench_command()
  File "/usr/lib64/python2.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib64/python2.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/lib64/python2.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib64/python2.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib64/python2.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib64/python2.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/bench/commands/setup.py", line 35, in setup_supervisor
    generate_supervisor_config(bench_path=".", user=user, yes=yes)
  File "/usr/lib/python2.7/site-packages/bench/config/supervisor.py", line 9, in generate_supervisor_config
    template = bench.env.get_template('supervisor.conf')
  File "/usr/lib64/python2.7/site-packages/jinja2/environment.py", line 830, in get_template
    return self._load_template(name, self.make_globals(globals))
  File "/usr/lib64/python2.7/site-packages/jinja2/environment.py", line 804, in _load_template
    template = self.loader.load(self, name, globals)
  File "/usr/lib64/python2.7/site-packages/jinja2/loaders.py", line 113, in load
    source, filename, uptodate = self.get_source(environment, name)
  File "/usr/lib64/python2.7/site-packages/jinja2/loaders.py", line 235, in get_source
    raise TemplateNotFound(template)
jinja2.exceptions.TemplateNotFound: supervisor.conf
root@vps [/home/frappe/frappe-bench]#

As you see, I am running this command in frappe-bench folder, and I have supervisor.conf in config folder.

if I try to run “ln -s pwd/config/supervisor.conf /etc/supervisor/conf.d/frappe-bench.conf”, error is shown too because /etc/supervisor does not exist.

if I run “yum install supervisor”, system says that “Package supervisor-3.1.4-1.el7.noarch already installed and latest version”

As you can see, for every command I issue, I get errors. This is really frustrating.

Regards

Jaime

It seems you are running the setup as the root user. This is not advisable, and will lead to an unsuitable environment. You should rather run commands as the frappe user, and use sudo commands where necessary