frappe / hrms

Open Source HR and Payroll Software
https://frappe.io/hr
GNU General Public License v3.0
1.25k stars 651 forks source link

Redis connection error #1363

Open BrightBawa opened 7 months ago

BrightBawa commented 7 months ago

Information about bug

Error 61 connecting to 127.0.0.1:11000. Connection refused.

Module

HR

Version

erpnext 15.7.0 frappe 15.3.0 hrms 16.0.0-dev

Installation method

manual install

Relevant log output / Stack trace / Full Error Message.

Please make sure that Redis Queue runs @ redis://127.0.0.1:11000
Please make sure that Redis Queue runs @ redis://127.0.0.1:11000
Please make sure that Redis Queue runs @ redis://127.0.0.1:11000
Please make sure that Redis Queue runs @ redis://127.0.0.1:11000
Please make sure that Redis Queue runs @ redis://127.0.0.1:11000
Traceback (most recent call last):
  File "/Users/stunna4g/erpnext/frappe-bench/env/lib/python3.11/site-packages/redis/connection.py", line 699, in connect
    sock = self.retry.call_with_retry(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/stunna4g/erpnext/frappe-bench/env/lib/python3.11/site-packages/redis/retry.py", line 46, in call_with_retry
    return do()
           ^^^^
  File "/Users/stunna4g/erpnext/frappe-bench/env/lib/python3.11/site-packages/redis/connection.py", line 700, in <lambda>
    lambda: self._connect(), lambda error: self.disconnect(error)
            ^^^^^^^^^^^^^^^
  File "/Users/stunna4g/erpnext/frappe-bench/env/lib/python3.11/site-packages/redis/connection.py", line 1002, in _connect
    raise err
  File "/Users/stunna4g/erpnext/frappe-bench/env/lib/python3.11/site-packages/redis/connection.py", line 990, in _connect
    sock.connect(socket_address)
ConnectionRefusedError: [Errno 61] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/Users/stunna4g/erpnext/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 114, in <module>
    main()
  File "/Users/stunna4g/erpnext/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 20, in main
    click.Group(commands=commands)(prog_name="bench")
  File "/Users/stunna4g/erpnext/frappe-bench/env/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/stunna4g/erpnext/frappe-bench/env/lib/python3.11/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/Users/stunna4g/erpnext/frappe-bench/env/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/stunna4g/erpnext/frappe-bench/env/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/stunna4g/erpnext/frappe-bench/env/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/stunna4g/erpnext/frappe-bench/env/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/stunna4g/erpnext/frappe-bench/env/lib/python3.11/site-packages/click/decorators.py", line 33, in new_func
    return f(get_current_context(), *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/stunna4g/erpnext/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 29, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/stunna4g/erpnext/frappe-bench/apps/frappe/frappe/commands/site.py", line 851, in uninstall
    remove_app(app_name=app, dry_run=dry_run, yes=yes, no_backup=no_backup, force=force)
  File "/Users/stunna4g/erpnext/frappe-bench/apps/frappe/frappe/installer.py", line 383, in remove_app
    drop_doctypes = _delete_modules(modules, dry_run=dry_run)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/stunna4g/erpnext/frappe-bench/apps/frappe/frappe/installer.py", line 424, in _delete_modules
    _delete_linked_documents(module_name, doctype_link_field_map, dry_run=dry_run)
  File "/Users/stunna4g/erpnext/frappe-bench/apps/frappe/frappe/installer.py", line 442, in _delete_linked_documents
    frappe.delete_doc(doctype, record, ignore_on_trash=True, force=True)
  File "/Users/stunna4g/erpnext/frappe-bench/apps/frappe/frappe/__init__.py", line 1331, in delete_doc
    return frappe.model.delete_doc.delete_doc(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/stunna4g/erpnext/frappe-bench/apps/frappe/frappe/model/delete_doc.py", line 131, in delete_doc
    frappe.enqueue(
  File "/Users/stunna4g/erpnext/frappe-bench/apps/frappe/frappe/__init__.py", line 2222, in enqueue
    return frappe.utils.background_jobs.enqueue(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/stunna4g/erpnext/frappe-bench/apps/frappe/frappe/utils/background_jobs.py", line 121, in enqueue
    q = get_queue(queue, is_async=is_async)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/stunna4g/erpnext/frappe-bench/apps/frappe/frappe/utils/background_jobs.py", line 418, in get_queue
    return Queue(generate_qname(qtype), connection=get_redis_conn(), is_async=is_async)
                                                   ^^^^^^^^^^^^^^^^
  File "/Users/stunna4g/erpnext/frappe-bench/env/lib/python3.11/site-packages/tenacity/__init__.py", line 289, in wrapped_f
    return self(f, *args, **kw)
           ^^^^^^^^^^^^^^^^^^^^
  File "/Users/stunna4g/erpnext/frappe-bench/env/lib/python3.11/site-packages/tenacity/__init__.py", line 379, in __call__
    do = self.iter(retry_state=retry_state)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/stunna4g/erpnext/frappe-bench/env/lib/python3.11/site-packages/tenacity/__init__.py", line 325, in iter
    raise retry_exc.reraise()
          ^^^^^^^^^^^^^^^^^^^
  File "/Users/stunna4g/erpnext/frappe-bench/env/lib/python3.11/site-packages/tenacity/__init__.py", line 158, in reraise
    raise self.last_attempt.result()
          ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/stunna4g/.pyenv/versions/3.11.6/lib/python3.11/concurrent/futures/_base.py", line 449, in result
    return self.__get_result()
           ^^^^^^^^^^^^^^^^^^^
  File "/Users/stunna4g/.pyenv/versions/3.11.6/lib/python3.11/concurrent/futures/_base.py", line 401, in __get_result
    raise self._exception
  File "/Users/stunna4g/erpnext/frappe-bench/env/lib/python3.11/site-packages/tenacity/__init__.py", line 382, in __call__
    result = fn(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^
  File "/Users/stunna4g/erpnext/frappe-bench/apps/frappe/frappe/utils/background_jobs.py", line 459, in get_redis_conn
    return get_redis_connection_without_auth()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/stunna4g/erpnext/frappe-bench/apps/frappe/frappe/utils/background_jobs.py", line 478, in get_redis_connection_without_auth
    _redis_queue_conn = RedisQueue.get_connection()
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/stunna4g/erpnext/frappe-bench/apps/frappe/frappe/utils/redis_queue.py", line 21, in get_connection
    conn.ping()
  File "/Users/stunna4g/erpnext/frappe-bench/env/lib/python3.11/site-packages/redis/commands/core.py", line 1205, in ping
    return self.execute_command("PING", **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/stunna4g/erpnext/frappe-bench/env/lib/python3.11/site-packages/redis/client.py", line 1266, in execute_command
    conn = self.connection or pool.get_connection(command_name, **options)
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/stunna4g/erpnext/frappe-bench/env/lib/python3.11/site-packages/redis/connection.py", line 1457, in get_connection
    connection.connect()
  File "/Users/stunna4g/erpnext/frappe-bench/env/lib/python3.11/site-packages/redis/connection.py", line 705, in connect
    raise ConnectionError(self._error_message(e))
redis.exceptions.ConnectionError: Error 61 connecting to 127.0.0.1:11000. Connection refused.

Code of Conduct

ruchamahabal commented 7 months ago

Make sure your bench is running?

on local: bench start

on prod: supervisorctl status

Also please use the same version for hrms (v15) with frappe & erpnext v15. 16 isn't compatible https://github.com/frappe/hrms/wiki/Changes-to-branching-and-versioning

barredterra commented 1 month ago

Most other apps are installable without bench running, so I feel like this is a valid bug. We also ran into this issue during @nikkothari22's live training last week.