Rate limit error

Imported Google Group message. Original thread at: Redirecting to Google Groups Import Date: 2016-01-19 21:12:30 +0000.
Sender:Victor Franzonatto.
Date:Friday, 15 May 2015 18:53:16 UTC+1.

Hi,

To validate if I was doing something wrong, I followed from the start the https://tyk.io/blog/running-tyk-with-docker/ post.

Always I do a resquest, I get rate limit exception, attached is a print from request usage.

Victor.

Imported Google Group message.
Sender:Martin Buhr.
Date:Friday, 15 May 2015 20:46:33 UTC+1.

Hi Victor,

Try adding a slash to the end of httpbin.org (e.g. Http://httpbin.org/) that’s how I’ve always put it in…

Long shot, but hey :wink:

Thanks,
Martin

Imported Google Group message.
Sender:Victor Franzonatto.
Date:Friday, 15 May 2015 18:59:18 UTC+1.

Hi,

you will need to check the rate limit in the policy that is attached to the API, there is a rate limits section in the editor.

can you print screen your policy page so we can see?

Thanks,
Martin

Imported Google Group message.
Sender:Martin Buhr.
Date:Friday, 15 May 2015 19:04:42 UTC+1.

Hi,

Just noticed the quota, for some reason you have -1 and a renewal rate - I have a feeling that’s the problem.

Set it to -1 but without a renewal time and see if that improved the situation.

Thanks
Martin

Imported Google Group message.
Sender:Martin Buhr.
Date:Friday, 15 May 2015 19:12:01 UTC+1.

Hi,

It always get created with the renewal time, even none selected on Policy creation form.

  • show quoted text -

Imported Google Group message.
Sender:Victor Franzonatto.
Date:Friday, 15 May 2015 19:19:16 UTC+1.

And the policy is attached to the entry in the API catalogue?

Can you look up the key (go to key lookup) to see if the policy is attached properly?

What is the message that the gateway is throwing when you do a request (do a docker logs tyk_gateway)?

Thanks,
Martin

Imported Google Group message.
Sender:Martin Buhr.
Date:Friday, 15 May 2015 19:36:26 UTC+1.

Hi,

When I did the lookup its showed a message that the key seams not exist, even approved on the key requests.

So I deleted the policy, revoked the key and asked for a new key.

It’s not getting the rate limit error, but now don’t return anything:

curl --header “authorization: 5556245a69648f0001000001c63d45da2c1e46984cf30d81d2809f64” http://httpbin.testorg.tyk.docker:8888/get -v

  • Hostname was NOT found in DNS cache
  • Trying 127.0.0.1…
  • Connected to httpbin.testorg.tyk.docker (127.0.0.1) port 8888 (#0)

GET /get HTTP/1.1
User-Agent: curl/7.35.0
Host: httpbin.testorg.tyk.docker:8888
Accept: /
authorization: 5556245a69648f0001000001c63d45da2c1e46984cf30d81d2809f64

< HTTP/1.1 302 Found
< Date: Fri, 15 May 2015 18:35:21 GMT
< Content-Type: text/html; charset=UTF-8
< Content-Length: 0
< Connection: keep-alive
< Location: Loading...

  • Server Apache is not blacklisted
    < Server: Apache
    < X-Powered-By: PHP/5.4.39-0+deb7u2
    < X-Ratelimit-Limit: -1
    < X-Ratelimit-Remaining: 0
    < X-Ratelimit-Reset: 1431714206
    <
  • Connection #0 to host httpbin.testorg.tyk.docker left intact
  • show quoted text -

Imported Google Group message.
Sender:Victor Franzonatto.
Date:Friday, 15 May 2015 20:00:10 UTC+1.

PS.: When I mention ‘deleted the policy’, I created a new one too xD

  • show quoted text -

Imported Google Group message.
Sender:Victor Franzonatto.
Date:Friday, 15 May 2015 20:09:18 UTC+1.

Hi Victor,

We’ll need to see the log output to really diagnose this, and it’s a great way to see what’s going wrong - you can see the logs in real time by running:

sudo docker logs -f tyk_gateway

(you may need to replace tyk_gateway with whatever is running the ‘tyk’ command (i.e. not the dashboard).

If you run that command you’ll see Tyk’s output (the gateway, which is also the service that creates the keys and assigns policies). To clarify, The dashboard and portal just remote into the gateway and use it’s API to do things like create keys and register policies, so the workhorse for the operational stuff is at the gateway level, then the dashboard and portal are “business logic” that string things together.

The key you created as a developer, if you deleted the policy, that key will be defunct. Although if when you did a lookup and got an error on the results screen then that key may never have been created properly.

Now I would suggest watching the logs while doing the following:

  1. Create a new policy
  2. Sign up as a developer
  3. Attempt to access an API with the key

When you do (1) the gateway shoudl reload, when you do #2 you should see a key request created message and the key that was created. What would be really interesting to see is what happens with (3) the gateway will tell you what’s up :slight_smile:

Thanks,
Martin

  • show quoted text -

Imported Google Group message.
Sender:Martin Buhr.
Date:Friday, 15 May 2015 20:23:43 UTC+1.

Hi,

This is the gateway log:

time=“2015-05-15T19:12:37Z” level=info msg=“Loading policies”
time=“2015-05-15T19:12:37Z” level=info msg=“Using Policies from Mongo DB”
time=“2015-05-15T19:12:37Z” level=info msg=“Policies found: 1”
time=“2015-05-15T19:12:37Z” level=info msg=“Reload complete”
time=“2015-05-15T19:14:52Z” level=warning msg=“Tracked quota reset for key: 5556245a69648f0001000001da94796d2e6747145181af49681778d7”
time=“2015-05-15T19:14:52Z” level=info msg=“Generated new key - success.” key=“5556245a69648f0001000001da94796d2e6747145181af49681778d7”

I think that it seams a DNS problem, I don’t understand what this means:
curl --header “authorization: 5556245a69648f0001000001da94796d2e6747145181af49681778d7” http://httpbin.testorg.tyk.docker:8888/get -v

  • Hostname was NOT found in DNS cache
  • Trying 127.0.0.1…
  • Connected to httpbin.testorg.tyk.docker (127.0.0.1) port 8888 (#0)

GET /get HTTP/1.1
User-Agent: curl/7.35.0
Host: httpbin.testorg.tyk.docker:8888
Accept: /
authorization: 5556245a69648f0001000001da94796d2e6747145181af49681778d7

< HTTP/1.1 302 Found
< Date: Fri, 15 May 2015 19:19:22 GMT
< Content-Type: text/html; charset=UTF-8
< Content-Length: 0
< Connection: keep-alive
< Location: httbin.org

  • Server Apache is not blacklisted
    < Server: Apache
    < X-Powered-By: PHP/5.4.39-0+deb7u2
    < X-Ratelimit-Limit: -1
    < X-Ratelimit-Remaining: 0
    < X-Ratelimit-Reset: 1431717292
    <
  • Connection #0 to host httpbin.testorg.tyk.docker left intact

Thanks for your patience!!! hehe

  • show quoted text -

Imported Google Group message.
Sender:Victor Franzonatto.
Date:Friday, 15 May 2015 20:26:16 UTC+1.

This is the response when I call it directly:

curl --header “authorization: 5556245a69648f0001000001da94796d2e6747145181af49681778d7” http://httpbin.org/get -v

  • Hostname was NOT found in DNS cache
  • Trying 54.175.222.246…
  • Connected to httpbin.org (54.175.222.246) port 80 (#0)

GET /get HTTP/1.1
User-Agent: curl/7.35.0
Host: httpbin.org
Accept: /
authorization: 5556245a69648f0001000001da94796d2e6747145181af49681778d7

< HTTP/1.1 200 OK

  • Server nginx is not blacklisted
    < Server: nginx
    < Date: Fri, 15 May 2015 19:25:09 GMT
    < Content-Type: application/json
    < Content-Length: 270
    < Connection: keep-alive
    < Access-Control-Allow-Origin: *
    < Access-Control-Allow-Credentials: true
    <
    {
    “args”: {},
    “headers”: {
    “Accept”: “/”,
    “Authorization”: “5556245a69648f0001000001da94796d2e6747145181af49681778d7”,
    “Host”: “httpbin.org”,
    “User-Agent”: “curl/7.35.0”
    },
    “origin”: “177.148.171.168”,
    “url”: “http://httpbin.org/get
    }
  • Connection #0 to host httpbin.org left intact
  • show quoted text -

Imported Google Group message.
Sender:Victor Franzonatto.
Date:Friday, 15 May 2015 20:30:45 UTC+1.

Hi Victor,

I noticed something rather odd in your first curl response:

< Location: httbin.org

Is the URL correct in your API configurations (check the target URL).

Thanks,
Martin

This has nothing to do with the

  • show quoted text -

Imported Google Group message.
Sender:Martin Buhr.
Date:Friday, 15 May 2015 20:33:27 UTC+1.

Hi,

Yep, this is exactly what I’m not getting, the target seams to be correct, look the attachment.

I will delete all over again xD

_o/

  • show quoted text -

Imported Google Group message.
Sender:Victor Franzonatto.
Date:Friday, 15 May 2015 20:46:33 UTC+1.

Hi Victor,

Try adding a slash to the end of httpbin.org (e.g. Http://httpbin.org/) that’s how I’ve always put it in…

Long shot, but hey :wink:

Thanks,
Martin

Imported Google Group message.
Sender:Martin Buhr.
Date:Friday, 15 May 2015 20:48:50 UTC+1.

Kkkkkkkk

It’s it!!!

The slash to the end resolved the problem!!!

Thanks again for all your patience and help!!! \o/

Victor.

  • show quoted text -