Tyk-ce is showing the following error : "Failed to create key - storage: Redis is either down or ws not configured

Hi there,

I am a fresh, need some help regarding tyk opensource.
I am trying to install TYK opensource on Kubernetees Deployed with terraform in EKS cluster.
I am following documentation in which I’m Trying to access API and getting this error:

“message”: “Failed to create key - storage: Redis is either down or ws not configured”,

I am Stucked.
Thanks in Advance

Hello @james6 and welcome to the community.

Have you completed the installation process or are you still setting it up?

Also, can you confirm that the gateway (Tyk) establishes a connection with Redis? You can verify if the gateway is connected to Redis with the Liveness health check

curl --location -g --request GET '{{GATEWAY_ENDPOINT}}/hello'

A successful result should be something like this

{
    "status": "pass",
    "version": "v4.0.3",
    "description": "Tyk GW",
    "details": {
        "redis": {
            "status": "pass",
            "componentType": "datastore",
            "time": "2022-07-23T00:09:02Z"
        }
    }
}

A failed one would look something like this

{
    "status": "fail",
    "version": "v4.0.3",
    "description": "Tyk GW",
    "details": {
        "redis": {
            "status": "fail",
            "output": "dial tcp: lookup tyk-open-source-redis on XXX.X.X.XX:XX: no such host",
            "componentType": "datastore",
            "time": "2022-07-23T00:10:02Z"
        }
    }
}

If it’s failing to connect then can you verify your redis environment and config as shared here

1 Like

Hello Olu,
Thank you so much for your response,
Actually I am getting fail status when running this command.
What I a m looking at Config map of TYK gateway, In storage part enable_cluster is “False”,
how can i change it to true.

Thanks.

I think there is a way you can edit config map values via Linux terminal commands or via a kubernetes IDE. However, the simplest way would be to use environment variables in the yaml file

env:
  name: TYK_GW_STORAGE_ENABLECLUSTER
  value: 'true'

You can also find other environment variable keys below

TYK_GW_STORAGE_DATABASE (number)

TYK_GW_STORAGE_HOST (string)

TYK_GW_STORAGE_HOSTS (string array)

TYK_GW_STORAGE_MAXACTIVE (number)

TYK_GW_STORAGE_MAXIDLE (number)

TYK_GW_STORAGE_PASSWORD (string)

TYK_GW_STORAGE_PORT (number)

TYK_GW_STORAGE_TYPE (string)

TYK_GW_STORAGE_USERNAME (string)

It may be helpful to note that we have a guide on configuring redis cluster that could prove useful.

If you run into any issues, then don’t hesitate to reach out.