Re: [catch-all] AWS Elasticache

78 views
Skip to first unread message

Dan B

unread,
Jun 3, 2025, 9:27:12 AMJun 3
to cgr...@googlegroups.com
Hi Rhys,

We tried having a look at your issue but we could not reproduce it. We now see it as gone from google group. Can you confirm that is fixed?

Thanks,
DanB

On Fri, May 30, 2025 at 10:59 AM Rhys Williams <rhys...@gmail.com> wrote:
Hi,

I'm trying to use AWS serverless elasticache but facing some issues. 

No matter what I set db_port to in cgrates.json, cgrates tries to connect to elasticache on port 6380 when redisTLS: true and redisCluster:true. As AWS serverless elasticache only supports port 6379 this fails.

If I set redisCluster: false, it seems to connect but immediately I get errors because bgrates is trying to use SELECT which is not supported by the serverless version of elasticache.

The relevant part of my cgrates.json looks like this:

"data_db": {

  "db_type": "*redis",

  "db_host": "kjhjkhjkhkj.serverless.euw2.cache.amazonaws.com",

  "db_port": 6379,

  "caching": "*reload",

  "remote_conns": [],

  "items": {

    "*accounts": { "precache": false },

    "*destinations": {},

    "*reverse_destinations": {},

    "*rating_plans": {},

    "*rating_profiles": {}

  },

  "opts": {

    "redisTLS": true,

    "redisMaxConns": 10,

    "redisConnectAttempts": 20,

    "redisCluster": true

  }

}

Any help much appreciated.

Thanks,

Rhys

--
You received this message because you are subscribed to the Google Groups "CGRateS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cgrates+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/cgrates/62a2be87-b33b-4240-8ed4-78467fcfa2dcn%40googlegroups.com.

Rhys Williams

unread,
Jun 3, 2025, 10:44:00 AMJun 3
to cgr...@googlegroups.com
Hi Dan,

Thanks for getting back to me!

Well the problem I was reporting turned out to be just down to me not setting up my security group properly (doh!)  but........

Once I got past that problem I ran into another one.  I'd deleted the original ticket with the intention of creating a new one - sorry for the confusion!

No matter what i did with my config, I kept getting: 2025-06-02T14:57:07.153946+00:00 ip-172-31-7-238 cgr-engine[207642]: 2025/06/02 14:57:07 <InitS> error received: <ERR unknown command 'keys', with args beginning with: *>, exiting!

This was the data_db config:

"data_db": {
  "db_type": "*redis",
  "db_host": "jghjghjghjg.serverless.euw2.cache.amazonaws.com",

  "db_port": 6379,
  "caching": "*reload",
  "remote_conns": [],
  "items": {
    "*accounts": { "precache": false },
    "*destinations": {},
    "*reverse_destinations": {},
    "*rating_plans": {},
    "*rating_profiles": {}
  },
  "opts": {
    "redisTLS": true,
    "redisMaxConns": 10,
    "redisConnectAttempts": 20,
    "redisCluster": true
  }
}


Note - this was a serverless instance of Elasticache (tried with both Valkey and Redis engines)

I'm currently running with a local redis server (with different config obviously) and all is working well but I'd like to get elasticache working if possible,

Thanks again,

Rhys





Armir Veliaj

unread,
Jun 3, 2025, 11:19:23 AMJun 3
to cgr...@googlegroups.com
Hi Rhys,

I haven't fully reproduced your scenario with AWS, but after a quick look at your data_db config, I noticed that some fields like "caching" and "precache" have been added, which are not valid for the data_db configuration.

You can find the config with all valid default fields here:
https://github.com/cgrates/cgrates/blob/master/config/config_defaults.go#L90

Once you've checked that, feel free to update us so we can investigate further.

Thanks,
Armir

Rhys Williams

unread,
Jun 3, 2025, 2:03:59 PMJun 3
to cgr...@googlegroups.com
Hi Armir,

that's a fair point and probably the result of turning to ChatGPT in desperation but that was only one of many different configs that I tried.

I'm getting exactly the same result when using this config too:

  "data_db": {

           "db_type": "*redis",

           "db_host": "kjhgjhgklkjlk.serverless.euw2.cache.amazonaws.com",

           "db_port": 6379,

           "db_user": "cgrates",

           "db_password": "",

           "remote_conns": [],

           "remote_conn_id": "",

           "replication_conns": [],

           "replication_filtered": false,

           "replication_cache": "",

           "replication_failed_dir": "",

           "replication_interval": "",

           "items": {

                    "*accounts": { "limit": -1, "ttl": "", "static_ttl": false, "remote": false, "replicate": false },

                    "*destinations": { "limit": -1, "ttl": "", "static_ttl": false, "remote": false, "replicate": false },

                    "*reverse_destinations": { "limit": -1, "ttl": "", "static_ttl": false, "remote": false, "replicate": false },

                    "*rating_plans": { "limit": -1, "ttl": "", "static_ttl": false, "remote": false, "replicate": false },

                    "*rating_profiles": { "limit": -1, "ttl": "", "static_ttl": false, "remote": false, "replicate": false }

          },

          "opts": {

                  "redisTLS": true,

                  "redisCluster": true,

                  "redisMaxConns": 10,

                  "redisConnectAttempts": 20,

                  "internalDBDumpPath": "/var/lib/cgrates/internal_db/datadb",

                  "internalDBBackupPath": "/var/lib/cgrates/internal_db/backup/datadb",

                  "internalDBStartTimeout": "5m",

                  "internalDBDumpInterval": "0s",

                  "internalDBRewriteInterval": "0s",

                  "internalDBFileSizeLimit": "1GB",

                  "redisClusterSync": "5s",

                  "redisClusterOndownDelay": "0",

                  "redisConnectTimeout": "0",

                  "redisReadTimeout": "0",

                  "redisWriteTimeout": "0",

                  "redisPoolPipelineWindow": "150µs",

                  "redisPoolPipelineLimit": 0,

                  "redisSentinel": "",

                  "redisClientCertificate": "",

                  "redisClientKey": "",

                  "redisCACertificate": ""

         }

   },



Any help much appreciated.



Thanks,


Rhys

Armir Veliaj

unread,
Jun 5, 2025, 7:10:23 AMJun 5
to CGRateS
Hi Rhys,

I used your config to reproduce the same scenario on AWS ElastiCache and saw the same log error you had.
The reason it works locally but not on ElastiCache is that the KEYS command isn’t supported in AWS ElastiCache Serverless, which leads to the error.
To fix this, we’ve replaced KEYS with SCAN in the v1.0 release of CGRateS. Once that version becomes generally available after a few months you can use it and this issue should be resolved.

In the meantime, we may have those changes ported to the master as well, but we can't give a specific time yet.

Thanks,
Armir

Rhys Williams

unread,
Jun 6, 2025, 3:27:48 AMJun 6
to cgr...@googlegroups.com
Thanks Armir - I assumed that having "redisCluster": true in the config would prevent the use of KEYS but it seems not.

Armir Veliaj

unread,
Jul 11, 2025, 6:24:30 AMJul 11
to CGRateS
Hello Rhys,

We’ve replaced the unsupported "KEYS" command with "SCAN" in master, and the fix is already included in the latest package.
You can update the package and it should work fine now also with AWS ElastiCache.

Thanks,
Armir

Rhys Williams

unread,
Jul 15, 2025, 1:23:18 PMJul 15
to cgr...@googlegroups.com
Great news! Thanks for the update!

Reply all
Reply to author
Forward
0 new messages