On our machine (Windows Server 2012R2), we have an ASP.net website that uses Crystal Reports (2008) for some reports. The database is SQL Server 2014. Here is the code related to the error:
ConnectionInfo cnnInfo = new ConnectionInfo();
cnnInfo.ServerName = serverName;
cnnInfo.DatabaseName = dbName;
cnnInfo.UserID = userId;
cnnInfo.Password = password;
ReportDocument rd = new ReportDocument();
rd.Load(rptUrl);
RptViewer.ReportSource = rd;
CrystalDecisions.CrystalReports.Engine.Database rptDb = rd.Database;
TableLogOnInfo tblLogOnInfo = new TableLogOnInfo();
foreach (CrystalDecisions.CrystalReports.Engine.Table tbl in rptDb.Tables)
{
tblLogOnInfo = tbl.LogOnInfo;
tblLogOnInfo.ConnectionInfo = cnnInfo;
tbl.ApplyLogOnInfo(tblLogOnInfo);
tbl.Location = tbl.Location.Substring(tbl.Location.LastIndexOf(".") + 1);
}
Here is the error that happens at this line:
tbl.Location = tbl.Location.Substring(tbl.Location.LastIndexOf(".") + 1);
Logon failed.
Details: ADO Error Code: 0x
Source: Microsoft OLE DB Provider for SQL Server
Description: [DBNETLIB][ConnectionOpen (SECCreateCredentials()).]SSL Security error.
SQL State: 08001
Native Error: Error in File C:\Windows\TEMP\EventByEventTypeCrossTab {FC74CD56-B1FF-4B06-9566-B927D660617D}.rpt:
Unable to connect: incorrect log on parameters.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Runtime.InteropServices.COMException: Logon failed.
Details: ADO Error Code: 0x
Source: Microsoft OLE DB Provider for SQL Server
Description: [DBNETLIB][ConnectionOpen (SECCreateCredentials()).]SSL Security error.
SQL State: 08001
Native Error: Error in File C:\Windows\TEMP\EventByEventTypeCrossTab {FC74CD56-B1FF-4B06-9566-B927D660617D}.rpt:
Unable to connect: incorrect log on parameters.
Note that the same database account is used to read the database and display info in the browser without any problem.
How can I fix it?
I got it working finally. Here is what I did:
Upgrade to .NET framework 4.7.2
Install CR for .NET framework 4
Followed the solution in this link:
https://community.ipswitch.com/s/article/How-to-resolve-SSL-Security-error-and-SECCreateCredentials-failures-in-Admin-Console-and-ODBC-connections-after-disabling-SSL-and-TLS1-0-protocols-on-the-WhatsUp-Gold-server
Restart the server.
Related
I'm using Azure Cosmos DB 4.0 with MongoDB C# Driver 2.10.4.
Most of the times the queries work fine, but I'm getting intermittent errors like this:
MongoDB.Driver.MongoConnectionException: An exception occurred while sending a message to the server.
System.IO.IOException: Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host.
System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
at System.Net.Sockets.Socket.BeginSend(...
at System.Net.Sockets.NetworkStream.BeginWrite
--- End of inner exception stack trace ---
at System.Net.Sockets.NetworkStream.BeginWrite
at System.Net.Security._SslStream.StartWriting
at System.Net.Security._SslStream.ProcessWrite
at System.Net.Security._SslStream.BeginWrite
When that error happens the call takes 10-25 seconds before failing.
I'm building the MongoClient with new MongoClient(MongoClientSettings.FromConnectionString(cnstr)) and I was using the connectionstring with these arguments ?ssl=true&replicaSet=globaldb&retrywrites=false.
I tried with retryWrites=true (as per Azure Support suggestion) but that didn't help.
I tried different settings and that didn't work either (connect=direct, maxIdleTimeMS=30000, serverSelectionTimeout=5000ms, socketTimeout=10000ms).
What's causing those exceptions?
The fix was to set/force TLS 1.2 (based on this Microsoft document):
//return new MongoClient(connectionString);
var settings = MongoClientSettings.FromConnectionString(connectionString);
settings.SslSettings = new SslSettings()
{
EnabledSslProtocols = System.Security.Authentication.SslProtocols.Tls12
};
return new MongoClient(settings);
Looks like although my connection string had ssl=true, it wasn't enough to work on some servers (the error is intermittent). The same underlying error can usually be fixed by forcing TLS 1.2 so I assumed that in Mongo it could be the same issue - and it really fixed the problem.
I am getting error while generating PDF and HTML from Crystal report.
The same is working fine in SIT, Only UAT gives me problem.
Here is the error.
164143 [12/06/2020 13:26:30:571] [default task-3] ERROR com.crystaldecisions.reports.dataengine - QueryEngine error: verify database failed.
164165 [12/06/2020 13:26:30:593] [default task-3] ERROR com.crystaldecisions.reports.reportdefinition - com.crystaldecisions.reports.queryengine.driverImpl.m: JDBC Error: Function "GET_DISPLAY_AMT" not found; SQL statement:
When i execute the SQL in SQL client, i didn't get any issues.
Appreciate someone help on this.
Application Platform:
EAP 7.1
RHEL Linux
Oracle : 12c
I'M running SQL queries (client side) from DB2 databases using ibm_db & ibm_db_dbi using pandas. However one of our datasource implemented new security.I'm running Python3.7 and DB2 11.0
Below is my current connection string:
dsn = (
"DRIVER={{IBM DB2 ODBC DRIVER}};"
"DATABASE={0};"
"HOSTNAME={1};"
"PORT={2};"
"PROTOCOL=TCPIP;"
"UID={3};"
"PWD={4};"
"Security={5};"
"SSLClientKeystoredb={6};"
"SSLClientKeystoreDBPassword={7};").format(dsn_database, dsn_hostname, dsn_port, dsn_uid, dsn_pwd, dsn_security, dsn_keystore, dsn_keypwd)
And I have an error message:
Exception Traceback (most recent call last)
in ()
----> 1 con= ibm_db.connect(dsn, "", "")
SQLCODE=-1109on: [IBM][CLI Driver] SQL1109N The specified DLL "GSKit Error: 202" could not be loaded. SQLSTATE=42724
I also look for GSKit and install it in my machine, then put it on the Path for environment variable but error still persists.
Hope you can help me with this problem.
I am using nHibernate + Npgsql to connect to PostgreSQL server using windows authentication (SSPI). I have added the windows user to the Postgres and have configured the settings as recommended by http://wiki.postgresql.org/wiki/Configuring_for_single_sign-on_using_SSPI_on_Windows.
Here is my connection string:
"Server=;Port=5432;Database=;Integrated Security=true"
This is my code:
if (!sessionFactories.TryGetValue(sessionFactoryConfigPath, out sessionFactory))
{
Configuration cfg = new Configuration();
if (sessionFactoryConfigPath != DefaultConfigFile)
{
//Check.Require(File.Exists(sessionFactoryConfigPath),
// "The config file at '" + sessionFactoryConfigPath + "' could not be found");
cfg.Configure(sessionFactoryConfigPath);
}
else
{
cfg.Configure();
}
// Now that we have our Configuration object, create a new SessionFactory
sessionFactory = cfg.BuildSessionFactory();
When I run this I get the following error at sessionFactory = cfg.BuildSessionFactory();
"FATAL: XX000: could not accept SSPI security context"
When I checked the PostgreSQL logs the following entry was found:
"The token supplied to the function is invalid (80090308)"
I am using "PostgreSQL 9.3.2, compiled by Visual C++ build 1600, 32-bit". I got it from postgres website. I am using Windows 7 SP1 64-bit.
What am I missing here? Please help.
I have Windows 7, Microsoft SQL Server 2008 R2 and Visual Studio 2010.
First question: I don't change my password in sql, although my security its setting follow:
server authentication: sql server windows authentication mode
login auditing: Failed logins only
and for user sa or any users:
permission: Grant
Login: Enabled
but, my any password will 32 numbers.
Second question:
Then, I never can connect to database in Visual Studio, such as Entity Framework way, with uid and with Integrated Security=True;User Instance=True;
So, when I ctrl+f5 in VS, and I expect true working my app and ajax, I instead get error.
My code:
function FillGrid() {
$.ajax({
url: "ajax_process.aspx?cmd=FillGrid",
type: "POST",
data: null,
async: true,
success: function (dataFromServer) {
d = eval("(" + dataFromServer + ")");
alert(d[0].email);
},
error: function (XMLResponse) {
alert(XMLResponse.responseText);
}
});
}
My error is alert:
The user instance login flag is not supported on this version of SQL Server. The connection will be closed.
and:
SqlException (0x80131904): The user instance login flag is not supported on this version of SQL Server. The connection will be closed.]
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +6352224
User Instances are a Sql Server Express only feature.
This is how to do fix this in VS 2010:
In VS2010 IDE, right-click on your database > Modify Connection > Advanced > Source.
In source change User Instance to false then in Sql Explorer panel refresh to see your database contents - that's all that's needed.
Note: some times you need to delete User Instance = true; in your connection string (that for example you use in your data access class).
Add new ADO.net entity data model
In the wizard: select 'EF designer from database'
Select new connection button
Change data source from 'microsoft sql server' to 'microsoft sql server database file'
Browse your database.