Unable to Install Tyk-Cli

Hi, can you share your manifest file again?

The previous manifest file you shared was ok.

Following is the manifest file in my bundle.zip,

{“file_list”:[],“custom_middleware”:{“pre”:[{“name”:“MyPreMiddleware”,“path”:"",“require_session”:false}],“post”:[{“name”:“MyPostMiddleware”,“path”:"",“require_session”:true}],“post_key_auth”:null,“auth_check”:{“name”:“MyAuthCheck”,“path”:"",“require_session”:false},“response”:null,“driver”:“grpc”,“id_extractor”:{“extract_from”:"",“extract_with”:"",“extractor_config”:null}},“checksum”:“d41d8cd98f00b204e9800998ecf8427e”,“signature”:""}

The exported API definition looks ok, as the actual settings are in the bundle and they’re injected in another step of the process. You don’t need to change that.

Can you run the gateway in debug mode, send a test request again and share the log again? The gateway is configured to output some debug information about the hooks that are being called:

$ service tyk-gateway stop
$ /opt/tyk-gateway/tyk --conf=/opt/tyk-gateway/tyk.conf --debug

Here is the log,

[Aug 30 13:13:41] DEBUG jsvm: Running:
[Aug 30 13:13:41] ERROR jsvm: Failed to decode middleware request data on return from VM: invalid character ‘u’ looking for beginning of value
[Aug 30 13:13:41] DEBUG jsvm: undefined
[Aug 30 13:13:41] ERROR gateway: request error: Session state is missing or unset! Please make sure that auth headers are properly applied. api_id=5c375555a7f44d717df9a8caf1137394 org_id=5991fe917d56342516bcb731 path=/ip server_name=http://httpbin.org/ user_id= user_ip=10.200.105.24
[Aug 30 13:13:41] DEBUG Returning error header
[Aug 30 13:13:41] DEBUG Pushing to raw key list: tyk-system-analytics
[Aug 30 13:13:41] DEBUG Input key was: analytics-tyk-system-analytics
[Aug 30 13:13:41] DEBUG Adding Healthcheck to: 5c375555a7f44d717df9a8caf1137394.BlockedRequest
[Aug 30 13:13:41] DEBUG Val is: -1
[Aug 30 13:13:41] DEBUG Appending to fixed key list: analytics-tyk-system-analytics
[Aug 30 13:13:41] DEBUG Input key was: analytics-tyk-system-analytics
[Aug 30 13:13:41] DEBUG Incrementing raw key: 5c375555a7f44d717df9a8caf1137394.BlockedRequest
[Aug 30 13:13:41] DEBUG keyName is: 5c375555a7f44d717df9a8caf1137394.BlockedRequest
[Aug 30 13:13:41] DEBUG Now is:2017-08-30 13:13:41.648582449 -0400 EDT
[Aug 30 13:13:41] DEBUG Then is: 2017-08-30 13:12:41.648582449 -0400 EDT
[Aug 30 13:13:41] DEBUG Inbound message received
[Aug 30 13:13:41] DEBUG Returned: 0
[Aug 30 13:13:42] DEBUG Sending notification{NoticeGatewayDRLNotification {“HostName”:“hsa-apigwmgt”,“ID”:“1df81e78-8f2c-441b-5450-689c8d7fb1d8”,“LoadPerSec”:1,“Percentage”:0,“TagHash”:“”} }
[Aug 30 13:13:42] DEBUG Received DRL data: {hsa-apigwmgt 1df81e78-8f2c-441b-5450-689c8d7fb1d8 1 0 }
[Aug 30 13:13:42] DEBUG Active Nodes: : 1 [Token Bucket Value]: 100 [Current Load p/s]: 1 [Current Load]: 0.000000
[Aug 30 13:13:42] DEBUG Calling: https://hsa-apigwmgt.amer.reisystems.com:3000/register/ping
[Aug 30 13:13:42] DEBUG Sending Heartbeat as: 1df81e78-8f2c-441b-5450-689c8d7fb1d8
[Aug 30 13:13:42] DEBUG Hearbeat Finished: Nonce Set: MWRmODFlNzgtOGYyYy00NDFiLTU0NTAtNjg5YzhkN2ZiMWQ4MGVhYjZiMDhjNzNkNDY4ZTYwYjc0Y2FiNDUwYzExOTM=

Also, somewhere towards the start I see this,

DEBUG Inbound message received
[Aug 30 13:12:26] DEBUG Inbound message received
[Aug 30 13:12:26] DEBUG Inbound message received
[Aug 30 13:12:26] ERROR main: Couldn’t create bundle directory: mkdir middleware/bundles/5c375555a7f44d717df9a8caf1137394-bundle.zip: no such file or directory api_id=5c375555a7f44d717df9a8caf1137394 org_id=5991fe917d56342516bcb731 path=- server_name=http://httpbin.org/ user_id=- user_ip=-

Looks like it could be a permissions issue. Let me try to add permissions and then try again

The permissions are already present on Middleware folder, I also added bundles folder manually but still the same results.

Hi @matiasb,

I was able to get it working, by changing the Program.cs to create connection to the actual IP of the system instead of new ServerPort(“localhost”, Port, ServerCredentials.Insecure) . SInce the Gateway is hosted on Ubuntu and the gRPC is hosted on a windows machine, this was an issue.

Also for debug, I had to be inside tyk-gateway directory and after that the errors related to not able to create bundle went away.

Thanks you so much for all the help on this.

1 Like

Hi, sounds great. Let us know if you get any other issues.

Best.