Problems with using Redis Cache


I recently discovered Vikunja, and since then I’ve set it up and have started using it. It feels very refreshing and pleasurable to use.

Although the usage of my instance is not much with just 2 active users, I wanted to explore the Redis Caching option. I enabled Redis by setting the following variables in the docker-compose file.


The Caching seems to work as I see the Xorm keys in the Redis instance. I’m encountering the following issues.

  1. The gob is not able to decode the RelatedTasks model. I’m thinking this might be because the RelatedTaskMap is not registered in the GetTables() function that is used for registering the objects in gob.
2023-05-29T12:33:07.510132609Z: ERROR	▶ [DATABASE] 226 [redis_cacher] decode failed: gob: wrong type (models.RelatedTaskMap) for received field .RelatedTasks
  1. At first look, it might be because afero.File is part of the File Model and gob is trying to decode that?
2023-05-29T12:33:07.787797753Z: ERROR	▶ [DATABASE] 2e3 [redis_cacher] gob encoding '&{%!s(int64=1) avatar.jpg image/png %!s(uint64=37486) 2023-05-28 12:23:59 +0000 GMT %!s(int64=1) %!s(*os.File=&{0xc000347200}) }' failed: gob: type not registered for interface: os.File|value:&{1 avatar.jpg image/png 37486 2023-05-28 12:23:59 +0000 GMT 1 0xc000bdecf8 []}
  1. Lastly, it looks like the VIKUNJA_REDIS_DB variable is not respected. I’ve explicitly set it to 1 but the keys are being created in Database 0 still. At first look, red package seems to be accepting and passing the value along properly.

Just a note that the app is working properly, these are just the errors I’m seeing in the logs.