Getting Redis Queue error when installing/uninstalling the erpnext on site

bench --site syraerpnext.com uninstall-app erpnext
Uninstalling App erpnext from Site syraerpnext.com
All doctypes (including custom), modules related to this app will be deleted. Are you sure you want to continue? [y/N]: y
Backing up…
Deleting Module ‘Subcontracting’

  • removing DocType ‘Subcontracting Receipt’…
  • removing DocType ‘Subcontracting Receipt Supplied Item’…
  • removing DocType ‘Subcontracting Receipt Item’…
  • removing DocType ‘Subcontracting Order Item’…
  • removing DocType ‘Subcontracting Order Supplied Item’…
  • removing DocType ‘Subcontracting Order Service Item’…
  • removing DocType ‘Subcontracting Order’…
  • removing DocType ‘Subcontracting BOM’…
  • removing Module Def ‘Subcontracting’…
    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 “/home/erp/frappe-bench/env/lib/python3.11/site-packages/redis/connection.py”, line 699, in connect
    sock = self.retry.call_with_retry(
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File “/home/erp/frappe-bench/env/lib/python3.11/site-packages/redis/retry.py”, line 46, in call_with_retry
    return do()
    ^^^^
    File “/home/erp/frappe-bench/env/lib/python3.11/site-packages/redis/connection.py”, line 700, in
    lambda: self._connect(), lambda error: self.disconnect(error)
    ^^^^^^^^^^^^^^^
    File “/home/erp/frappe-bench/env/lib/python3.11/site-packages/redis/connection.py”, line 1002, in _connect
    raise err
    File “/home/erp/frappe-bench/env/lib/python3.11/site-packages/redis/connection.py”, line 990, in _connect
    sock.connect(socket_address)
    ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “”, line 198, in _run_module_as_main
File “”, line 88, in _run_code
File “/home/erp/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 114, in
main()
File “/home/erp/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 20, in main
click.Group(commands=commands)(prog_name=“bench”)
File “/home/erp/frappe-bench/env/lib/python3.11/site-packages/click/core.py”, line 1157, in call
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/erp/frappe-bench/env/lib/python3.11/site-packages/click/core.py”, line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File “/home/erp/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 “/home/erp/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 “/home/erp/frappe-bench/env/lib/python3.11/site-packages/click/core.py”, line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/erp/frappe-bench/env/lib/python3.11/site-packages/click/core.py”, line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/erp/frappe-bench/env/lib/python3.11/site-packages/click/decorators.py”, line 33, in new_func
return f(get_current_context(), *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/erp/frappe-bench/apps/frappe/frappe/commands/init.py”, line 29, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/erp/frappe-bench/apps/frappe/frappe/commands/site.py”, line 981, in uninstall
remove_app(app_name=app, dry_run=dry_run, yes=yes, no_backup=no_backup, force=force)
File “/home/erp/frappe-bench/apps/frappe/frappe/installer.py”, line 388, in remove_app
drop_doctypes = _delete_modules(modules, dry_run=dry_run)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/erp/frappe-bench/apps/frappe/frappe/installer.py”, line 433, in _delete_modules
frappe.delete_doc(“Module Def”, module_name, ignore_on_trash=True, force=True)
File “/home/erp/frappe-bench/apps/frappe/frappe/init.py”, line 1324, in delete_doc
return frappe.model.delete_doc.delete_doc(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/erp/frappe-bench/apps/frappe/frappe/model/delete_doc.py”, line 131, in delete_doc
frappe.enqueue(
File “/home/erp/frappe-bench/apps/frappe/frappe/init.py”, line 2212, in enqueue
return frappe.utils.background_jobs.enqueue(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/erp/frappe-bench/apps/frappe/frappe/utils/background_jobs.py”, line 121, in enqueue
q = get_queue(queue, is_async=is_async)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/erp/frappe-bench/apps/frappe/frappe/utils/background_jobs.py”, line 461, in get_queue
return Queue(generate_qname(qtype), connection=get_redis_conn(), is_async=is_async)
^^^^^^^^^^^^^^^^
File “/home/erp/frappe-bench/env/lib/python3.11/site-packages/tenacity/init.py”, line 289, in wrapped_f
return self(f, *args, **kw)
^^^^^^^^^^^^^^^^^^^^
File “/home/erp/frappe-bench/env/lib/python3.11/site-packages/tenacity/init.py”, line 379, in call
do = self.iter(retry_state=retry_state)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/erp/frappe-bench/env/lib/python3.11/site-packages/tenacity/init.py”, line 325, in iter
raise retry_exc.reraise()
^^^^^^^^^^^^^^^^^^^
File “/home/erp/frappe-bench/env/lib/python3.11/site-packages/tenacity/init.py”, line 158, in reraise
raise self.last_attempt.result()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3.11/concurrent/futures/_base.py”, line 449, in result
return self.__get_result()
^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3.11/concurrent/futures/_base.py”, line 401, in __get_result
raise self._exception
File “/home/erp/frappe-bench/env/lib/python3.11/site-packages/tenacity/init.py”, line 382, in call
result = fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File “/home/erp/frappe-bench/apps/frappe/frappe/utils/background_jobs.py”, line 502, in get_redis_conn
return get_redis_connection_without_auth()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/erp/frappe-bench/apps/frappe/frappe/utils/background_jobs.py”, line 521, in get_redis_connection_without_auth
_redis_queue_conn = RedisQueue.get_connection()
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/erp/frappe-bench/apps/frappe/frappe/utils/redis_queue.py”, line 21, in get_connection
conn.ping()
File “/home/erp/frappe-bench/env/lib/python3.11/site-packages/redis/commands/core.py”, line 1205, in ping
return self.execute_command(“PING”, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/erp/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 “/home/erp/frappe-bench/env/lib/python3.11/site-packages/redis/connection.py”, line 1457, in get_connection
connection.connect()
File “/home/erp/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 111 connecting to 127.0.0.1:11000. Connection refused.

Tried checking in common sites config everything is correct
image
What Might Be the issue can Anyone please help to solve this

Hi,

Try redis-cli INFO to make sure redis is running, then bench setup redis and see what that returns. Were there any redis problems before uninstalling the app?

@Mohammed_Anas1 I think bench is stopped thats why this issue is coming…Try uninstalling by running bench in another tab

erp@ip-235-63-1-190:~/frappe-bench$ redis-cli
127.0.0.1:6379>
erp@ip-235-63-1-190:~/frappe-bench$ redis-cli info

Server

redis_version:6.0.16
redis_git_sha1:00000000
redis_git_dirty:0
redis_build_id:a3fdef44459b3ad6
redis_mode:standalone
os:Linux 6.2.0-1017-aws x86_64
arch_bits:64
multiplexing_api:epoll
atomicvar_api:atomic-builtin
gcc_version:11.2.0
process_id:400
run_id:bf676357a45839b81b617ed8f9044227eb65003d
tcp_port:6379
uptime_in_seconds:2454
uptime_in_days:0
hz:10
configured_hz:10
lru_clock:13136775
executable:/usr/bin/redis-server
config_file:/etc/redis/redis.conf
io_threads_active:0

Clients

connected_clients:1
client_recent_max_input_buffer:8
client_recent_max_output_buffer:0
blocked_clients:0
tracking_clients:0
clients_in_timeout_table:0

Memory

used_memory:873184
used_memory_human:852.72K
used_memory_rss:7077888
used_memory_rss_human:6.75M
used_memory_peak:933728
used_memory_peak_human:911.84K
used_memory_peak_perc:93.52%
used_memory_overhead:809688
used_memory_startup:809688
used_memory_dataset:63496
used_memory_dataset_perc:100.00%
allocator_allocated:1272432
allocator_active:1585152
allocator_resident:4231168
total_system_memory:2014748672
total_system_memory_human:1.88G
used_memory_lua:41984
used_memory_lua_human:41.00K
used_memory_scripts:0
used_memory_scripts_human:0B
number_of_cached_scripts:0
maxmemory:0
maxmemory_human:0B
maxmemory_policy:noeviction
allocator_frag_ratio:1.25
allocator_frag_bytes:312720
allocator_rss_ratio:2.67
allocator_rss_bytes:2646016
rss_overhead_ratio:1.67
rss_overhead_bytes:2846720
mem_fragmentation_ratio:8.74
mem_fragmentation_bytes:6268176
mem_not_counted_for_evict:0
mem_replication_backlog:0
mem_clients_slaves:0
mem_clients_normal:0
mem_aof_buffer:0
mem_allocator:jemalloc-5.2.1
active_defrag_running:0
lazyfree_pending_objects:0

Persistence

loading:0
rdb_changes_since_last_save:0
rdb_bgsave_in_progress:0
rdb_last_save_time:1724410353
rdb_last_bgsave_status:ok
rdb_last_bgsave_time_sec:-1
rdb_current_bgsave_time_sec:-1
rdb_last_cow_size:0
aof_enabled:0
aof_rewrite_in_progress:0
aof_rewrite_scheduled:0
aof_last_rewrite_time_sec:-1
aof_current_rewrite_time_sec:-1
aof_last_bgrewrite_status:ok
aof_last_write_status:ok
aof_last_cow_size:0
module_fork_in_progress:0
module_fork_last_cow_size:0

Stats

total_connections_received:5
total_commands_processed:4
instantaneous_ops_per_sec:0
total_net_input_bytes:87
total_net_output_bytes:44553
instantaneous_input_kbps:0.00
instantaneous_output_kbps:0.00
rejected_connections:0
sync_full:0
sync_partial_ok:0
sync_partial_err:0
expired_keys:0
expired_stale_perc:0.00
expired_time_cap_reached_count:0
expire_cycle_cpu_milliseconds:44
evicted_keys:0
keyspace_hits:0
keyspace_misses:0
pubsub_channels:0
pubsub_patterns:0
latest_fork_usec:0
migrate_cached_sockets:0
slave_expires_tracked_keys:0
active_defrag_hits:0
active_defrag_misses:0
active_defrag_key_hits:0
active_defrag_key_misses:0
tracking_total_keys:0
tracking_total_items:0
tracking_total_prefixes:0
unexpected_error_replies:0
total_reads_processed:10
total_writes_processed:5
io_threaded_reads_processed:0
io_threaded_writes_processed:0

Replication

role:master
connected_slaves:0
master_replid:22acc9c142b5880d8b14aeabfb21a3cc7cf48f00
master_replid2:0000000000000000000000000000000000000000
master_repl_offset:0
second_repl_offset:-1
repl_backlog_active:0
repl_backlog_size:1048576
repl_backlog_first_byte_offset:0
repl_backlog_histlen:0

CPU

used_cpu_sys:1.756890
used_cpu_user:1.986605
used_cpu_sys_children:0.000000
used_cpu_user_children:0.000000

Modules

Cluster

cluster_enabled:0

Keyspace

erp@ip-235-63-1-190:~/frappe-bench$
erp@ip-235-63-1-190:~/frappe-bench$ bench setup redis
erp@ip-235-63-1-190:~/frappe-bench$