Error when using MS SQL

Happyhourly4 years ago

Hello all, i have achieved publishing on my localhost Windows the traccar server. Its using the default database h2. But, when i try to change the database to MSSQL it gives me the following error:

2020-10-05 16:47:32  INFO: HikariPool-1 - Starting...
2020-10-05 16:48:04 ERROR: HikariPool-1 - Exception during pool initialization. - The connection to the host xxx.xxx.xxx.xxx, 1433, named instance mssqlserver01 failed. Error: "java.net.UnknownHostException: xxx.xxx.xxx.xxx, 1433". Verify the server and instance names and check that no firewall is blocking UDP traffic to port 1434.  For SQL Server 2005 or later, verify that the SQL Server Browser Service is running on the host. - SQLServerException (... < DataManager:139 < *:89 < Context:292 < Main:137 < ...)
2020-10-05 16:48:04 ERROR: Main method error - The connection to the host xxx.xxx.xxx.xxx, 1433, named instance mssqlserver01 failed. Error: "java.net.UnknownHostException: xxx.xxx.xxx.xxx, 1433". Verify the server and instance names and check that no firewall is blocking UDP traffic to port 1434.  For SQL Server 2005 or later, verify that the SQL Server Browser Service is running on the host. - SQLServerException (... < DataManager:139 < *:89 < Context:292 < Main:137 < ...)
2020-10-05 16:48:04  WARN: JNA: Callback org.traccar.WindowsService$ServiceMain@730d2164 threw the following exception - The connection to the host xxx.xxx.xxx.xxx, 1433, named instance mssqlserver01 failed. Error: "java.net.UnknownHostException: xxx.xxx.xxx.xxx, 1433". Verify the server and instance names and check that no firewall is blocking UDP traffic to port 1434.  For SQL Server 2005 or later, verify that the SQL Server Browser Service is running on the host. - SQLServerException (... < DataManager:139 < *:89 < Context:292 < Main:137 < ...)

this is my traccar.xml conf file

<entry key='database.driver'>com.microsoft.sqlserver.jdbc.SQLServerDriver</entry>
<entry key='database.url'>jdbc:sqlserver://xxx.xxx.xxx.xxx, 1433\MSSQLSERVER01;user=sa;password=XXXXX!!;databaseName=TRACCAR;</entry>
<entry key='database.user'>sa</entry>
<entry key='database.password'>XXXXX</entry>

I have two instances of database in the same server:

Microsoft SQL Server Developer (64-bit)
Microsoft SQL Server Express (64-bit)

both have the same user and pass, and the TRACCAR database created.

i have also tried starting the SQL Server Browser Service on my server, and also ports 1433 and 1434 are opened.
Im using this version: Server Version 4.10 (25-Jul-2020)
Any clue whta coud be wrong.

Anton Tananaev4 years ago

How did you check that the ports are open? What processes are listening on those ports?

Happyhourly4 years ago

hi Anton, thanks for the answer. I have checked in Resoruce Monitor > Listening Ports and i have this:

SQL Browser.exe listening 1434 UDP, Allowed by Firewall ,not restricted.

Anton Tananaev4 years ago

What is the browser service? Why it's not SQL server itself? What about port 1433?

Happyhourly4 years ago

Hi Anton, the browser service is this: "verify that the SQL Server Browser Service is running on the host". Its a SQL service that was stopped inicially, and i started it, since the log told me that. The SQL Server service (sqlservr.exe) is open on TCP Port 1433, same Allowed by Firewall ,not restricted.

Happyhourly4 years ago

Hi Anton i think it was something with my server. I changed database to cloud and its working normally. Thanks anyway.