Unable to log in after bench update

I did a bench update on our stable version of bench, rapper, erpnext.
That said, it seems like I cannot login into our ERP anymore. I’m always having this issue:

Traceback (innermost last):
  File "/home/franky1/frappe-bench/apps/frappe/frappe/website/render.py", line 25, in render
    data = render_page_by_language(path)
  File "/home/franky1/frappe-bench/apps/frappe/frappe/website/render.py", line 91, in render_page_by_language
    return render_page(path)
  File "/home/franky1/frappe-bench/apps/frappe/frappe/website/render.py", line 107, in render_page
    return build(path)
  File "/home/franky1/frappe-bench/apps/frappe/frappe/website/render.py", line 114, in build
    return build_page(path)
  File "/home/franky1/frappe-bench/apps/frappe/frappe/website/render.py", line 127, in build_page
    context = get_context(path)
  File "/home/franky1/frappe-bench/apps/frappe/frappe/website/context.py", line 16, in get_context
    context = build_context(context)
  File "/home/franky1/frappe-bench/apps/frappe/frappe/website/context.py", line 58, in build_context
    ret = module.get_context(context)
  File "/home/franky1/frappe-bench/apps/frappe/frappe/templates/pages/desk.py", line 21, in get_context
    boot = frappe.sessions.get()
  File "/home/franky1/frappe-bench/apps/frappe/frappe/sessions.py", line 106, in get
    bootinfo = get_bootinfo()
  File "/home/franky1/frappe-bench/apps/frappe/frappe/boot.py", line 58, in get_bootinfo
    frappe.get_attr(method)(bootinfo)
  File "/home/franky1/frappe-bench/apps/frappe/frappe/__init__.py", line 789, in get_attr
    return getattr(get_module(modulename), methodname)
  File "/home/franky1/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)
  File "/home/franky1/frappe-bench/apps/jasper_erpnext_report/jasper_erpnext_report/core/JasperWhitelist.py", line 13, in <module>
    import JasperRoot as Jr
  File "/home/franky1/frappe-bench/apps/jasper_erpnext_report/jasper_erpnext_report/core/JasperRoot.py", line 11, in <module>
    import JasperServer as Js, JasperLocal as Jl, JasperBase as Jb
  File "/home/franky1/frappe-bench/apps/jasper_erpnext_report/jasper_erpnext_report/core/JasperServer.py", line 30, in <module>
    import JasperBase as Jb
  File "/home/franky1/frappe-bench/apps/jasper_erpnext_report/jasper_erpnext_report/core/JasperBase.py", line 14, in <module>
    _logger = frappe.logger("jasper_erpnext_report")
 TypeError: 'NoneType' object is not callable

I need to solve this soon. Also how can I remove the Jasper app? Thanks for your help.

You can try either bench remove-from-installed-apps [app-name]¹, which will remove the app name from the list or bench uninstall-app [app-name]², which will delete app and everything related to it.


¹ ² https://frappe.github.io/frappe/user/en/bench/resources/bench-commands-cheatsheet.html

Both are raising error.

franky1@Capfresh:~/frappe-bench$ bench remove-from-installed-apps jasper_erpnext_report
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/franky1/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 79, in
main()
File “/home/franky1/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 16, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/franky1/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 700, in call
return self.main(*args, **kwargs)
File “/home/franky1/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 680, in main
rv = self.invoke(ctx)
File “/home/franky1/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1027, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/franky1/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1027, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/franky1/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 873, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/franky1/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 508, in invoke
return callback(*args, **kwargs)
File “/home/franky1/frappe-bench/env/local/lib/python2.7/site-packages/click/decorators.py”, line 16, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/franky1/frappe-bench/apps/frappe/frappe/commands.py”, line 29, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/franky1/frappe-bench/apps/frappe/frappe/commands.py”, line 914, in remove_from_installed_apps
frappe.init(site=site)
File “/home/franky1/frappe-bench/apps/frappe/frappe/init.py”, line 121, in init
local.conf = _dict(get_site_config())
File “/home/franky1/frappe-bench/apps/frappe/frappe/init.py”, line 175, in get_site_config
raise IncorrectSitePath, “{0} does not exist”.format(site_config)
frappe.exceptions.IncorrectSitePath: 404: Not Found
franky1@Capfresh:~/frappe-bench$

franky1@Capfresh:~/frappe-bench$ bench uninstall-app jasper_erpnext_report
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/franky1/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 79, in
main()
File “/home/franky1/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 16, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/franky1/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 700, in call
return self.main(*args, **kwargs)
File “/home/franky1/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 680, in main
rv = self.invoke(ctx)
File “/home/franky1/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1027, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/franky1/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1027, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/franky1/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 873, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/franky1/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 508, in invoke
return callback(*args, **kwargs)
File “/home/franky1/frappe-bench/env/local/lib/python2.7/site-packages/click/decorators.py”, line 16, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/franky1/frappe-bench/apps/frappe/frappe/commands.py”, line 29, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/franky1/frappe-bench/apps/frappe/frappe/commands.py”, line 928, in uninstall
frappe.init(site=site)
File “/home/franky1/frappe-bench/apps/frappe/frappe/init.py”, line 121, in init
local.conf = _dict(get_site_config())
File “/home/franky1/frappe-bench/apps/frappe/frappe/init.py”, line 175, in get_site_config
raise IncorrectSitePath, “{0} does not exist”.format(site_config)
frappe.exceptions.IncorrectSitePath: 404: Not Found
franky1@Capfresh:~/frappe-bench$

What is strange is that the website works in many aspects. I can check the products page, the blog, etc.
I get the error as i try to log in.

Try to use previous commands with --site parameter including corresponding name of the site.


Please consider using spoiler for logs, otherwise pages are getting too long to scroll:
<details><summary>Header</summary>Log body</details>

1 Like

Thanks. It helps with the --site parameter. The jasper app is now removed and I don’t have a website at all anymore ;-(

franky1@Capfresh:~/frappe-bench$ sudo supervisorctl status
frappe-bench-redis:frappe-bench-redis-cache RUNNING pid 1525, uptime 0:03:11
frappe-bench-redis:frappe-bench-redis-queue FATAL Exited too quickly (process log may have details)
frappe-bench-redis:frappe-bench-redis-socketio RUNNING pid 1526, uptime 0:03:11
frappe-bench-web:frappe-bench-frappe-web RUNNING pid 1522, uptime 0:03:11
frappe-bench-web:frappe-bench-node-socketio RUNNING pid 1523, uptime 0:03:11
frappe-bench-workers:frappe-bench-frappe-async-worker RUNNING pid 1502, uptime 0:03:11
frappe-bench-workers:frappe-bench-frappe-longjob-worker RUNNING pid 1515, uptime 0:03:11
frappe-bench-workers:frappe-bench-frappe-worker RUNNING pid 1516, uptime 0:03:11
frappe-bench-workers:frappe-bench-frappe-workerbeat RUNNING pid 1501, uptime 0:03:11
franky1@Capfresh:~/frappe-bench$

Trying to figure out what went wrong.

It seems like I have now a nginx issue

franky1@Capfresh:~/frappe-bench$ sudo nginx -t
nginx: [emerg] duplicate upstream “frappe-bench-frappe” in /etc/nginx/conf.d/frappe.conf:2
nginx: configuration file /etc/nginx/nginx.conf test failed
franky1@Capfresh:~/frappe-bench$

Do any of these solutions help?

https://serverfault.com/questions/746378/nginx-restart-error-emerg-duplicate-upstream
https://github.com/gitlabhq/gitlabhq/issues/3198

1 Like

and just in case it helps:

franky1@Capfresh:~/frappe-bench$ sudo supervisorctl status
frappe-bench-redis:frappe-bench-redis-cache RUNNING pid 2424, uptime 0:04:28
frappe-bench-redis:frappe-bench-redis-queue FATAL Exited too quickly (process log may have details)
frappe-bench-redis:frappe-bench-redis-socketio RUNNING pid 2425, uptime 0:04:28
frappe-bench-web:frappe-bench-frappe-web RUNNING pid 2537, uptime 0:02:11
frappe-bench-web:frappe-bench-node-socketio RUNNING pid 2538, uptime 0:02:11
frappe-bench-workers:frappe-bench-frappe-async-worker RUNNING pid 2551, uptime 0:02:08
frappe-bench-workers:frappe-bench-frappe-longjob-worker RUNNING pid 2557, uptime 0:02:07
frappe-bench-workers:frappe-bench-frappe-worker RUNNING pid 2568, uptime 0:02:06
frappe-bench-workers:frappe-bench-frappe-workerbeat RUNNING pid 2563, uptime 0:02:07
franky1@Capfresh:~/frappe-bench$

There are some Redis problems too.

and yes nginx is not running, how do I start it?

franky1@Capfresh:~/frappe-bench$ service nginx status

  • nginx is not running
    franky1@Capfresh:~/frappe-bench$

service nginx restart

I did it several time and there is a weird issue there:

franky1@Capfresh:~/frappe-bench$ sudo service nginx start
franky1@Capfresh:~/frappe-bench$ service nginx status

  • nginx is not running
    franky1@Capfresh:~/frappe-bench$ sudo service nginx restart
  • Restarting nginx nginx [fail]
    franky1@Capfresh:~/frappe-bench$ service nginx status
  • nginx is not running
    franky1@Capfresh:~/frappe-bench$ sudo nginx -s reload
    nginx: [emerg] duplicate upstream “frappe-bench-frappe” in /etc/nginx/conf.d/frappe.conf:2
    franky1@Capfresh:~/frappe-bench$

Have you tried two solutions from previous post?

You have redundant nginx config

Is the following part repeated anywhere in nginx configuration files /etc/nginx/ ?

upstream frappe-bench-frappe {
    server 127.0.0.1:8000 fail_timeout=0;
}

Topic related to frappe-bench-redis-queue error [Important] Bench version 2 - see this before you run bench update

OK.
I did

unlink /etc/nginx/conf.d/frappe.conf

then I redid

bench setup production franky1

and it seems like it did the trick.

Thank you for all your help @strixaluco

1 Like