Error after executing bench update

I m facing this error after executing bench update command inside frappe-bench directory.
Everything is working fine before executing this command, even i was able to run bench migrate before executing bench update command, but now i m not able to executing bench migrate command after bench update.

/home/develop/frappe-bench/bench update
/home/develop/frappe-bench/env/bin/bench
INFO:bench.utils:updating bench
Already up-to-date.
/home/develop/frappe-bench/env/bin/bench
Requirement already satisfied: Pillow in ./env/lib/python2.7/site-packages
Requirement already satisfied: olefile in ./env/lib/python2.7/site-packages (from Pillow)
INFO:bench.app:pulling frappe
From GitHub - frappe/frappe: Low code web framework for real world applications, in Python and Javascript

  • branch develop → FETCH_HEAD
    Already up-to-date.
    INFO:bench.app:pulling erpnext
    From GitHub - frappe/erpnext: Free and Open Source Enterprise Resource Planning (ERP)
  • branch develop → FETCH_HEAD
    Already up-to-date.
    INFO:bench.app:pulling erpnext_shopify
    From GitHub - frappe/erpnext_shopify: [Deprecated] Shopify connector for ERPNext
  • branch develop → FETCH_HEAD
    Already up-to-date.
    Requirement already up-to-date: pip in ./env/lib/python2.7/site-packages/pip-9.0.1-py2.7.egg
    Migrating navdeep.dev
    Executing frappe.patches.v8_0.deprecate_integration_broker in navdeep.dev (b1846533a05c5b4f)
    Traceback (most recent call last):
    File “/usr/lib/python2.7/runpy.py”, line 174, 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/develop/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 79, in
    main()
    File “/home/develop/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 16, in main
    click.Group(commands=commands)(prog_name=‘bench’)
    File “/home/develop/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 722, in call
    return self.main(*args, **kwargs)
    File “/home/develop/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 697, in main
    rv = self.invoke(ctx)
    File “/home/develop/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File “/home/develop/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File “/home/develop/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
    File “/home/develop/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 535, in invoke
    return callback(*args, **kwargs)
    File “/home/develop/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/develop/frappe-bench/apps/frappe/frappe/commands/init.py”, line 24, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
    File “/home/develop/frappe-bench/apps/frappe/frappe/commands/site.py”, line 210, in migrate
    migrate(context.verbose, rebuild_website=rebuild_website)
    File “/home/develop/frappe-bench/apps/frappe/frappe/migrate.py”, line 31, in migrate
    frappe.modules.patch_handler.run_all()
    File “/home/develop/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 29, in run_all
    if not run_single(patchmodule = patch):
    File “/home/develop/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 63, in run_single
    return execute_patch(patchmodule, method, methodargs)
    File “/home/develop/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 83, in execute_patch
    frappe.get_attr(patchmodule.split()[0] + “.execute”)()
    File “/home/develop/frappe-bench/apps/frappe/frappe/patches/v8_0/deprecate_integration_broker.py”, line 18, in execute
    frappe.delete_doc(“Module Def”, “Integration Broker”)
    File “/home/develop/frappe-bench/apps/frappe/frappe/init.py”, line 638, in delete_doc
    ignore_permissions, flags)
    File “/home/develop/frappe-bench/apps/frappe/frappe/model/delete_doc.py”, line 75, in delete_doc
    doc.run_method(‘on_change’)
    File “/home/develop/frappe-bench/apps/frappe/frappe/model/document.py”, line 667, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
    File “/home/develop/frappe-bench/apps/frappe/frappe/model/document.py”, line 888, in composer
    return composed(self, method, *args, **kwargs)
    File “/home/develop/frappe-bench/apps/frappe/frappe/model/document.py”, line 873, in runner
    add_to_return_value(self, f(self, method, *args, **kwargs))
    File “/home/develop/frappe-bench/apps/frappe/frappe/core/doctype/feedback_trigger/feedback_trigger.py”, line 32, in trigger_feedback_request
    reference_doctype=doc.doctype, reference_name=doc.name, now=frappe.flags.in_test)
    File “/home/develop/frappe-bench/apps/frappe/frappe/init.py”, line 1295, in enqueue
    return frappe.utils.background_jobs.enqueue(*args, **kwargs)
    File “/home/develop/frappe-bench/apps/frappe/frappe/utils/background_jobs.py”, line 46, in enqueue
    “kwargs”: kwargs
    File “/home/develop/frappe-bench/env/local/lib/python2.7/site-packages/rq/queue.py”, line 227, in enqueue_call
    job = self.enqueue_job(job, at_front=at_front)
    File “/home/develop/frappe-bench/env/local/lib/python2.7/site-packages/rq/queue.py”, line 298, in enqueue_job
    pipe.execute()
    File “/home/develop/frappe-bench/env/local/lib/python2.7/site-packages/redis/client.py”, line 2641, in execute
    return execute(conn, stack, raise_on_error)
    File “/home/develop/frappe-bench/env/local/lib/python2.7/site-packages/redis/client.py”, line 2495, in _execute_transaction
    connection.send_packed_command(all_cmds)
    File “/home/develop/frappe-bench/env/local/lib/python2.7/site-packages/redis/connection.py”, line 538, in send_packed_command
    self.connect()
    File “/home/develop/frappe-bench/env/local/lib/python2.7/site-packages/redis/connection.py”, line 442, in connect
    raise ConnectionError(self._error_message(e))
    redis.exceptions.ConnectionError: Error 111 connecting to localhost:11080. Connection refused.

Please assist me if i have missed something or doing wrong while executing bench update.

I’m getting the same error

Bench update failing only due to rq [Redis Queue].

Install rq [Redis Queue] using following method:
Inside frappe-bench directory execute ./env/bin/pip install rq==0.4.6
then execute same bench update command inside frappe-bench directory.

It’ll resolve your bench update problem, but you’ll face the different error while starting your bench using bench start command.

rq installed ok

but the error still happens on bench update

1 Like

Just go to /home/username/frappe-bench/apps/frappe/frappe/utils/
and open backgroud_jobs.py in your favorite editor and return the control from the enqueue function before execution of this [return q.enqueue_call …] line.
You just need to add return statement (Just return statement) before [return q.enqueue_call …] line.
Now you can run bench update

Note :
But Its not a standard way to deal with this error [Not recommend]. This method will initialize your Empty workers, and this error you’ll receive on terminal while executing bench start command.

I had exactly the same error as the poster on doing a bench update on Develop just now

Thanks for your help. doing the above did let me do a bench update successfully, but not when I try to run bench start, there is a problem with red-server again. Redis starts up fine, but shuts down gain almost as soon as it started. I had removed the additional return statement too.

The other question why did this suddenly go awry? I’m running a std VM pretty vanilla with the develop branch and I’m a little concerned that just doing a simple update can fairly easily bring the system down

1 Like

Are you on development setup?

I faced this error when I had a development bench which was not running when I did bench update.

try bench start, once the bench is started open a separate terminal emulator window do bench update

Thank you @revant_one !

Yes ! I m on Development branch.
I have already fixed this problem, It was related to Redis Queue.
What was happing when i was trying to start the bench, it was actually trying to create local connection on this : redis://localhost:11080 address.

But localhost is not valid address as there is no entry in etc/hosts file against 127.0.0.1. After putting localhost value against 127.0.0.1 IP address my bench start running successfully.

Thanks