chess-api icon indicating copy to clipboard operation
chess-api copied to clipboard

Keep getting "error: The game has expired OR you didn't put the game_id as the parameter!"

Open apapadakuni opened this issue 6 years ago • 6 comments

Hi,

I keep getting "error: The game has expired OR you didn't put the game_id as the parameter!" even though I have created the game and pass the game_id as the parameter. This happens with any of the POSTs, such as Move Figure Player. I have tried both in Postman and in code.

apapadakuni avatar Apr 03 '19 17:04 apapadakuni

Hello,

the api, even without my maintenance should still work fine. Are you sure your requests have Content-Type header set to application/x-www-form-urlencoded and you are sending them in a correct way?

You can see the working example of the api here.

anzemur avatar Apr 04 '19 21:04 anzemur

The same happened to me, I have no problem if I host myself the APIs. It feels like the db is being deleted with a very little interval

conema avatar Jun 25 '19 10:06 conema

Chessboard expires after 2 hours, so it gets deleted from the database.

anzemur avatar Jun 25 '19 23:06 anzemur

I'm talking about very few minutes or instantly. I've not used this API for a few months, but in the past I had the same problem as @apapadakuni. Maybe there is some sort of daily data limit in mongodb?

I'm thinking about a limit because, as I said in my last comment, I had no problems if I host it myself (with the same architecture - heroku + mondodb atlas), maybe your api endpoint is receiving too much requests.

conema avatar Jun 26 '19 08:06 conema

Hi, after some more thorough investigation I've noticed in the chessboardModel.js that the chess schema actually expires 2 hours from the initial startup rather than the time the schema was created so after a while when you try to start a new game id and schema past the 2 hour startup it's already expired. Also explains why sometimes in the heroku api game ids expire randomly after 1-2 minutes.

Dummiez avatar Aug 09 '19 02:08 Dummiez

Yeah i have this issue too. I built chess using this API into a discord bot and i constantly get the same error even though i just started the game

xastrobyte avatar Nov 07 '20 01:11 xastrobyte