Redis Error 111 connecting to localhost:11002. Connection refused

Full trace while installing erpnext v12

xyz_user@ubuntu-erpnext-0087:~/frappe-bench$ bench new-site site1.local
MySQL root password:

Installing frappe…
Updating DocTypes for frappe : [========================================]
Traceback (most recent call last):
File “/home/xyz_user/frappe-bench/env/lib/python3.6/site-packages/redis/connection.py”, line 484, in connect
sock = self._connect()
File “/home/xyz_user/frappe-bench/env/lib/python3.6/site-packages/redis/connection.py”, line 541, in _connect
raise err
File “/home/xyz_user/frappe-bench/env/lib/python3.6/site-packages/redis/connection.py”, line 529, 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 “/home/xyz_user/frappe-bench/env/lib/python3.6/site-packages/redis/client.py”, line 2879, in execute
return execute(conn, stack, raise_on_error)
File “/home/xyz_user/frappe-bench/env/lib/python3.6/site-packages/redis/client.py”, line 2749, in _execute_transaction
connection.send_packed_command(all_cmds)
File “/home/xyz_user/frappe-bench/env/lib/python3.6/site-packages/redis/connection.py”, line 585, in send_packed_command
self.connect()
File “/home/xyz_user/frappe-bench/env/lib/python3.6/site-packages/redis/connection.py”, line 489, in connect
raise ConnectionError(self._error_message(e))
redis.exceptions.ConnectionError: Error 111 connecting to localhost:11002. Connection refused.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/home/xyz_user/frappe-bench/env/lib/python3.6/site-packages/redis/connection.py”, line 484, in connect
sock = self._connect()
File “/home/xyz_user/frappe-bench/env/lib/python3.6/site-packages/redis/connection.py”, line 541, in _connect
raise err
File “/home/xyz_user/frappe-bench/env/lib/python3.6/site-packages/redis/connection.py”, line 529, 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 “/usr/lib/python3.6/runpy.py”, line 193, in _run_module_as_main
main”, mod_spec)
File “/usr/lib/python3.6/runpy.py”, line 85, in _run_code
exec(code, run_globals)
File “/home/xyz_user/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 97, in
main()
File “/home/xyz_user/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 18, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/xyz_user/frappe-bench/env/lib/python3.6/site-packages/click/core.py”, line 764, in call
return self.main(*args, **kwargs)
File “/home/xyz_user/frappe-bench/env/lib/python3.6/site-packages/click/core.py”, line 717, in main
rv = self.invoke(ctx)
File “/home/xyz_user/frappe-bench/env/lib/python3.6/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/xyz_user/frappe-bench/env/lib/python3.6/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/xyz_user/frappe-bench/env/lib/python3.6/site-packages/click/core.py”, line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/xyz_user/frappe-bench/env/lib/python3.6/site-packages/click/core.py”, line 555, in invoke
return callback(*args, **kwargs)
File “/home/xyz_user/frappe-bench/apps/frappe/frappe/commands/site.py”, line 32, in new_site
db_type=db_type)
File “/home/xyz_user/frappe-bench/apps/frappe/frappe/commands/site.py”, line 73, in _new_site
_install_app(app, verbose=verbose, set_as_patched=not source_sql)
File “/home/xyz_user/frappe-bench/apps/frappe/frappe/installer.py”, line 92, in install_app
frappe.get_attr(after_install)()
File “/home/xyz_user/frappe-bench/apps/frappe/frappe/utils/install.py”, line 19, in after_install
install_basic_docs()
File “/home/xyz_user/frappe-bench/apps/frappe/frappe/utils/install.py”, line 77, in install_basic_docs
frappe.get_doc(d).insert()
File “/home/xyz_user/frappe-bench/apps/frappe/frappe/model/document.py”, line 259, in insert
self.run_post_save_methods()
File “/home/xyz_user/frappe-bench/apps/frappe/frappe/model/document.py”, line 919, in run_post_save_methods
self.run_method(“on_update”)
File “/home/xyz_user/frappe-bench/apps/frappe/frappe/model/document.py”, line 787, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/xyz_user/frappe-bench/apps/frappe/frappe/model/document.py”, line 1058, in composer
return composed(self, method, *args, **kwargs)
File “/home/xyz_user/frappe-bench/apps/frappe/frappe/model/document.py”, line 1041, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/xyz_user/frappe-bench/apps/frappe/frappe/model/document.py”, line 781, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/xyz_user/frappe-bench/apps/frappe/frappe/core/doctype/user/user.py”, line 93, in on_update
self.share_with_self()
File “/home/xyz_user/frappe-bench/apps/frappe/frappe/core/doctype/user/user.py”, line 177, in share_with_self
flags={“ignore_share_permission”: True})
File “/home/xyz_user/frappe-bench/apps/frappe/frappe/share.py”, line 45, in add
notify_assignment(user, doctype, name, everyone)
File “/home/xyz_user/frappe-bench/apps/frappe/frappe/share.py”, line 170, in notify_assignment
enqueue_create_notification(shared_by, notification_doc)
File “/home/xyz_user/frappe-bench/apps/frappe/frappe/desk/doctype/notification_log/notification_log.py”, line 38, in enqueue_create_notification
now=frappe.flags.in_test
File “/home/xyz_user/frappe-bench/apps/frappe/frappe/init.py”, line 1475, in enqueue
return frappe.utils.background_jobs.enqueue(*args, **kwargs)
File “/home/xyz_user/frappe-bench/apps/frappe/frappe/utils/background_jobs.py”, line 69, in enqueue
kwargs=queue_args)
File “/home/xyz_user/frappe-bench/env/lib/python3.6/site-packages/rq/queue.py”, line 258, in enqueue_call
job = self.enqueue_job(job, at_front=at_front)
File “/home/xyz_user/frappe-bench/env/lib/python3.6/site-packages/rq/queue.py”, line 331, in enqueue_job
pipe.execute()
File “/home/xyz_user/frappe-bench/env/lib/python3.6/site-packages/redis/client.py”, line 2894, in execute
return execute(conn, stack, raise_on_error)
File “/home/xyz_user/frappe-bench/env/lib/python3.6/site-packages/redis/client.py”, line 2749, in _execute_transaction
connection.send_packed_command(all_cmds)
File “/home/xyz_user/frappe-bench/env/lib/python3.6/site-packages/redis/connection.py”, line 585, in send_packed_command
self.connect()
File “/home/xyz_user/frappe-bench/env/lib/python3.6/site-packages/redis/connection.py”, line 489, in connect
raise ConnectionError(self._error_message(e))
redis.exceptions.ConnectionError: Error 111 connecting to localhost:11002. Connection refused.

Any help here?
Spent almost two days,
Uninstalled, Installed Mariadb.
Uninstalled, Installed redis server.

i am attaching complete trace
erpnext v12 is being used.

Thanks in advance.

Redis is not running. Start it.

sudo service redis start

1 Like

i have this issue whole week … the soluation is delete frappe app install it with tag v12.0.15
it will work after reinstall site and migrate restart
this is for fresh installtion

1 Like

Same here. How can I change the frappe app with tag v12.0.15, @ahmadRagheb?