Error while update ResponseError: WRONGTYPE Operation against a key holding the wrong kind of value

I wanted to update ERPNext and now I got this error:

Traceback (most recent call last):
  File "/usr/lib/python3.6/", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/", line 85, in _run_code
    exec(code, run_globals)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/", line 97, in <module>
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/", line 18, in main
  File "/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/", line 717, in main
    rv = self.invoke(ctx)
  File "/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/", line 25, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/", line 233, in migrate
    migrate(context.verbose, rebuild_website=rebuild_website, skip_failing=skip_failing)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/", line 40, in migrate
  File "/home/frappe/frappe-bench/apps/frappe/frappe/", line 48, in clear_global_cache
  File "/home/frappe/frappe-bench/apps/frappe/frappe/website/", line 295, in clear_cache
  File "/home/frappe/frappe-bench/apps/frappe/frappe/", line 563, in clear_cache
  File "/home/frappe/frappe-bench/apps/frappe/frappe/", line 31, in clear_user_cache
  File "/home/frappe/frappe-bench/apps/frappe/frappe/desk/", line 120, in clear_notifications
    config = get_notification_config()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/desk/", line 198, in get_notification_config
    return frappe.cache().hget("notification_config", frappe.session.user, _get)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/", line 172, in hget
    value = super(RedisWrapper, self).hget(_name, key)
  File "/home/frappe/frappe-bench/env/lib/python3.6/site-packages/redis/", line 1963, in hget
    return self.execute_command('HGET', name, key)
  File "/home/frappe/frappe-bench/env/lib/python3.6/site-packages/redis/", line 668, in execute_command
    return self.parse_response(connection, command_name, **options)
  File "/home/frappe/frappe-bench/env/lib/python3.6/site-packages/redis/", line 680, in parse_response
    response = connection.read_response()
  File "/home/frappe/frappe-bench/env/lib/python3.6/site-packages/redis/", line 629, in read_response
    raise response
redis.exceptions.ResponseError: WRONGTYPE Operation against a key holding the wrong kind of value

It happens in the backup process


I run this command,

redis-cli -p 13000 FLUSHALL

and the error was gone.

but not sure what it does, because I ran this one and nothing happened,

redis-cli -p 11311 flushall


I am facing same error when update to V12.1.7

did you run that command?, I am guessing that 13000 is the process ID (but I am just guessing)


I was also facing the same issue.

I successfully updated to ver 12.1.7 by using below process.

Below are the Steps

  1. Taken backup of my all sites and downloaded it locally.
  2. Deleted all sites.
  3. Created new site.
  4. And updated using bench command.
  5. Restored all backup on newly created sites.
  6. Migrated all sites.
    Issues get resolved by doing above mentioned steps.

For safer side I re updated all sites.

And done successful.

1 Like

Yes I ran command
redis-cli -p 13000 FLUSHALL
and updated successfully


Ok good option.
I tried but not succeed in my case.

1 Like

this work form me
redis-cli -p 13000 FLUSHALL


Worked for me too! Thanks for sharing!

1 Like

Worted for me too! Thanks.

1 Like

Worked for me also…

1 Like


1 Like

Checked first on which ports redis is listening:

ps aux | grep redis
redis      426  0.0  0.2  44116  6004 ?        Ssl   2019  58:28 /usr/bin/redis-server       
erpuser     1137  0.0  0.8  93272 18272 ?        Sl    2019  51:15 /usr/bin/redis-server                                 
erpuser     1138  0.0  0.1  40024  3020 ?        Sl    2019  40:37 /usr/bin/redis-server    

Then redis-cli -p 11311 FLUSHALL worked for me.

1 Like

That’s what I was missing. Thanks for explain.

redis-cli -p 6379 flushall
worked for me.
I am totally new for Redis. I want to know how to check it the values from different clients in Redis

1 Like

Worked like a charm for me while updating from 12.1.7 to 12.10


1 Like

Worked for me as well

1 Like

Damn whats this vodoo command redis-cli -p 13000 FLUSHALL was upgrading V11 to V12 when hit this redis error. This command worked like a gypsy potion. Thanks

1 Like