0

I have created a spring boot api and deployed it to my heroku app. My spring boot API is internally calling gitlab apis to get some data. Request URL for my API is :-

https://myapi.herokuapp.com/gitlabreport/multipleReviewComments?storyIds=GLP-40421,GLP-90429,GLP-93477,GLP-90380,GLP-90431,GLP-90432,GLP-90433,GLP-90444,GLP-50485,GLP-40486,GLP-61357

When i am sending the request i am getting following error :-

{"errorCode":429,"errorMessage":"
<!DOCTYPE html>\n<html>\n

<head>\n
    <meta content=\"width=device-width, initial-scale=1, maximum-scale=1\" name=\"viewport\">\n <title>429 Too Many
        Requests</title>\n <style>
        \n body {
            \n color: #666;
            \n text-align: center;
            \n font-family: \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n      margin: auto;\n      font-size: 14px;\n    }\n\n    h1 {\n      font-size: 56px;\n      line-height: 100px;\n      font-weight: normal;\n      color: #456;\n    }\n\n    h2 {\n      font-size: 24px;\n      color: #666;\n      line-height: 1.5em;\n    }\n\n    h3 {\n      color: #456;\n      font-size: 20px;\n      font-weight: normal;\n      line-height: 28px;\n    }\n\n    hr {\n      max-width: 800px;\n      margin: 18px auto;\n      border: 0;\n      border-top: 1px solid #EEE;\n      border-bottom: 1px solid white;\n    }\n\n    img {\n      max-width: 40vw;\n    }\n\n    .container {\n      margin: auto 20px;\n    }\n  
    </style>\n</head>\n\n

<body>\n <h1>\n
        <img src=\"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjEwIiBoZWlnaHQ9IjIxMCIgdmlld0JveD0iMCAwIDIxMCAyMTAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPHBhdGggZD0iTTEwNS4wNjE0IDIwMy42NTVsMzguNjQtMTE4LjkyMWgtNzcuMjhsMzguNjQgMTE4LjkyMXoiIGZpbGw9IiNlMjQzMjkiLz4KICA8cGF0aCBkPSJNMTA1LjA2MTQgMjAzLjY1NDhsLTM4LjY0LTExOC45MjFoLTU0LjE1M2w5Mi43OTMgMTE4LjkyMXoiIGZpbGw9IiNmYzZkMjYiLz4KICA8cGF0aCBkPSJNMTIuMjY4NSA4NC43MzQxbC0xMS43NDIgMzYuMTM5Yy0xLjA3MSAzLjI5Ni4xMDIgNi45MDcgMi45MDYgOC45NDRsMTAxLjYyOSA3My44MzgtOTIuNzkzLTExOC45MjF6IiBmaWxsPSIjZmNhMzI2Ii8+CiAgPHBhdGggZD0iTTEyLjI2ODUgODQuNzM0Mmg1NC4xNTNsLTIzLjI3My03MS42MjVjLTEuMTk3LTMuNjg2LTYuNDExLTMuNjg1LTcuNjA4IDBsLTIzLjI3MiA3MS42MjV6IiBmaWxsPSIjZTI0MzI5Ii8+CiAgPHBhdGggZD0iTTEwNS4wNjE0IDIwMy42NTQ4bDM4LjY0LTExOC45MjFoNTQuMTUzbC05Mi43OTMgMTE4LjkyMXoiIGZpbGw9IiNmYzZkMjYiLz4KICA8cGF0aCBkPSJNMTk3Ljg1NDQgODQuNzM0MWwxMS43NDIgMzYuMTM5YzEuMDcxIDMuMjk2LS4xMDIgNi45MDctMi45MDYgOC45NDRsLTEwMS42MjkgNzMuODM4IDkyLjc5My0xMTguOTIxeiIgZmlsbD0iI2ZjYTMyNiIvPgogIDxwYXRoIGQ9Ik0xOTcuODU0NCA4NC43MzQyaC01NC4xNTNsMjMuMjczLTcxLjYyNWMxLjE5Ny0zLjY4NiA2LjQxMS0zLjY4NSA3LjYwOCAwbDIzLjI3MiA3MS42MjV6IiBmaWxsPSIjZTI0MzI5Ii8+Cjwvc3ZnPgo=\" alt=\"GitLab Logo\" /><br />\n    429\n  </h1>
        \n <div class=\"container\">\n <h3>Too many requests received.</h3>\n
            <hr />\n <p>Please try again later.</p>\n </div>\n</body>\n

</html>\n"}

I tried this on different server too but still getting 429 error, So it must be something at the gitlab-api end Is there a rate limiting on gitlab-api?

Rohit Singh
  • 169
  • 2
  • 2
  • 9
  • almost certainly you're app is making more requests per second/minute than allowed for typical usage... hence you're being asked to calm down. Twitter has the 420 HTTP response code, "enhance your calm". (420 also being a code name for cannabis) https://httpstatuses.com/429 – Rob Evans Jun 05 '20 at 12:20
  • That's what I wanted to know if there is any rate limit in GitLab API. One more thing is when i hit this from my local environment everything works fine. I am getting the error when hitting it from the server like Heroku or AWS ec2 instance. – Rohit Singh Jun 05 '20 at 13:21
  • @RohitSingh are you calling gitlab.com or a self hosted Gitlab instance ? – Bertrand Martel Jun 08 '20 at 20:58
  • I am using APIs exposed to the public by GitLab. The problem was with GitLab only as I was making too many requests in a single call. – Rohit Singh Jun 09 '20 at 04:52

0 Answers0