Setup production issues

I am installing erpnext on live hosting. On localhost it works. I have installed all the requirements. After that i am confused what to do next even i am trying it since a week. I am running site with Ip(don’t have domain for now).
I tried 2 cases.

  1. Bench start :- Bench not starting.

    05:28:15 redis_queue.1 | 29715:M 09 Aug 05:28:15.779 * Removing the pid file.

05:28:15 redis_queue.1    | 29715:M 09 Aug 05:28:15.780 # Redis is now ready to exit, bye bye...
05:28:15 system           | redis_queue.1 stopped (rc=-15)
05:28:15 redis_socketio.1 | 29711:M 09 Aug 05:28:15.781 # Redis is now ready to exit, bye bye...
05:28:15 system           | redis_socketio.1 stopped (rc=-15)
05:28:15 redis_cache.1    | 29731:M 09 Aug 05:28:15.783 # Redis is now ready to exit, bye bye...
05:28:15 system           | redis_cache.1 stopped (rc=-15)
05:28:15 web.1            | Exception in thread Thread-2 (most likely raised during interpreter shutdown):
05:28:15 web.1            | Traceback (most recent call last):
05:28:15 web.1            |   File "/usr/local/lib/python2.7/threading.py", line 801, in __bootstrap_inner
05:28:15 web.1            |   File "/home/ErpDsync/frappe-bench/env/lib/python2.7/site-packages/watchdog/observers/api.py", line 237, in run
05:28:15 web.1            | <type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'Empty'
05:28:15 system           | worker_long.1 stopped (rc=-15)
05:28:15 system           | worker_default.1 stopped (rc=-15)
05:28:15 system           | worker_short.1 stopped (rc=-15)
05:28:16 system           | web.1 stopped (rc=-15)

i notice that “http://0.0.0.0:8000/” will not work on live hosting so tried with setup producton also this also failed.

root@devchd:/home/Erp/frappe-bench# bench setup production dev
supervisor.conf already exists and this will overwrite it. Do you want to continue? [y/N]: y
Port configuration list:
Site site2name assigned port: 82
Site site1.local assigned port: 80
nginx.conf already exists and this will overwrite it. Do you want to continue? [y/N]: y
Traceback (most recent call last):
  File "/usr/local/bin/bench", line 11, in <module>
    load_entry_point('bench', 'console_scripts', 'bench')()
  File "/home/Erp/bench-repo/bench/cli.py", line 40, in cli
    bench_command()
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/Erp/bench-repo/bench/commands/setup.py", line 56, in setup_production
    setup_production(user=user)
  File "/home/Erp/bench-repo/bench/config/production_setup.py", line 17, in setup_production
    bench_name=bench_name, extn=supervisor_conf_extn))
  File "/usr/local/lib/python2.7/posixpath.py", line 70, in join
    elif path == '' or path.endswith('/'):
AttributeError: 'NoneType' object has no attribute 'endswith'

I am confused what is the error. Basically i want to build some API endpoints so i installing in on Live hosting. On localhost it works. I want to access site using this kind of URL “ip:port” or “ip/erpnext” For example “138.122.12.12:8000” or “138.122.12.12/erpnext” etc so i can API calls from another platform.

Any help will be appreciated.

No reply? Really?

Try bench serve --port 9333 run on this command in a screen & check it.
to check on browser as like
38.122.12.12(IP):9333(PORT)

Thanks

Thanks for reply but now facing another weird error

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/local/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/Erp/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 94, in <module>
    main()
  File "/home/Erp/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 18, in main
    click.Group(commands=commands)(prog_name='bench')
  File "/home/Erp/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/home/Erp/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/home/Erp/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/Erp/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/Erp/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/Erp/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/Erp/frappe-bench/env/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/Erp/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 24, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/home/Erp/frappe-bench/apps/frappe/frappe/commands/utils.py", line 351, in serve
    import frappe.app
  File "/home/Erp/frappe-bench/apps/frappe/frappe/app.py", line 18, in <module>
    import frappe.auth
  File "/home/Erp/frappe-bench/apps/frappe/frappe/auth.py", line 20, in <module>
    from twofactor import (should_run_2fa, authenticate_for_2factor,
  File "/home/Erp/frappe-bench/apps/frappe/frappe/twofactor.py", line 8, in <module>
    import pyotp, os
ImportError: No module named pyotp

please check your python version.
may i know your version & branch of erpnext & frappe.

Thanks

sure
Python 2.7.13
Bench version :- 4.1.0
and am using develop branch for erpnext and frappe

For the Production setup use the Master branch only.Because
the Development in process in develop branch.

Thanks

Well bro it works, after switched to master bench start not throwing anymore. Now one question more.

06:31:45 *** Listening on long…
06:31:46 web.1 | * Running on http://0.0.0.0:8000/ (Press CTRL+C to quit)
06:31:46 web.1 | * Restarting with inotify reloader
06:31:46 worker_short.1 | 06:31:46 RQ worker u’rq:worker:devchd.8205.short’ started, version 0.8.1
06:31:46 worker_short.1 | 06:31:46 Cleaning registries for queue: short

As you read it is running on http://0.0.0.0 , how can i run it on my external ip. Let me know if you get my point

i found that nginx was not working. I have fixed it. Now on http:ip nginx showing welcome message but site is not opening on http://ip:8000. can anyone help me to come out of this

Neither production working :frowning:

Site site1.local assigned port: 80
nginx.conf already exists and this will overwrite it. Do you want to continue? [y/N]: y
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 11, in
load_entry_point(‘bench’, ‘console_scripts’, ‘bench’)()
File “/home/Erp/bench-repo/bench/cli.py”, line 40, in cli
bench_command()
File “/usr/local/lib/python2.7/site-packages/click/core.py”, line 722, in call
return self.main(*args, **kwargs)
File “/usr/local/lib/python2.7/site-packages/click/core.py”, line 697, in main
rv = self.invoke(ctx)
File “/usr/local/lib/python2.7/site-packages/click/core.py”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python2.7/site-packages/click/core.py”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python2.7/site-packages/click/core.py”, line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python2.7/site-packages/click/core.py”, line 535, in invoke
return callback(*args, **kwargs)
File “/home/Erp/bench-repo/bench/commands/setup.py”, line 56, in setup_production
setup_production(user=user)
File “/home/Erp/bench-repo/bench/config/production_setup.py”, line 17, in setup_production
bench_name=bench_name, extn=supervisor_conf_extn))
File “/usr/local/lib/python2.7/posixpath.py”, line 70, in join
elif path == ‘’ or path.endswith(’/’):
AttributeError: ‘NoneType’ object has no attribute ‘endswith’

Hey! can any reply? site working on “http://0.0.0.0:8000/” but not on external IP. why?

This may explain your problem source -

It seems you installed as root rather than sudo, and run as root

The instructions advise install and run as non-root user…