Bench Update Error / Internal Server Error

Hi ,

I was hit into the following issue when tried to update the bench.

ubuntu@ip-172-31-28-14:~/frappe-bench/apps/erpnext$ bench update
INFO:bench.utils:setting up sudoers
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 civil_contracting
    From https://github.com/revant/civil_contracting
  • branch master -> FETCH_HEAD
    Already up-to-date.
    /home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/pip/vendor/requests/packages/urllib3/util/ssl.py:315: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#snimissingwarning.
    SNIMissingWarning
    /home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/pip/vendor/requests/packages/urllib3/util/ssl.py:120: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
    InsecurePlatformWarning
    Requirement already up-to-date: pip in ./env/lib/python2.7/site-packages
    Command “python setup.py egg_info” failed with error code 1 in /tmp/pip-6c5pER-build
    Traceback (most recent call last):
    File “/usr/local/bin/bench”, line 9, in
    load_entry_point(‘bench==0.0.0’, ‘console_scripts’, ‘bench’)()
    File “/home/ubuntu/bench-repo/bench/cli.py”, line 60, in cli
    bench()
    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/ubuntu/bench-repo/bench/cli.py”, line 241, in _update
    update(pull, patch, build, bench, auto, restart_supervisor, requirements, no_backup, upgrade, force=force)
    File “/home/ubuntu/bench-repo/bench/cli.py”, line 259, in update
    update_requirements(bench=bench_path)
    File “/home/ubuntu/bench-repo/bench/utils.py”, line 363, in update_requirements
    exec_cmd("{pip} install -q -r {req_file}".format(pip=pip, req_file=req_file))
    File “/home/ubuntu/bench-repo/bench/utils.py”, line 105, in exec_cmd
    raise CommandFailedError(cmd)
    bench.utils.CommandFailedError: ./env/bin/pip install -q -r ./apps/jasper_erpnext_report/requirements.txt

and now my entire ERPNEXT site is facing Internal server error.

Can you please help ?

Thanks
Kenny

Checked the log and got this error , Can you help ?
[2016-02-20 17:11:00,138: ERROR/MainProcess] Task frappe.tasks.scheduler_task[b6312a54-2b29-48e1-86ca-bafc4011e185] raised unexpected: ImportError(‘No module named bs4’,)
Traceback (most recent call last):
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/celery/app/trace.py”, line 240, in trace_task
R = retval = fun(*args, **kwargs)
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/celery/app/trace.py”, line 438, in protected_call
return self.run(*args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/tasks.py”, line 114, in scheduler_task
traceback = log(handler, “Method: {event}, Handler: {handler}”.format(event=event, handler=handler))
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/utils/scheduler.py”, line 116, in log
d.insert(ignore_permissions=True)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 193, in insert
self.run_before_save_methods()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 602, in run_before_save_methods
self.run_method(“validate”)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 564, in run_method
return Document.hook(fn)(self, *args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 717, in composer
hooks.append(frappe.get_attr(handler))
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/init.py”, line 788, in get_attr
return getattr(get_module(modulename), methodname)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/init.py”, line 598, 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/ubuntu/frappe-bench/apps/frappe/frappe/email/init.py”, line 7, in
from frappe.email.email_body import get_email
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/email/email_body.py”, line 6, in
from frappe.utils.pdf import get_pdf
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/utils/pdf.py”, line 8, in
from bs4 import BeautifulSoup
ImportError: No module named bs4

You delete jasper_erpnext_report module in the wrong way.
Try to remove it from file frappe-bench/sites/apps.txt.

OR

bench remove-from-installed-apps jasper_erpnext_report
If will that do not solve your problem then try bench uninstall-app jasper_erpnext_report

Thanks ,

There is no “jasper” in apps.txt , and i have ran the bench remove command . it seems to be nor working as well

i am checking with my colleague if that can be removed . Will let u know once i am allow to do so.

Hi @Mohamed_Sajid

I have perform the following script , but it seems like the bench couldnt find this module to delete

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/ubuntu/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, lin e 79, in
main()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, lin e 16, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/co re.py”, line 716, in call
return self.main(*args, **kwargs)
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/co re.py”, line 696, in main
rv = self.invoke(ctx)
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/co re.py”, line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/co re.py”, line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/co re.py”, line 889, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/co re.py”, line 534, in invoke
return callback(*args, **kwargs)
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/de corators.py”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/commands.py”, line 29, in _ func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/commands.py”, line 953, in uninstall
remove_app(app, dry_run)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/installer.py”, line 169, in remove_app
for module_name in frappe.get_module_list(app_name):
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/init.py”, line 640, in get_module_list
return get_file_items(os.path.join(os.path.dirname(get_module(app_name).fi le), “modules.txt”))
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/init.py”, line 598, 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 jasper_erpnext_report

@kennywong…try this command to remove the jasper_report…
bench uninstall-app jasper_erpnext_report

1 Like

@kennywong try removing the erpnext_jasper_reports directory in /apps

I try to remove the github link within the jasper reports requirement.txt and try a bench retry–update. My site is up again.

1 Like