Cannot connect to SQL Server DB during ScanCentral DAST installation.

[vd_admin@vmotxprdqac006 ConfigurationToolCLI]$ docker run --rm -v /home/vd_admin/ConfigurationToolCLI:/home/vd_admin/ConfigurationToolCLI/app/logs dast_confi
gsb_redhat_linux:latest configureenvironment --mode new --settingsFile SampleSettingsFile.json --outputDirectory /home/vd_admin/ConfigurationToolCLI/app/log
2024-04-25 20:29:31 - Starting dotnet, Application Version: 23.2.0.107.
ValidateDatabaseConnection failed. Microsoft.Data.SqlClient.SqlException (0x80131904): A network-related or instance-specific error occurred while establishin
g a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to al
low remote connections. (provider: TCP Provider, error: 35 - An internal exception was caught)
---> System.Net.Sockets.SocketException (00000005, 0xFFFDFFFF): Name or service not known
at System.Net.Dns.GetHostEntryOrAddressesCore(String hostName, Boolean justAddresses, AddressFamily addressFamily, Int64 startingTimestamp)
at System.Net.Dns.GetHostAddresses(String hostNameOrAddress, AddressFamily family)
at Microsoft.Data.SqlClient.SNI.SNICommon.GetDnsIpAddresses(String serverName)
at Microsoft.Data.SqlClient.SNI.SNITCPHandle.Connect(String serverName, Int32 port, TimeSpan timeout, Boolean isInfiniteTimeout, SqlConnectionIPAddressPref
erence ipPreference, String cachedFQDN, SQLDNSInfo& pendingDNSInfo)
at Microsoft.Data.SqlClient.SNI.SNITCPHandle..ctor(String serverName, Int32 port, Int64 timerExpire, Boolean parallel, SqlConnectionIPAddressPreference ipP
reference, String cachedFQDN, SQLDNSInfo& pendingDNSInfo, Boolean tlsFirst, String hostNameInCertificate, String serverCertificateFilename)
at Microsoft.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at Microsoft.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire,
SqlConnectionString connectionOptions, Boolean withFailover)
at Microsoft.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean ign
oreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover)
at Microsoft.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean red
irectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout)
at Microsoft.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential,
String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance)
at Microsoft.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credenti
al, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, Sessio
nData reconnectSessionData, Boolean applyTransientFaultHandling, String accessToken, DbConnectionPool pool)
at Microsoft.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, D
bConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
at Microsoft.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, Db
ConnectionPoolKey poolKey, DbConnectionOptions userOptions)
at Microsoft.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection
)
at Microsoft.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConne
ction)
at Microsoft.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Bool
ean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
at Microsoft.Data.ProviderBase.DbConnectionPool.WaitForPendingOpen()
--- End of stack trace from previous location ---
at DAST.ConfigurationToolCLI.Services.DatabaseProviderService.SQLDatabaseProvider.ValidateDatabaseConnection(String connectionString) in C:\Jenkins\workspa
ce\WebInspect\DAST-Pipeline-23.2\DAST.ConfigurationToolCLI\Services\DatabaseProviderService\SQLDatabaseProvider.cs:line 355
ClientConnectionId:00000000-0000-0000-0000-000000000000
Validation error occurred. Error code: DboLevelDatabaseAccountLoginFailed. Error Message: Dbo level database account login failed.

  • Suggested Answer

    0  
    ValidateDatabaseConnection failed. Microsoft.Data.SqlClient.SqlException (0x80131904): A network-related or instance-specific error occurred while establishin
    g a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to al
    low remote connections. (provider: TCP Provider, error: 35 - An internal exception was caught)

    The SQLException TCP Provider, error 35 is generally an issue caused by encryption to the SQLServer. Try adding the following:

    Your issue came through our internal DL from one of architects in the field. There we notice some errors in your definition file:

    Checked the YAML file, not sure why you quote this whole line:

     "additionalConnectionProperties: TrustServerCertificate=True”

    But you should quote the password as @ is a special character for YAML:

        password: "red@cted"

    I would look back through your definition file to ensure there are no other issues. Also, you need to verify connectivity from inside a container to your SQLServer. There was mention you used SQLCMD, but was that from the host or from within a container?

  • 0 in reply to   

    I made the changes requested by the team but the issue still persist. I was able to connect to the DB using SQLCMD from both the host and container.. 

  • 0   in reply to 

    Do you have a support ticket opened for this issue? If so, can you send me the ticket number and be sure to upload the latest version of your DAST Config file.