Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[patch][fix] handle enqueuing while deleting document when redis is not connected #2988

Closed

Conversation

saurabh6790
Copy link
Member

Executing frappe.patches.v8_0.deprecate_integration_broker in testuser10.erpnext.dev (8998a47e72a8f27a)
Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/Users/saurabh/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 79, in <module>
    main()
  File "/Users/saurabh/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 16, in main
    click.Group(commands=commands)(prog_name='bench')
  File "/Users/saurabh/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 700, in __call__
    return self.main(*args, **kwargs)
  File "/Users/saurabh/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 680, in main
    rv = self.invoke(ctx)
  File "/Users/saurabh/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 1027, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/saurabh/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 1027, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/saurabh/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 873, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/saurabh/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 508, in invoke
    return callback(*args, **kwargs)
  File "/Users/saurabh/frappe-bench/env/lib/python2.7/site-packages/click/decorators.py", line 16, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/Users/saurabh/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 24, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/Users/saurabh/frappe-bench/apps/frappe/frappe/commands/site.py", line 210, in migrate
    migrate(context.verbose, rebuild_website=rebuild_website)
  File "/Users/saurabh/frappe-bench/apps/frappe/frappe/migrate.py", line 31, in migrate
    frappe.modules.patch_handler.run_all()
  File "/Users/saurabh/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 29, in run_all
    if not run_single(patchmodule = patch):
  File "/Users/saurabh/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 63, in run_single
    return execute_patch(patchmodule, method, methodargs)
  File "/Users/saurabh/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 83, in execute_patch
    frappe.get_attr(patchmodule.split()[0] + ".execute")()
  File "/Users/saurabh/frappe-bench/apps/frappe/frappe/patches/v8_0/deprecate_integration_broker.py", line 18, in execute
    frappe.delete_doc("Module Def", "Integration Broker")
  File "/Users/saurabh/frappe-bench/apps/frappe/frappe/__init__.py", line 641, in delete_doc
    ignore_permissions, flags)
  File "/Users/saurabh/frappe-bench/apps/frappe/frappe/model/delete_doc.py", line 75, in delete_doc
    doc.run_method('on_change')
  File "/Users/saurabh/frappe-bench/apps/frappe/frappe/model/document.py", line 667, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "/Users/saurabh/frappe-bench/apps/frappe/frappe/model/document.py", line 890, in composer
    return composed(self, method, *args, **kwargs)
  File "/Users/saurabh/frappe-bench/apps/frappe/frappe/model/document.py", line 875, in runner
    add_to_return_value(self, f(self, method, *args, **kwargs))
  File "/Users/saurabh/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 "/Users/saurabh/frappe-bench/apps/frappe/frappe/__init__.py", line 1298, in enqueue
    return frappe.utils.background_jobs.enqueue(*args, **kwargs)
  File "/Users/saurabh/frappe-bench/apps/frappe/frappe/utils/background_jobs.py", line 46, in enqueue
    "kwargs": kwargs
  File "/Users/saurabh/frappe-bench/env/lib/python2.7/site-packages/rq/queue.py", line 216, in enqueue_call
    job = self.enqueue_job(job, at_front=at_front)
  File "/Users/saurabh/frappe-bench/env/lib/python2.7/site-packages/rq/queue.py", line 282, in enqueue_job
    pipe.execute()
  File "/Users/saurabh/frappe-bench/env/lib/python2.7/site-packages/redis/client.py", line 2593, in execute
    return execute(conn, stack, raise_on_error)
  File "/Users/saurabh/frappe-bench/env/lib/python2.7/site-packages/redis/client.py", line 2447, in _execute_transaction
    connection.send_packed_command(all_cmds)
  File "/Users/saurabh/frappe-bench/env/lib/python2.7/site-packages/redis/connection.py", line 532, in send_packed_command
    self.connect()
  File "/Users/saurabh/frappe-bench/env/lib/python2.7/site-packages/redis/connection.py", line 436, in connect
    raise ConnectionError(self._error_message(e))
redis.exceptions.ConnectionError: Error 61 connecting to localhost:6379. Connection refused.

@rmehta
Copy link
Member

rmehta commented Apr 6, 2017

@saurabh6790 why would you ever trigger feedback on delete???

rmehta added a commit to rmehta/frappe that referenced this pull request Apr 6, 2017
@rmehta
Copy link
Member

rmehta commented Apr 6, 2017

#3027

@rmehta rmehta closed this Apr 6, 2017
rmehta added a commit that referenced this pull request Apr 7, 2017
ankush added a commit to ankush/frappe that referenced this pull request Aug 26, 2022
This was added a long time ago to handle missing redis during migrate.
It is not the case right now as redis HAS to be availabe during
migration.

ref: frappe#2988
ankush added a commit that referenced this pull request Aug 26, 2022
* perf: rebuild website search index in background

* refactor: allow enqueueing jobs during migrate

This was added a long time ago to handle missing redis during migrate.
It is not the case right now as redis HAS to be availabe during
migration.

ref: #2988

* ci: pass correct build type

* chore: warn about redis unavailability
mergify bot pushed a commit that referenced this pull request Mar 14, 2023
* perf: rebuild website search index in background

* refactor: allow enqueueing jobs during migrate

This was added a long time ago to handle missing redis during migrate.
It is not the case right now as redis HAS to be availabe during
migration.

ref: #2988

* ci: pass correct build type

* chore: warn about redis unavailability

(cherry picked from commit fbee80f)

# Conflicts:
#	.github/workflows/ui-tests.yml
#	frappe/utils/background_jobs.py
ankush added a commit that referenced this pull request Mar 14, 2023
…20335)

* perf: rebuild website search index in background (#17974)

* perf: rebuild website search index in background

* refactor: allow enqueueing jobs during migrate

This was added a long time ago to handle missing redis during migrate.
It is not the case right now as redis HAS to be availabe during
migration.

ref: #2988

* ci: pass correct build type

* chore: warn about redis unavailability

(cherry picked from commit fbee80f)

# Conflicts:
#	.github/workflows/ui-tests.yml
#	frappe/utils/background_jobs.py

* chore: conflicts

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants