Begin SQL / End SQL : Failed to connect to the remote server

One of my customers is experiencing the following problem with 4D Server v17R3 running on Windows Server 2016 64-bit.

In their code they use in various places Begin SQL / End SQL to access the 4D database through SQL. This has worked fine for years.

Since last Friday, they now get an error message each time Begin SQL / End SQL is used. The error message is: “Error 1002: Failed to connect to the remote server. Error 60: Operation timed out.”

The same code works fine when I test on a different computer.

I have checked for the obvious things:

  • Restart windows
  • Check if 4D’s SQL server is running (although I think this is not required for Begin SQL).
  • The ports 19812, 19813 and 19814 are open and not blocked by a firewall. I can successfully connect to port 19812 using 4D Internet Commands.

But still the same problem.

Does anyone have any good tips?

Enable the request log on the server. It will contain beside “normal” 4D requests also SQL request.

It shows the SQL command as text in the request log.

Check the command, maybe it was a “not so clever” command which needed too long (as the error reports a timeout).

Hi Thomas,

I have enabled Debug Log recording upon your advice. Here is an extract:
39312 28153 p=5 puid=10 (12) meth: TGetUserNameForCode(“G000000065”)
39313 28153 p=5 puid=10 (13) cmd: C_TEXT($1;$usercode)
39314 28153 p=5 puid=10 (13) end_cmd: C_TEXT($1;$usercode). < ms
39315 28153 p=5 puid=10 (13) cmd: C_TEXT($0;$username)
39316 28153 p=5 puid=10 (13) end_cmd: C_TEXT($0;$username). < ms
39317 28153 p=5 puid=10 (13) cmd: Begin SQL
… (activity from other 4D processes)
39382 36039 p=5 puid=10 (13) end_cmd: Begin SQL. 7885 ms

It looks like it doesn’t even get to the point of executing the SQL statement. It looks like it already goes wrong when establishing the connection.

I have checked the SQL statements. They all fail, even the simplest ones. Besides I don’t think the problem is there because when I run the same structure file with 4D Server v17R3 on my MacBook Pro, it works without a problem. In addition, this code has been there for multiple years and has always worked.

Do you have any more suggestions?

no direct idea, so please open a TAOW case, it will need more investigations…