Sales order screen freezed after bench update

Hi all,

It worked yesterday.

After I did a bench update, it seems my sales order screen freezed all the time. Other screen is okay e.g. quotation.

http://imgur.com/mcub3kl

I check the log file, not exactly sure which specific log file to look at. But so far, no error.

Any idea why? Thanks.

Can you run:

bench setup nginx
then sudo service nginx restart

I am already using the production mode. Tried the nginx restart, same issue.

Any help? Thanks.

In chrome, developer toolbar → console, shows this

desk#List/Sales Order:1 Uncaught SyntaxError: Unexpected token < in JSON at position 0

any idea?

The above is a known issue, and we changed the nginx config to fix it.

bench setup nginx will basically fix and replace your old nginx config.

thanks for sharing.

i tried to run that command, got this error

ericmachine@ericmachine-VirtualBox:~/frappe-bench$ bench setup nginx
Traceback (most recent call last):
  File "/usr/local/bin/bench", line 9, in <module>
    load_entry_point('bench==3.0.0', 'console_scripts', 'bench')()
  File "/home/ericmachine/bench-repo/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 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/ericmachine/bench-repo/bench/commands/setup.py", line 21, in setup_nginx
    make_nginx_conf(bench_path=".")
  File "/home/ericmachine/bench-repo/bench/config/nginx.py", line 13, in make_nginx_conf
    sites = prepare_sites(config, bench_path)
  File "/home/ericmachine/bench-repo/bench/config/nginx.py", line 56, in prepare_sites
    raise Exception("Port {0} is being used by another site {1}".format(site["port"], ports_in_use[site["port"]]))
Exception: Port 80 is being used by another site library

Library is another site which i followed the frappe tutorial. Weird, as I recall library is on port 8080, which I need to run this command each time. Definitely not on port 80.

bench --site library serve --port 8080

If I ran http://localhost, I can see erpnext, not library.

I tried running this

bench set-nginx-port site1.local 80 (i presume site1.local is erpnext).

Still get the same error as above.

My current sites

http://imgur.com/dmoUrW4

Any help? Thanks.

Do bench set-nginx-port library 81

If it gives an error for that then set the port for meeting.dev (as 82) as well and then setup nginx again.

Good stuff, no errors in command line.

Too bad, my whole site goes down

http://imgur.com/kRMAfGW

Tried this, made no difference

bench set-nginx-port site1.local 80

any idea?

Did you run bench setup nginx config and restart nginx?

If that doesn’t fix try,
bench setup dns_multitenant off,
bench setup nginx
and restart nginx.

i believe is this command right

bench config dns_multitenant off

this command doesn’t exist too

bench setup nginx config

presume you meant

bench setup nginx

tried all the commands, still cannot work. In fact my other sites (port 81, 82) down as well.

which specific log file should i refer? maybe I can pull the errors out.

any help? thanks.

please use:

bench update
bench update --upgrade
bench setup nginx
bench set-nginx-port site1.local 80
bench set-nginx-port library 8080
bench restart
sudo service nginx restart

and try again :wink:

oh no, when i ran bench update (1st command), got this error…

i tried to run this command “bench update --upgrade”, same error too :frowning:

weird, i have erpnext in my apps folder. before this, i could bench update, how come now cannot?

ericmachine@ericmachine-VirtualBox:~/frappe-bench$ bench update
INFO:bench.utils:updating bench
Already up-to-date.
Requirement already satisfied (use --upgrade to upgrade): Pillow in ./env/lib/python2.7/site-packages
INFO:bench.app:pulling frappe
From https://github.com/frappe/frappe
 * branch            master     -> FETCH_HEAD
Already up-to-date.
INFO:bench.app:pulling erpnext
From https://github.com/frappe/erpnext
 * branch            master     -> FETCH_HEAD
Already up-to-date.
Requirement already up-to-date: pip in ./env/lib/python2.7/site-packages
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/ericmachine/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 79, in <module>
    main()
  File "/home/ericmachine/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 16, in main
    click.Group(commands=commands)(prog_name='bench')
  File "/home/ericmachine/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/home/ericmachine/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/home/ericmachine/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/ericmachine/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/ericmachine/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/ericmachine/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/home/ericmachine/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/ericmachine/frappe-bench/apps/frappe/frappe/commands.py", line 29, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/home/ericmachine/frappe-bench/apps/frappe/frappe/commands.py", line 895, in backup
    frappe.init(site=site)
  File "/home/ericmachine/frappe-bench/apps/frappe/frappe/__init__.py", line 140, in init
    setup_module_map()
  File "/home/ericmachine/frappe-bench/apps/frappe/frappe/__init__.py", line 741, in setup_module_map
    for module in get_module_list(app):
  File "/home/ericmachine/frappe-bench/apps/frappe/frappe/__init__.py", line 641, in get_module_list
    return get_file_items(os.path.join(os.path.dirname(get_module(app_name).__file__), "modules.txt"))
  File "/home/ericmachine/frappe-bench/apps/frappe/frappe/__init__.py", line 599, in get_module
    return importlib.import_module(modulename)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
ImportError: No module named erpnext
Traceback (most recent call last):
  File "/usr/local/bin/bench", line 9, in <module>
    load_entry_point('bench==3.0.0', 'console_scripts', 'bench')()
  File "/home/ericmachine/bench-repo/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/ericmachine/bench-repo/bench/commands/update.py", line 61, in update
    _update(pull, patch, build, bench, auto, restart_supervisor, requirements, no_backup, upgrade, force=force)
  File "/home/ericmachine/bench-repo/bench/commands/update.py", line 90, in _update
    backup_all_sites(bench=bench_path)
  File "/home/ericmachine/bench-repo/bench/utils.py", line 359, in backup_all_sites
    backup_site(site, bench=bench)
  File "/home/ericmachine/bench-repo/bench/utils.py", line 355, in backup_site
    run_frappe_cmd('--site', site, 'backup', bench=bench)
  File "/home/ericmachine/bench-repo/bench/utils.py", line 468, in run_frappe_cmd
    raise CommandFailedError(args)
bench.utils.CommandFailedError: ('--site', 'meeting.dev', 'backup')

its ok no need to panic…

is this a develop server or production or test?

yeah, it’s a develop server

but have to know how it works, in case need to deploy in production

does issue like this always happen?

you have to understand that there is 4 modes of using ERPnext not only 2…

Beta: Develop and Production: mostly full of bugs :smiley: but offer many things to try and heads up always.

Stable: Develop and production: mostly stable, minimal errors and not much headache if you know your way around the server configuration, but its not necessarily buggy.

which script did you use to install?

i used this as recommended by someone here

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

any help?

any assistance? :frowning: