Need a special offer?Find out if your project fits.
+

Problem connetting to MSSQL named instance from Flexmonster data server 2.8.1.16 from Debian

Answered
massimo besozzi asked on October 1, 2020

Hi ,
I have a problem connetting to MSSQL named instance from Flexmonster data server 2.8.1.16 from Debian,
Is not a network problems because from that machine I have another service that can connect to MSSQL
For me all its ok,I whould like to have an help!!
I have a
the error:
2020-10-01 14:20:00.3728|FATAL|Flexmonster.DataServer.Program|Cannot connect to the database using "Server=($HOST_IP)\$INSTANCENAME;Uid=$user;Pwd=$pswd;Database=dbname". Please check connection string. Details: Cannot connect to SQL Server Browser. Ensure SQL Server Browser has been started.
 
my datasource in config files
"DataSources": [
{
"Type": "database",
"DatabaseType": "mssql",
"ConnectionString": "Server=servername\\instancename;Uid=XXXXX;Pwd=XXXXX;Database=XXXXX",
"Indexes": {
"dp_4": {
"Query": "select * from [dbo].[XXXXXXX] where AAAAAAA = 4"
},
"ind_6": {
"Query": "select * from [dbo].[YYYYYYYYYYYYY] where AAAAAAA = 6"
}
}
}
],

16 answers

Public
Mykhailo Halaida Mykhailo Halaida Flexmonster October 5, 2020

Hi Massimo,
 
Thank you for posting to our forum.
 
Taking into account everything works as expected on Windows, it seems to us that the issue might lie in different connection string requirements in Debian.
 
With that in mind, we would suggest trying out different connection string formats to connect to your MS SQL instance. Here's a list of available types: https://www.connectionstrings.com/sql-server/.
 
Please let us know if this helps.
 
Regards,
Mykhailo

Public
massimo besozzi October 5, 2020

Hello,
which provider uses flexmonster-data-server to connect to MMSQL?
Are there any prerequisites for the connection or just unpack the linux zip from your site?
I have to install whit the flexmonster cli tools?
 
Regards ,
Massimo

Public
Mykhailo Halaida Mykhailo Halaida Flexmonster October 6, 2020

Hi Massimo,
 
Please note that you don't need to install any additional components apart from the Data Server in order to connect to your MSSQL instance – instead, what we're talking about is the correct "ConnectionString" parameter value inside your flexmonster-config.json file.
 
To be more specific, after trying different connection string formats we've discovered that the Standard Security format works well with Linux distributions:
 

"ConnectionString": "Server=localhost;Uid=SA;Pwd=password;Database=TestDB"

 
Feel free to try this on your side and please let us know if this fixes the issue for you.
 
Looking forward to your response.
 
Kind regards,
Mykhailo

Public
massimo besozzi October 6, 2020

Mykhailo ,
 
you cannot connect to an mssql named instance whitout define the instance name!!!!!!!

"ConnectionString": "Server=localhost;Uid=SA;Pwd=password;Database=TestDB"

"ConnectionString": "Server=localhost\instancename;Uid=SA;Pwd=password;Database=TestDB"
 

 

Public
massimo besozzi October 7, 2020

Hi Mykhailo ,
Flexsmonster-data-server cannot conntect to Mssql name instance server.
If a make a netstat on db machine i have this:

TCP DBIP:49369 FMDS_IP:42150 FIN_WAIT_2

 
The connection is not opened and flexmonsted-data-server is in a strange state is not started but It use 95% of CPU as you can see:
 
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
14214 root 20 0 2964480 67876 43644 R 99.3 3.4 15:04.13 flexmonster-dat
 
I would say it is a flexmonster data server bug !!!!!Where can I report it?
 

Public
Mykhailo Halaida Mykhailo Halaida Flexmonster October 7, 2020

Hi Massimo,
 
Thank you for your response & for providing further details on the issue in question.
 
First of all, we would like to confirm that the support forum is the correct place to report & discuss Flexmonster bugs and issues – here we always try to assist our users with the necessary support.
 
To reiterate our experience with Linux-based platforms, we've managed to deploy an MS SQL instance and connect it to Flexmonster through the Data Server in a way mentioned above with no issues emerging.
 
However, you're saying setting up named instances on your side is not successful. Since working with multiple instances is a Windows-only feature, we assume your use case involves deploying an MS SQL instance on a Windows machine and connecting to it from Debian – could you please confirm whether this is correct or if your situation is actually different?
 
Knowing this will greatly help us to understand the general picture better and get to the core of the issue faster. Any additional details you think might be helpful would also be highly appreciated.
 
Thank you for your patience and looking forward to your response.
 
Best regards,
Mykhailo

Public
massimo besozzi October 8, 2020

Hi Mykhailo ,
below are the specifications of the two environments (database and flexmonster data server).
DATABASE
OS -> Windows Server Standard SP2 (Version 6.0.6003)
DB -> Microsoft SQL Server Business Intelligence (64-bit) (version 12.0.5223.6) (Named Instance)
Flexmonster Data Server
OS --> SMP  Debian 4.19.98-1 (2020-01-26) x86_64 GNU/Linux
KERNEL --> Linux 4.19.0-8-amd64 #1
Flexmonster Data Server --> (2.8.16) I have tried also 2.8.17
I have removed all firewall rules on the Hosts.
Beside th flexmoster-config.json file :


"DataSources": [
{
"Type": "database",
"DatabaseType": "mssql",
"ConnectionString": "Server=$hostname\\$instancename;Uid=xxxxx;Pwd=xxxxx;Database=databasename",
"Indexes": {
"dp_4": {
"Query": "select * from tablename where ID_GROUP = 4"
},
"dp_3": {
"Query": "select * from tablename where ID_GROUP = 3"
},
"dp_5": {
"Query": "select * from tablename where ID_GROUP = 5"
},
"dp_6": {
"Query": "select * from tablename where ID_GROUP = 6"
},
"ind_4": {
"Query": "select * from tablename2 where ID_GROUP = 4"
},
"ind_3": {
"Query": "select * from tablename2 where ID_GROUP = 3"
},
"ind_5": {
"Query": "select * from tablename2 where ID_GROUP = 5"
},
"ind_6": {
"Query": "select * from tablename2 where ID_GROUP = 6"
}
}
}
],
"Security": {
"Authorization": {
"Enabled": false
},
"CORS": {
"AllowOrigin": "*"
},
"HSTS": {
"MaxAge": 31536000,
"IncludeSubDomains": true
},
"Headers": {
"Content-Security-Policy": "default-src 'self'",
"X-Content-Type-Options": "nosniff",
"X-Frame-Options": "SAMEORIGIN",
"X-XSS-Protection": "1; mode=block"
}
},
"DataStorageOptions": {
"DataRefreshTime": 60,
"CacheSizeLimit": 15000
},
"Port": "9500"
}

 
 
 

Public
Mykhailo Halaida Mykhailo Halaida Flexmonster October 13, 2020

Hi Massimo,
 
We will need a little bit more time to take a deeper look at this issue and see whether anything can be done on our side.
 
We'll return to you with the results of our research ETA Nov 16th.
 
Please let us know if there's anything else we can help you with in the meantime.
 
Regards,
Mykhailo

Public
massimo besozzi October 19, 2020

Hi ,
while i'm waiting for your response ,i have installed Flexmonster data server in a windows machine.
If i test connection with browser on localhost all it's OK when I connect from remote host (by name or IP address) i receive this error :"ERR_HTTP2_INADEQUATE_TRANSPORT_SECURITY".I'm using https connection with a self signed cert.
 
What I'm wrong???
 
 

{
"DataSources": [
{
"Type": "database",
"DatabaseType": "mssql",
"ConnectionString": "Server=$databaseip\\$instanceName;Uid=XXXXX;Pwd=XXXXX;Database=$dbname",
"Indexes": {
"dp_4": {
"Query": "select * from [dbo].[table] "
}
}
}
],
"Security": {
"Authorization": {
"Enabled": true
},
"CORS": {
"AllowOrigin": "https://$apllicationCallerHost"
},
"HSTS": {
"MaxAge": 31536000,
"IncludeSubDomains": true
},
"Headers": {
"Content-Security-Policy": "default-src 'self'",
"X-Content-Type-Options": "nosniff",
"X-Frame-Options": "SAMEORIGIN",
"X-XSS-Protection": "1; mode=block"
}
},
"DataStorageOptions": {
"DataRefreshTime": 60,
"CacheSizeLimit": 15000
},
"Port": "443"
,
"HTTPS": {
"Enabled": true,
"Certificate": {
"Subject": "$certsubject",
"Store": "My",
"Location": "LocalMachine",
"AllowInvalid": true
}
}
}
Public
Mykhailo Halaida Mykhailo Halaida Flexmonster October 20, 2020

Hi Massimo,
 
Please see our response in the parallel forum thread: https://www.flexmonster.com/question/flexmoster-data-server-https-problems/
 
Best regards,
Mykhailo

Public
Mykhailo Halaida Mykhailo Halaida Flexmonster November 18, 2020

Hi Massimo,
 
Hope you're having a great day.
 
As promised, our team has taken a look at the issue in question – everything seems to be working properly when taking into account a couple of additional configurations. To ensure the Data Server connects to the Debian-based MS SQL instance properly, follow the steps below:
 

  1. Specify the correct server port in the connection string, in case a non-default port (1433) is used:
    ...
    "ConnectionString": "Server=myServer,myPort;Database=..."
    ...
  2. With the help of SQL Server Management Studio, ensure that remote connections to your instance are enabled (see scr1.png).
  3. Through the SQL Server Configuration Manager enable the TCP/IP access to your instance (see scr2.png).
  4. Ensure that the SQL Server Browser & the SQL Server with the required MS SQL instance are both opened (see scr3.png). Here's some info on why the SQL Server Browser is necessary and here is a guide on how to run it.
  5. In your firewall configurations, make sure the 1433 port is open for TCP & the 1434 – for UDP. The 1434 port is used for identifying the correct instance when it comes to using named instances.

 
Please let us know if the suggestions above help you.
 
Best regards,
Mykhailo

Attachments:
scr1.png
scr2.png
scr3.png

Public
Mykhailo Halaida Mykhailo Halaida Flexmonster November 26, 2020

Hi Massimo,
 
How are you?
 
Just checking in to ask if you've received our previous response. Have you found it helpful, or is there still anything you might need our assistance with?
 
Please let us know what you think.
 
Kind regards,
Mykhailo

Public
massimo besozzi December 2, 2020

Hi Mykhailo,
 
in this thread there are 2 question , the https error is now OK but first problems not!!
yout wrote

To ensure the Data Server connects to the Debian-based MS SQL instance properly, follow the steps below

I'm not connecting to Debian-based MS SQL,I'm installing flexmonster-data-server on Debian an as i wrote before It cannot connect to MS SQL named instance on windows machine!!!!
As i wrote in a past thread 08/10/2020.

Hi Mykhailo ,
below are the specifications of the two environments (database and flexmonster data server).
DATABASE
OS -> Windows Server Standard SP2 (Version 6.0.6003)
DB -> Microsoft SQL Server Business Intelligence (64-bit) (version 12.0.5223.6) (Named Instance)
Flexmonster Data Server
OS –> SMP  Debian 4.19.98-1 (2020-01-26) x86_64 GNU/Linux
KERNEL –> Linux 4.19.0-8-amd64 #1
Flexmonster Data Server –> (2.8.16) I have tried also 2.8.17
I have removed all firewall rules on the Hosts.

Beside th flexmoster-config.json file :
 
 
I'm waiting.
 
Bye

Public
Mykhailo Halaida Mykhailo Halaida Flexmonster December 2, 2020

Massimo,
 
Our apologies, we've actually meant Windows Server-based MS SQL and a Debian-based Data Server in our last response – the error you've pointed out was just a misprint.
 
The suggestions we've provided do apply for your OS - Data Source setting, so we would recommend checking them out.
 
Please let us know if this helps!
 
Regards,
Mykhailo

Public
massimo besozzi December 2, 2020

Hi Mykhailo,
OK
what you propose I have already done!!!
I could have something wrong, so I will try again as soon as possible
 
Regads,
Massimo

Public
Mykhailo Halaida Mykhailo Halaida Flexmonster December 16, 2020

Hi Massimo,
 
How are you?
 
Just checking in to ask if you've had a chance to try our previous suggestion once again.
 
We would be happy to hear your feedback.
 
Regards,
Mykhailo

Please login or Register to Submit Answer