Jump to content
MikeMon

Datasnap REST Calls TDSRestProtocolException on Delphi 10.2.1 and above

Recommended Posts

Hi

I've been having problems with REST client calls on Delphi Rio 10.3.1. The problem actually started with Delphi Tokyo 10.2.1. Everything worked perfectly with Delphi Berlin 10.1.2.

 

Not always, but quite often, I'm getting a TDSRestProtocolException exception on the client (which is running on windows) for the same REST call. The message is "HTTP/1.1 500 Internal Server Error" and the ResponseText is {"error":"[firedac][phys][ib]unavailable database"}.

Has anyone come across this problem, or has a solution for it?

 

Thank you in advance

Share this post


Link to post

This is not related to REST client. But is related to REST server, which is accessing to InterBase server. And due to some reason the database specified in FireDAC connection parameters is not available. Start from checking your InterBase interbase.log ...

Share this post


Link to post

Hi Dmitry

 

Thank you for your answer.

 

I know that the REST server is producing the error. But the same client with not a single change in code working with no errors compiled with Delphi 10.1.2, is getting this error compiled with Delphi 10.2.1 and above.

 

Moreover, I checked the interbase log on the REST server and there are no errors.

Share this post


Link to post

In this case I would try to capture HTTP packets sent from 10.1.2 and 10.2.1 clients. And will try to understand what is the difference between them, which may lead to this failure ...

Share this post


Link to post

I resolved the problem by assigning Connected:= False to the TFDConnection during design-time on the Datasnap Server TDataModule and changing it to Connected:= True in the OnCreate method of the TDataModule. I'm not sure if it's really a bug, but that's how I resolved it.

 

Thank you for your help @Dmitry Arefiev.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×