[BLOCKER ISSUE] Frappe/ERPNext 16 is not working because of Redis Exception

Hi,

I am trying to install Frappe/ERPNext using Helm chart.

Application version
v16.1.0

Chart versions
8.0.17 (any chart using version 15 works, but any chart using version 16 does NOT work)

But, I get an error because of Dragonfly/Redis compatibility with Frappe version 16.

Also `bench command is not working, particularly creating new site or list-apps.

This output is taken from the create site job, though executing bench command manually causes the same error.

++ bench new-site erp.XXXX.tld --no-mariadb-socket --db-type=mariadb --db-host=erpnext-mariadb-sts --db-port=3306 --admin-password=xxx46bb60cc6252fdb99e4bbb3828070 --mariadb-root-username= --mariadb-root-password=xxx46bb60cc6252fdb99e4bbb3828070 --install-app=erpnext --install-app=crm --install-app=payments --install-app=hrms --install-app=helpdesk --install-app=oidc_extended
++ tee /dev/stderr
--no-mariadb-socket is DEPRECATED; use --mariadb-user-host-login-scope='%' (wildcard) or --mariadb-user-host-login-scope=<myhostscope>, instead. The name of this option was misleading: it had nothing to do with sockets.
Traceback (most recent call last):
  File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py", line 112, in new_site
    _new_site(
    ~~~~~~~~~^
    	db_name,
     ^^^^^^^^
    ...<16 lines>...
    	mariadb_user_host_login_scope=mariadb_user_host_login_scope,
     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/home/frappe/frappe-bench/apps/frappe/frappe/installer.py", line 84, in _new_site
    install_db(
    ~~~~~~~~~~^
    	root_login=db_root_username,
     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<14 lines>...
    	mariadb_user_host_login_scope=mariadb_user_host_login_scope,
     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/home/frappe/frappe-bench/apps/frappe/frappe/installer.py", line 165, in install_db
    setup_database(force, verbose, mariadb_user_host_login_scope)
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/frappe/frappe-bench/apps/frappe/frappe/database/__init__.py", line 18, in setup_database
    return frappe.database.mariadb.setup_db.setup_database(force, verbose, mariadb_user_host_login_scope)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/frappe/frappe-bench/apps/frappe/frappe/database/mariadb/setup_db.py", line 34, in setup_database
    dbman.create_user(db_user, frappe.conf.db_password, **dbman_kwargs)
    ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/frappe/frappe-bench/apps/frappe/frappe/database/db_manager.py", line 19, in create_user
    self.db.sql(f"CREATE USER IF NOT EXISTS '{user}'@'{host}'{password_predicate}")
    ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/frappe/frappe-bench/apps/frappe/frappe/database/database.py", line 253, in sql
    self.clear_db_table_cache(query_type)
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
  File "/home/frappe/frappe-bench/apps/frappe/frappe/database/database.py", line 499, in clear_db_table_cache
    frappe.client_cache.delete_value("db_tables")
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/redis_wrapper.py", line 575, in delete_value
    self.redis.delete_value(key, shared=True)
    ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/redis_wrapper.py", line 161, in delete_value
    self.unlink(*keys)
    ~~~~~~~~~~~^^^^^^^
  File "/home/frappe/frappe-bench/env/lib/python3.14/site-packages/redis/commands/core.py", line 2694, in unlink
    return self.execute_command("UNLINK", *names)
           ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
  File "/home/frappe/frappe-bench/env/lib/python3.14/site-packages/redis/client.py", line 657, in execute_command
    return self._execute_command(*args, **options)
           ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
  File "/home/frappe/frappe-bench/env/lib/python3.14/site-packages/redis/client.py", line 663, in _execute_command
    conn = self.connection or pool.get_connection()
                              ~~~~~~~~~~~~~~~~~~~^^
  File "/home/frappe/frappe-bench/env/lib/python3.14/site-packages/redis/utils.py", line 196, in wrapper
    return func(*args, **kwargs)
  File "/home/frappe/frappe-bench/env/lib/python3.14/site-packages/redis/connection.py", line 2603, in get_connection
    connection.connect()
    ~~~~~~~~~~~~~~~~~~^^
  File "/home/frappe/frappe-bench/env/lib/python3.14/site-packages/redis/connection.py", line 846, in connect
    self.connect_check_health(check_health=True)
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
  File "/home/frappe/frappe-bench/env/lib/python3.14/site-packages/redis/connection.py", line 885, in connect_check_health
    callback(self)
    ~~~~~~~~^^^^^^
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/redis_wrapper.py", line 419, in _enable_client_tracking
    conn.read_response()
    ~~~~~~~~~~~~~~~~~~^^
  File "/home/frappe/frappe-bench/env/lib/python3.14/site-packages/redis/connection.py", line 1155, in read_response
    raise response
redis.exceptions.ResponseError: Client tracking is currently not supported for RESP2. Please use RESP3.
+ bench_output='--no-mariadb-socket is DEPRECATED; use --mariadb-user-host-login-scope='\''%'\'' (wildcard) or --mariadb-user-host-login-scope=<myhostscope>, instead. The name of this option was misleading: it had nothing to do with sockets.'
+ bench_exit_status=0
+ '[' 0 -ne 0 ']'
+ set -e
+ rm -f currentsite.txt

The issue started with the Helm Chart version: 8.0.15, apparently because it started using Application Version 16.0.0.

Meaning we have some BLOCKER issue here?

UPDATE 2

I tried to update dragonfly to 1.36.0
I tried adding

    redis_cache: "redis://erpnext-dragonfly-cache:6379/0?protocol=3"
    redis_queue: "redis://erpnext-dragonfly-queue:6379/0?protocol=3"
    redis_socketio: "redis://erpnext-dragonfly-queue:6379/0?protocol=3"

But nothing worked

Though executing

root@cp01:~# kubectl exec -it -n erpnext erpnext-dragonfly-cache-76488f6644-w9lzx -- redis-cli -3 HELLO 3

1# "server" => "redis"
2# "version" => "7.4.0"
3# "dragonfly_version" => "df-v1.36.0"
4# "proto" => (integer) 3
5# "id" => (integer) 2114
6# "mode" => "standalone"
7# "role" => "master"

Which indicates the issue is in Frappe, not in Dragonfly, if I am not mistaken.

UPDATE 3

After a lot of debugging, adding ...?protocol=3 to redis_caching URL:

bench set-config -g redis_cache "redis://erpnext-dragonfly-cache:6379?protocol=3"

changes the error to

“Syntax error”

in Frappe, meaning it probably switched the protocol, but something is not working. On Dragonfly server side I see this:

W20260126 22:54:17.317921 12 main_service.cc:1679] CLIENT MAINT_NOTIFICATIONS ON moving-endpoint-type internal-fqdn failed with reason: Unknown subcommand or wrong number of arguments for ‘MAINT_NOTIFICATIONS’. Try CLIENT HELP.


Apparently Frappe 16 has some issue with dealing with the new caching. At least with Dragonfly. I tried here to manipulate the code and disabled _enable_client_tracking method in the file apps/frappe/frappe/utils/redis_wrapper.py simply by adding a return to the top of the method.

Now I am able to execute bench with no errors! Though I am still getting MAINT_NOTIFICATIONS warning in Dragonfly server frequently.

Though I am still getting this annoying error while using ERPNext

redis.exceptions.ResponseError: syntax error

How should we deal with this? This is a blocker currently for almost any Helm usage.

I opened a Github issue for this.

Could you @revant_one please take a look on this?

check if this works for you feat(helm): Replace Dragonfly with Valkey as default cache by revant · Pull Request #269 · frappe/helm · GitHub

1 Like

@revant_one YES! THANK YOU! This looks much better. I will do some tests and let you know. But from my quick initial test it seems to be functional!

Everything looks fine so far. I will make this as resolved. Thanks!