"code":1040,"message":"An internal error has occurred."

Sort:
Avatar of Ximoon

Hello all, I had the fun to find an HTTP error code unknown to me when trying to access that datapoint:

https://api.chess.com/pub/match/1794360

{"code":1040,"message":"An internal error has occurred. Please contact Chess.com Developer's Forum for further help https://www.chess.com/club/chess-com-developer-community ."}

The web page is fine though:

https://www.chess.com/club/matches/1794360

Is it going to self-fix?

Thanks.

Avatar of stephen_33

I think I recognise that code from somewhere but I found this...

"Error 1040: Invalid request rewrite (header modification not allowed) This error indicates that an attempt was made to modify a restricted HTTP header"

How do you make sense of that? The endpoint URL seems valid and correct.

From Cloudflare Docs: "Error 1040: Invalid request rewrite (header modification not allowed)
This error indicates that an attempt was made to modify a restricted HTTP header.

Common cause
You are trying to modify an HTTP header that Request Header Transform Rules cannot change.

Resolution
Make sure you are not trying to modify one of the reserved HTTP request headers"

These third party security/distributed service companies are fine until there's a problem and then they're just another layer of complexity.

Avatar of stephen_33

"Is it going to self-fix?"

They generally do given some time but why endpoints like that ever become broken is a mystery that's never been explained. I have an ongoing problem with the endpoint for EGYPT CHESS CLUB, broken one day and fixed the next.

Good luck with that Christophe.

Avatar of Tricky_Dicky

Yesterday, running league update, got a couple of match endpoint errors for matches that had previously been OK. I assumed the usual C.C DB problems. Just run again and got the same errors. API call returns 404 status but output message is the same 1040

02/12/2025 15:39:03 404 https://api.chess.com/pub/match/1731199

02/12/2025 15:41:43 404 https://api.chess.com/pub/match/1776642 
02/12/2025 15:43:18 404 https://api.chess.com/pub/match/1731199 
02/12/2025 19:52:30 404 https://api.chess.com/pub/match/1776642 
03/12/2025 09:58:10 404 https://api.chess.com/pub/match/1731199 
03/12/2025 09:59:31 404 https://api.chess.com/pub/match/1776642 
03/12/2025 10:00:45 404 https://api.chess.com/pub/match/1731199 
03/12/2025 10:01:09 404 https://api.chess.com/pub/match/1776642

Avatar of Tricky_Dicky

The two I reported are now fixed.

Avatar of Ximoon

The one from first post is fixed now too.

Avatar of davidlevner

http (HyperText Transport Protocol) error 1040 means the web page you tried to access does not exist. It is easy to mangle URLs to refer to non-existent web pages and generate this error. Although chess.com could provide a better error message, I think there are many other bug fixes and improvements that are a higher priority.
It has been pointed out many times that this forum is not the appropriate place to post about bugs. I subscribed to this forum because I am a software developer and am interested in the development of chess applications. Bug reports that don't belong here waste my time. I am considering unsubscribing.

Avatar of Tricky_Dicky

@davidlevner Did you read the OP? The API call explicitly messaged that this is the place to report API failures.

{"code":1040,"message":"An internal error has occurred. Please contact Chess.com Developer's Forum for further help https://www.chess.com/club/chess-com-developer-community ."}

Avatar of stephen_33

Of course it belongs here and anyway, re-reading what I posted above, the problem seems to have been with the header information rather than the URL itself?

Avatar of davidlevner

The API is the Application Programmer Interface. Http errors generated by incorrect URLs have nothing to do with the API. The API is a tool provided by chess.com for programmers to write code that provides new features. The error in question did not involve code that uses the API.

Avatar of Tricky_Dicky

Sorry. That is incorrect. The error was generated by a fault with the API endpoint and had nothing to do with the call structure or the gateway interface. If you followed this group you would know that this is not an isolated occurance. It happens a lot due to DB failure.

This is not our first time on this horse.

Avatar of davidlevner

My bad. The original URL tried by ximoon began with api.chess.com. I tried the URL that caused the error and it now returns data, not an error message. So the problem has been fixed.

Avatar of NegritoParana

quisiera saber a qué se le llama "desestimiento". He perdido varias partidas por dicho motivo, inclusive estando mejor en algunas (aunque reconozco que en la mayoría no lo estaba). En TODAS tenía margen de tiempo para pensar en qué camino seguir, pero no tuve la oportunidad. Pese a no haber abandonado, me dieron dichas partidas por perdidas.

Quisiera saber qué concepto se usa para considerar que yo quiero DESISTIR a seguir jugando.

Muchas gracias, espero una aclaración