lichess-org / api

Lichess API documentation and examples
https://lichess.org/api
GNU Affero General Public License v3.0
414 stars 140 forks source link

Hit with a 429 for posting a move in the middle of a game? #268

Closed th0masb closed 11 months ago

th0masb commented 11 months ago

In game https://lichess.org/gN0MXA6F I got hit with a 429 for trying to post a move??

What is going on here? Why would I get a 429 when I have just been posting legal moves? It makes no sense to require someone to backoff in the middle of a bullet game. If rate limits would be exceeded don't let the game start...

2023-07-19T18:07:26.966Z ERROR [testing] Game id gN0MXA6F failed: Error posting move e5f4 in gN0MXA6F: 429 Too Many Requests -> <!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Too many requests • lichess.org</title>
    <style>
      html,
      body,
      a {
        font: 16px monospace;
        background: #000;
        color: #ebd488;
        text-align: center;
        line-height: 1.6em;
      }

      html,
      body {
        width: 100%;
        margin: 0;
        padding: 0;
      }

      @media (max-width: 767px) {
        .game {
          display: none;
        }

        .hide-for-mobile {
          display: none;
        }

        body {
          padding: 0 10px;
          box-sizing: border-box;
        }
      }
    </style>
    <meta content="noindex, nofollow" name="robots" />
  </head>
  <body>
    <h1>lichess.org - too many requests</h1>
    <p>
      Your network has sent too many requests! Try again later.<br />
      <span class="hide-for-mobile">In the meantime, try out that fun little game:</span>
    </p>
    <div class="game">
      <iframe
        src="//lichess1.org/assets/vendor/ChessPursuit/bin-release/index.html"
        frameborder="0"
        width="400"
        height="500"
        credentialless
      >
      </iframe>
    </div>
    <p>
      If you are connecting from a school or a chess club,<br />
      you can contact us at <a href="mailto:contact@lichess.org">contact@lichess.org</a><br />
      and ask us to lift the limitation for your IP address.
    </p>
    <p>
      Please mention your IP address in the email;<br />
      you can
      <a href="http://whatismyip.host/" target="_blank" rel="noopener noreferrer">find it on this page</a>.
    </p>
  </body>
</html>
ornicar commented 11 months ago

there was a DDoS yesterday at that exact time, which automatically causes ratelimits to be temporarily tightened all around to protect the infrastructure and the human gameplay

th0masb commented 11 months ago

Ok, thanks for looking

th0masb commented 11 months ago

@ornicar This happened again... In game https://lichess.org/4SYhq9OP#32. Surely it doesn't make sense to rate limit a game already in progress?