Tyk Gateway Upgrade from 5.1.1 to 5.3.x

I am currently using self managed tyk gateway version 5.1.1 and trying to upgrade to 5.3.2
I compiled the gateway with golang version 1.22.5 and the same was used to compile my two middleware plugins.
However now when i try to fetch the registered apis from the tyk url >>/tyk/apis/
i get 200 and an empty response.
Could this be because of the golang version not supported.Because there are no specific errors to suggest why otherwise

@anilnp Can you enable debug mode on the gateway and share the logs?

Also, how are you serving the APIs?

If you are getting an empty response with the tyk/apis endpoint then it means the APIs were not loaded or registered on the gateway. I suspect you may be hitting a side effect of v5.3.1 that introduced a security fix where APIs won’t register on the gateway if the custom plugin bundle associated with it fails verification

1 Like
time="Oct 04 08:03:11" level=debug msg="No Primary instance found, assuming control" prefix=host-check-mgr
time="Oct 04 08:03:11" level=error msg="cannot set key in pollerCacheKey" error="storage: Redis is either down or was not configured"
time="Oct 04 08:03:11" level=info msg="Starting Poller" prefix=host-check-mgr
time="Oct 04 08:03:11" level=debug msg="---> Initialising checker" prefix=host-check-mgr
time="Oct 04 08:03:11" level=debug msg="[HOST CHECKER] Config:TriggerLimit: 3"
time="Oct 04 08:03:11" level=debug msg="[HOST CHECKER] Config:Timeout: ~10"
time="Oct 04 08:03:11" level=debug msg="[HOST CHECKER] Config:WorkerPool: 12"
time="Oct 04 08:03:11" level=debug msg="[HOST CHECKER] Init complete"
time="Oct 04 08:03:11" level=debug msg="---> Starting checker" prefix=host-check-mgr
time="Oct 04 08:03:11" level=debug msg="[HOST CHECKER] Starting..."
time="Oct 04 08:03:11" level=debug msg="[HOST CHECKER] Check loop started..."
time="Oct 04 08:03:11" level=debug msg="[HOST CHECKER] Host reporter started..."
time="Oct 04 08:03:11" level=debug msg="---> Checker started." prefix=host-check-mgr
time="Oct 04 08:03:11" level=info msg="gRPC dispatcher was initialized" prefix=coprocess
time="Oct 04 08:03:11" level=debug msg="Notifier will not work in hybrid mode" prefix=main
time="Oct 04 08:03:12" level=info msg="PIDFile location set to: /var/run/tyk/tyk-gateway.pid" prefix=main
time="Oct 04 08:03:12" level=warning msg="The control_api_port should be changed for production" prefix=main
time="Oct 04 08:03:12" level=debug msg="Initialising default org store" prefix=main
time="Oct 04 08:03:12" level=error msg="Connection to Redis failed, reconnect in 10s" error="storage: Redis is either down or was not configured" prefix=pub-sub
time="Oct 04 08:03:12" level=info msg="Initialising Tyk REST API Endpoints" prefix=main
time="Oct 04 08:03:12" level=debug msg="Creating new Redis connection pool"
time="Oct 04 08:03:12" level=info msg="--> [REDIS] Creating single-node client"
time="Oct 04 08:03:12" level=debug msg="Loaded API Endpoints" prefix=main
time="Oct 04 08:03:12" level=info msg="--> Standard listener (http)" port=":8080" prefix=main
time="Oct 04 08:03:12" level=warning msg="Starting HTTP server on:[::]:8080" prefix=main
time="Oct 04 08:03:12" level=info msg="Initialising distributed rate limiter" prefix=main
time="Oct 04 08:03:12" level=debug msg="DRL: Setting node ID: solo-39731518-8699-45a2-b168-323f60846a24|tyk-0"
time="Oct 04 08:03:12" level=info msg="Tyk Gateway started (v5.3.0-dev)" prefix=main
time="Oct 04 08:03:12" level=info msg="--> Listening on address: (open interface)" prefix=main
time="Oct 04 08:03:12" level=info msg="--> Listening on port: 8080" prefix=main
time="Oct 04 08:03:12" level=info msg="--> PID: 1072" prefix=main
time="Oct 04 08:03:12" level=info msg="Starting gateway rate limiter notifications..."
time="Oct 04 08:03:12" level=debug msg="Default JSVM timeout used: 5s" prefix=jsvm
time="Oct 04 08:03:12" level=info msg="Loading policies" prefix=main
time="Oct 04 08:03:12" level=error msg="Couldn't open policy file: open /opt/<POLICY PATH>/policies.json: no such file or directory" prefix=policy

I tend to create the policies based on the response of the endpoints registered. This was working fine till 5.1.1 and fails on the latest version.

1 Like

I don’t understand what this means. Could you clarify?

The error shows that the path does not exist. The <POLICY PATH> variable does not look like it was replaced with the intended value.

The logs don’t also continue downwards to show if APIs were actually loading and if there were any errors in loading them

The latest version isn’t v5.3.0-dev. Are you using one of our samples?

1 Like

Hi Olu,
Thank you for your response.
<POLICY PATH> path has been replaced correctly I just replaced it while pasting the logs.
i tried using the LTS 5.3 and the logs i pasted are for 5.2.6

Ths policies.json is the file configured in tyk.conf.in
“policies”: {
“policy_source”: “file”,
“policy_record_name”: “/opt/robot/tyk/policies/policies.json”,
“allow_explicit_policy_id”: false
},

Okay. The path isn’t sensitive info but you can replace it if you choose

The logline below states otherwise

time="Oct 04 08:03:12" level=info msg="Tyk Gateway started (v5.3.0-dev)" prefix=main

Can you confirm from the logs that the APIs are loaded? The original issue was based on this