Problem when I try to setup erpnext on my VPS, CONNECTION_REFUSED

Hello everyone,

I’m getting an error when I try to setup erpnext on my VPS, and I’m sorry I cannot find any topics that solve my problem (trust me, i’ve done a lot of topics before to post here).

Here are the steps that I’ve done before to post:

1 - Trying to run KO at first time:

wget https://raw.githubusercontent.com/frappe/bench/master/install_scripts/setup_frappe.sh
sudo bash setup_frappe.sh --setup-production 

Then I looked on many forum, and everything is OK about Frappe, i can run it, access it without any problem.

2 - Trying to setup erpnext over the web browser "Installer > ERPNEXT > Install "
I obtained this error

Traceback (innermost last):
File “/home/dreamin/frappe-bench/apps/frappe/frappe/app.py”, line 51, in application
response = frappe.handler.handle()
File “/home/dreamin/frappe-bench/apps/frappe/frappe/handler.py”, line 66, in handle
execute_cmd(cmd)
File “/home/dreamin/frappe-bench/apps/frappe/frappe/handler.py”, line 89, in execute_cmd
ret = frappe.call(method, **frappe.form_dict)
File “/home/dreamin/frappe-bench/apps/frappe/frappe/init.py”, line 532, in call
return fn(*args, **newargs)
File “/home/dreamin/frappe-bench/apps/frappe/frappe/core/page/applications/applications.py”, line 36, in install_app
frappe.installer.install_app(name)
File “/home/dreamin/frappe-bench/apps/frappe/frappe/installer.py”, line 114, in install_app
sync_for(name, force=True, sync_everything=True, verbose=verbose)
File “/home/dreamin/frappe-bench/apps/frappe/frappe/model/sync.py”, line 34, in sync_for
import_file_by_path(doc_path, force=force)
File “/home/dreamin/frappe-bench/apps/frappe/frappe/modules/import_file.py”, line 50, in import_file_by_path
import_doc(doc, force=force)
File “/home/dreamin/frappe-bench/apps/frappe/frappe/modules/import_file.py”, line 111, in import_doc
doc.insert()
File “/home/dreamin/frappe-bench/apps/frappe/frappe/model/document.py”, line 162, in insert
self.run_post_save_methods()
File “/home/dreamin/frappe-bench/apps/frappe/frappe/model/document.py”, line 449, in run_post_save_methods
self.run_method(“on_update”)
File “/home/dreamin/frappe-bench/apps/frappe/frappe/model/document.py”, line 412, in run_method
return Document.hook(fn)(self, *args, **kwargs)
File “/home/dreamin/frappe-bench/apps/frappe/frappe/model/document.py”, line 496, in composer
return composed(self, method, *args, **kwargs)
File “/home/dreamin/frappe-bench/apps/frappe/frappe/model/document.py”, line 479, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/dreamin/frappe-bench/apps/frappe/frappe/model/document.py”, line 406, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/dreamin/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py”, line 100, in on_update
module = load_doctype_module(self.name, self.module)
File “/home/dreamin/frappe-bench/apps/frappe/frappe/modules/init.py”, line 58, in load_doctype_module
doctype_python_modules[key] = frappe.get_module(get_module_name(doctype, module, prefix))
File “/home/dreamin/frappe-bench/apps/frappe/frappe/init.py”, line 379, in get_module
return importlib.import_module(modulename)
File “/usr/lib/python2.7/importlib/init.py”, line 37, in import_module
import(name)
File “/home/dreamin/frappe-bench/apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.py”, line 9, in
from erpnext.controllers.accounts_controller import AccountsController
File “/home/dreamin/frappe-bench/apps/erpnext/erpnext/controllers/accounts_controller.py”, line 9, in
from erpnext.accounts.utils import get_fiscal_year, validate_fiscal_year
File “/home/dreamin/frappe-bench/apps/erpnext/erpnext/accounts/utils.py”, line 10, in
import frappe.desk.reportview
ImportError: No module named desk.reportview

3 - If I closed the popup, and run the command agan “Installer > ERPNEXT > Install” I get this new error:

Duplicate name Module Def Accounts
Another transaction is blocking this one. Please try again in a few seconds.

4 - Ok I look on the web, and It explained that it’s because my site was broken. I cleanup everything (site and db), and run the command again, but this time in a console :

bench get-app erpnext https://github.com/frappe/erpnext
bench new-site site1.local
bench frappe --install_app erpnext site1.local

Finally I end up with no more solutions and the same problem, I tried to look everywhere and I’m completely locked. I heard about something on a forum where it should be a problem about use access.

Can someone help me?
Thanks in avance

Finally I just wanna add that I tryed a free account of erpnext and it’s just a great tool, it seems to be a powerfull ERP with a very good conception. Awesome job guys. I just wanna use it on my VPS ( :wink:)

Kev

Hi everyone,

So no I try another way to setup everything by myself.
So I follow step by step each point describe in “Setting Up ERPNext”.

Now when I try to install erpnext after create sites, etc…
I get this message :

Traceback (most recent call last):
  File "/usr/local/bin/bench", line 9, in <module>
    load_entry_point('bench==0.1', 'console_scripts', 'bench')()
  File "/home/dreamin/bench-repo/bench/cli.py", line 42, in cli
    return old_frappe_cli()
  File "/home/dreamin/bench-repo/bench/cli.py", line 91, in old_frappe_cli
    os.execv(f, [f] + sys.argv[2:])
OSError: [Errno 2] No such file or directory

So I’mnow unable to setup erpnext. I think I’m really not far to setup this great tools, but I cannot find out a solution.

Any help will be very great.

Kev

Hi again,

I restart from the beginning with auto install script.
Now if i run command bench frappe --serve I can access my frappe desk with erpnext without any problem and play with this great tool.

The problem is when I try to apply production mode.
If I follow each step, and the run sudo supervisorctl status i obtain :

frappe:frappe-web                RUNNING    pid 18955, uptime 0:06:12
frappe:frappe-worker             RUNNING    pid 18952, uptime 0:06:12
frappe:frappe-workerbeat         RUNNING    pid 19035, uptime 0:06:11
gunicorn                         RUNNING    pid 1855, uptime 0:00:05

But if I try to access to site with http://myip:8000 it answers ERR_CONNECTION_REFUSED.
What is strange, is that if I look in the browser tab, the small icon of Frappe is displayed (meens that server interacts with the browser gith?)

Any help will be very welcome, because I begin to don’t know what to do.

Regards,
Kev

@kevinkasel check the log files in the /logs folder in the bench.

That’s all right for me now. IT was a bad nginx/gunicorn configuration between port and Ip adresses
Thanks