Please make sure that Redis Queue runs @ redis://localhost:11000

bench new-site [site-name]

getting this error " Please make sure that Redis Queue runs @ redis://localhost:11000"

1 Like

I too got the same error
Here is a copy-paste of the total error.

Restoring Database file...
12.1KiB 0:00:00 [17.5MiB/s] [=============================================================================================================================================>] 100%

Installing frappe...
Updating DocTypes for frappe        : [========================================] 100%
Updating country info               : [========================================] 100%
Please make sure that Redis Queue runs @ redis://localhost:11000
Please make sure that Redis Queue runs @ redis://localhost:11000
Please make sure that Redis Queue runs @ redis://localhost:11000
Please make sure that Redis Queue runs @ redis://localhost:11000
Please make sure that Redis Queue runs @ redis://localhost:11000
Please make sure that Redis Queue runs @ redis://localhost:11000
Please make sure that Redis Queue runs @ redis://localhost:11000
Please make sure that Redis Queue runs @ redis://localhost:11000
Please make sure that Redis Queue runs @ redis://localhost:11000
Please make sure that Redis Queue runs @ redis://localhost:11000
Traceback (most recent call last):
  File "/home/our/frappe-bench/apps/frappe/frappe/model/base_document.py", line 502, in db_insert
    frappe.db.sql(
  File "/home/our/frappe-bench/apps/frappe/frappe/database/database.py", line 219, in sql
    self._cursor.execute(query, values)
  File "/home/our/frappe-bench/env/lib/python3.10/site-packages/pymysql/cursors.py", line 158, in execute
    result = self._query(query)
  File "/home/our/frappe-bench/env/lib/python3.10/site-packages/pymysql/cursors.py", line 325, in _query
    conn.query(q)
  File "/home/our/frappe-bench/env/lib/python3.10/site-packages/pymysql/connections.py", line 549, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
  File "/home/our/frappe-bench/env/lib/python3.10/site-packages/pymysql/connections.py", line 779, in _read_query_result
    result.read()
  File "/home/our/frappe-bench/env/lib/python3.10/site-packages/pymysql/connections.py", line 1157, in read
    first_packet = self.connection._read_packet()
  File "/home/our/frappe-bench/env/lib/python3.10/site-packages/pymysql/connections.py", line 729, in _read_packet
    packet.raise_for_error()
  File "/home/our/frappe-bench/env/lib/python3.10/site-packages/pymysql/protocol.py", line 221, in raise_for_error
    err.raise_mysql_exception(self._data)
  File "/home/our/frappe-bench/env/lib/python3.10/site-packages/pymysql/err.py", line 143, in raise_mysql_exception
    raise errorclass(errno, errval)
pymysql.err.IntegrityError: (1062, "Duplicate entry 'email_account.pull' for key 'PRIMARY'")

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/our/frappe-bench/apps/frappe/frappe/core/doctype/scheduled_job_type/scheduled_job_type.py", line 209, in insert_single_event
    doc.insert()
  File "/home/our/frappe-bench/apps/frappe/frappe/model/document.py", line 270, in insert
    self.db_insert(ignore_if_duplicate=ignore_if_duplicate)
  File "/home/our/frappe-bench/apps/frappe/frappe/model/base_document.py", line 529, in db_insert
    raise frappe.DuplicateEntryError(self.doctype, self.name, e)
frappe.exceptions.DuplicateEntryError: ('Scheduled Job Type', 'email_account.pull', IntegrityError(1062, "Duplicate entry 'email_account.pull' for key 'PRIMARY'"))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/our/frappe-bench/env/lib/python3.10/site-packages/redis/connection.py", line 559, in connect
    sock = self._connect()
  File "/home/our/frappe-bench/env/lib/python3.10/site-packages/redis/connection.py", line 615, in _connect
    raise err
  File "/home/our/frappe-bench/env/lib/python3.10/site-packages/redis/connection.py", line 603, 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/our/frappe-bench/env/lib/python3.10/site-packages/tenacity/__init__.py", line 407, in __call__
    result = fn(*args, **kwargs)
  File "/home/our/frappe-bench/apps/frappe/frappe/utils/background_jobs.py", line 380, in get_redis_conn
    redis_connection = RedisQueue.get_connection(**cred)
  File "/home/our/frappe-bench/apps/frappe/frappe/utils/redis_queue.py", line 24, in get_connection
    conn.ping()
  File "/home/our/frappe-bench/env/lib/python3.10/site-packages/redis/client.py", line 1378, in ping
    return self.execute_command('PING')
  File "/home/our/frappe-bench/env/lib/python3.10/site-packages/redis/client.py", line 898, in execute_command
    conn = self.connection or pool.get_connection(command_name, **options)
  File "/home/our/frappe-bench/env/lib/python3.10/site-packages/redis/connection.py", line 1192, in get_connection
    connection.connect()
  File "/home/our/frappe-bench/env/lib/python3.10/site-packages/redis/connection.py", line 563, in connect
    raise ConnectionError(self._error_message(e))
redis.exceptions.ConnectionError: Error 111 connecting to localhost:11000. Connection refused.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/our/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 109, in <module>
    main()
  File "/home/our/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 18, in main
    click.Group(commands=commands)(prog_name="bench")
  File "/home/our/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/our/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/our/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/our/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/our/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/our/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/our/frappe-bench/apps/frappe/frappe/commands/site.py", line 77, in new_site
    _new_site(
  File "/home/our/frappe-bench/apps/frappe/frappe/installer.py", line 106, in _new_site
    install_app(app, verbose=verbose, set_as_patched=not source_sql, force=False)
  File "/home/our/frappe-bench/apps/frappe/frappe/installer.py", line 306, in install_app
    sync_jobs()
  File "/home/our/frappe-bench/apps/frappe/frappe/core/doctype/scheduled_job_type/scheduled_job_type.py", line 152, in sync_jobs
    all_events = insert_events(scheduler_events)
  File "/home/our/frappe-bench/apps/frappe/frappe/core/doctype/scheduled_job_type/scheduled_job_type.py", line 164, in insert_events
    event_jobs += insert_event_jobs(events, event_type)
  File "/home/our/frappe-bench/apps/frappe/frappe/core/doctype/scheduled_job_type/scheduled_job_type.py", line 182, in insert_event_jobs
    insert_single_event(frequency, event)
  File "/home/our/frappe-bench/apps/frappe/frappe/core/doctype/scheduled_job_type/scheduled_job_type.py", line 212, in insert_single_event
    doc.delete()
  File "/home/our/frappe-bench/apps/frappe/frappe/model/document.py", line 1021, in delete
    return frappe.delete_doc(
  File "/home/our/frappe-bench/apps/frappe/frappe/__init__.py", line 1243, in delete_doc
    return frappe.model.delete_doc.delete_doc(
  File "/home/our/frappe-bench/apps/frappe/frappe/model/delete_doc.py", line 129, in delete_doc
    frappe.enqueue(
  File "/home/our/frappe-bench/apps/frappe/frappe/__init__.py", line 2166, in enqueue
    return frappe.utils.background_jobs.enqueue(*args, **kwargs)
  File "/home/our/frappe-bench/apps/frappe/frappe/utils/background_jobs.py", line 101, in enqueue
    q = get_queue(queue, is_async=is_async)
  File "/home/our/frappe-bench/apps/frappe/frappe/utils/background_jobs.py", line 342, in get_queue
    return Queue(generate_qname(qtype), connection=get_redis_conn(), is_async=is_async)
  File "/home/our/frappe-bench/env/lib/python3.10/site-packages/tenacity/__init__.py", line 324, in wrapped_f
    return self(f, *args, **kw)
  File "/home/our/frappe-bench/env/lib/python3.10/site-packages/tenacity/__init__.py", line 404, in __call__
    do = self.iter(retry_state=retry_state)
  File "/home/our/frappe-bench/env/lib/python3.10/site-packages/tenacity/__init__.py", line 361, in iter
    raise retry_exc from fut.exception()
tenacity.RetryError: RetryError[<Future at 0x7f3757684550 state=finished raised ConnectionError>]
1 Like

Me too, got the same problem. But it still working despite the annoying error.

1 Like

I had a talk with Chat GPT regarding this issue.

The solution I got is as follows :

sudo nano /etc/redis/redis.conf

Look for the following lines in the configuration file:

port 6379

Add a new line below the port line to specify the extra port you want to use. For example, if you want to add port 11000, the configuration will look like this:

port 6379
port 11000

Save the changes and exit the text editor.
Restart the Redis server to apply the new configuration. Use the following command:

sudo service redis-server restart

To test the connection to the extra port, you can run the following command:

redis-cli -h localhost -p 11000 ping

If the connection is successful, you will see PONG as the response.

create the new site by this command :

bench new-site [site-name]

Please remember to remove port ‘11000’ after creating the site. Because I have seen that the command “Bench start” will return errors.

Removing port ‘11000’ :

sudo nano /etc/redis/redis.conf

Look for the following lines in the configuration file and remove it :

port 11000

Save the changes and exit the text editor.
Restart the Redis server to apply the new configuration. Use the following command:

sudo service redis-server restart
7 Likes

Yes Dear,

I did this and the error disappeared.

this error appears to be a recent development. Does anyone know why this started occurring during install?

Please make sure that Redis Queue runs @ redis://localhost:11000
Please make sure that Redis Queue runs @ redis://localhost:11000
Please make sure that Redis Queue runs @ redis://localhost:11000
Please make sure that Redis Queue runs @ redis://localhost:11000
Please make sure that Redis Queue runs @ redis://localhost:11000
Please make sure that Redis Queue runs @ redis://localhost:11000
Please make sure that Redis Queue runs @ redis://localhost:11000
Please make sure that Redis Queue runs @ redis://localhost:11000
Please make sure that Redis Queue runs @ redis://localhost:11000
Please make sure that Redis Queue runs @ redis://localhost:11000
1 Like

Many Thanks Mr Khaleel Ahmed. The solution suggested by you worked very well :slight_smile:

i don’t even have a etc/redis/redis.conf file as the nano shows me a blank page…

using docker

The solution was in the instructions of installation:

bench set-config -g redis_cache redis://redis-cache:6379
bench set-config -g redis_queue redis://redis-queue:6379
bench set-config -g redis_socketio redis://redis-socketio:6379
1 Like

You can also instruct your Frappe app on the correct port to look for redis_queue.

In your common_site_config.json replace the port for your Redis queue with the following:

“redis_queue”: “redis://localhost:6379”

this worked for me.

Unable to reproduce this error. Can anyone share the commit/branch that they are using and the rough steps taken to reproduce this bug?

Based on some of the errors it looks like:

  1. redis_queue instance is running and is accessible
  2. new-site syncs doctype, so it must be available so far.
  3. at some later stage of installing a new site redis_queue instance is not accessible.

Based on preliminary data I’d assume that Redis is somehow crashing during the process of install and you’ll have to somehow find the cause in logs only. :eyes:

There is no error log created AFAIK. The error just pops up when creating a new site and this doesn’t seem to stop the process as the error times out and you’re allowed to continue the install process.

i have this issue from the morning
I can’t init bench on version 14 , I did install version 13 and it works fine when upgrade to v14 or install v14 I got
Please make sure that Redis Queue runs @ redis://localhost:11000

it’s the same bench before update to 14 , so I think there is an issue here but why where I could not spot it since I thought this is a local issue on my setup and I have test it on three mac devices intel m1 and m2 they all got the same issue .

1 Like

I Think this will Helpful :

Solution :
Just setup production auto and manual by running below commands:

For automatic :
sudo bench setup production username

then :

Supervisor:
sudo apt -y install supervisor
bench setup supervisor
sudo ln -s pwd/config/supervisor.conf /etc/supervisor/conf.d/frappe-bench.conf

Nginx :
sudo apt -y install nginx
bench setup nginx
sudo ln -s pwd/config/nginx.conf /etc/nginx/conf.d/frappe-bench.conf

Note: Here ‘frappe-bench’ is name of your bench.

sudo systemctl restart nginx
sudo systemctl restart mariadb
sudo systemctl restart supervisor
sudo bench restart

Please confirm and replace bench name as per yours.

And then run :
sudo bench new-site site_name --force

It will definitely work.

Happy Learning
Thanks :slight_smile:

I think I found the root cause of this. But this shouldn’t be affecting version 14 to best of my knowledge.

We started sharing redis instance for RQ and socketio: refactor!: Merge redis_socketio and redis_queue by ankush · Pull Request #21317 · frappe/frappe · GitHub

This is why when realtime event is fired during install and bench isn’t started it shows this message. It’s not really required and installation will go through just fine.

I’ll remove the message somehow.


Did anyone face this on v14 too?

yes, on ubuntu install, but i would say in later stage of v14, as not all v14 (at first) had that problem

it affects verison 14 … i am getting same error

It’s weird chain of events, but this is the fix: fix: duplicate email pull hook by ankush · Pull Request #21539 · frappe/frappe · GitHub

This can be just solved by keeping bench running using bench start

1 Like