How to fix 'DnsClient.DnsResponseException' error in mongodb driver for Net Core? - mongodb

I'm trying to debug my project but sometimes when do a query to mongodb atlas I get the error:
But sometimes the error does not occur. How do I fix it? 3 days unable to work.
Inner Exception:
Error: Cannot read byte 245, out of range.System.IndexOutOfRangeException: Cannot read byte 245, out of range. at DnsClient.DnsDatagramReader.ReadByte() at DnsClient.DnsDatagramReader.ReadLabels() at DnsClient.DnsDatagramReader.ReadQuestionQueryString() at DnsClient.DnsRecordFactory.ReadRecordInfo() at DnsClient.DnsMessageHandler.GetResponseMessage(ArraySegment`1 responseData) at DnsClient.DnsUdpMessageHandler.Query(IPEndPoint server, DnsRequestMessage request, TimeSpan timeout) at DnsClient.LookupClient.ResolveQuery(DnsMessageHandler handler, DnsRequestMessage request, Audit continueAudit)

I had the error for 3 days, already desperate changed my DNS setting to:
Solved! 🤷‍♂️

Related

Randomly Login Timeout Expired errors from SQL 2000 DTS against SQL2008R2 databases

I have some JOBs running on SQL Server 2000, which are calling stored procedures or queries against remote SQL Servers (different editions).
The JOB calls a DTS, and is the DTS who does the remote connection and executes the Stored Procedure or gets a query results from the remote server.
This has been working without errors for years. I don't know why during the last month, I'm having randomly errors on these kind of jobs... I've read some other posts and seems to be related to a security issue, but I repeat, the most of times the jobs are working, only some runs are failing with the error.
Executed as user: SERVER\user. DTSRun: Loading... DTSRun: Executing...
DTSRun OnStart: DTSStep_DTSDynamicPropertiesTask_2 DTSRun OnError:
DTSStep_DTSDynamicPropertiesTask_2, Error = -2147467259 (80004005)
Error string: Login timeout expired Error source: Microsoft OLE DB
Provider for SQL Server Help file: Help context: 0
Error Detail Records: Error: -2147467259 (80004005); Provider Error: 0 (0)
Error string: Login timeout expired Error source: Microsoft OLE DB Provider for SQL Server
Help file: Help context: 0 DTSRun OnFinish:
DTSStep_DTSDynamicPropertiesTask_2 DTSRun: Package execution complete.
Process Exit Code 1. The step failed.
I really don't know what to check. After reboot the server the problems are still there. Any help from you guys would be appreciated.
EDIT 2019-02-14 16:15 -------------------------------------------------------------------------------------------
One of the solutions I found has been to change the Remote Login Timeout property from the default 20 seconds to 30 seconds, or to 0 (Zero means without timeout), by executing the next code:
sp_configure 'remote login timeout', 30 --Or 0 seconds for infinite
go
reconfigure with override
go
From: https://support.microsoft.com/es-es/help/314530/error-message-when-you-execute-a-linked-server-query-in-sql-server-tim
I've tried this solution changing it to 30 seconds, but with the same result. Of course I didn't set it to 0 for obvious reasons, the timeouts are there for something. And also tried 300 seconds (5 minutes to make a login!) and still the same.
EDIT 2019-02-25 11:25 -------------------------------------------------------------------------------------------
Very similar to my problem, still not solved...
https://www.sqlservercentral.com/Forums/Topic1727739-391-1.aspx
For the moment I have a temp solution, and it is to increase the Connect Timeout on the Connection object.
It was blank (probably using its default value).
Since I changed this property (Connection Object > Advanced... > Connect Timeout) to 300 I'm not having the problems on these DTS. I leaved 2 DTS without the change to ensure I continued having the problem, and these are the only ones which continue having the problem. The changed ones are working fine now.

Delphi failover needs to reconnect to the database

I was trying to implement the failover available here
http://www.andreanolanusse.com/en/implementing-failover-and-load-balancing-in-datasnap-2010/
but if I add a database connection and kill the first server, when I use some of the remote functions or '.open' a TClientDataSet 2 times, it throws an exception and I need to reconnect to the database again.
Expected: '{' found: '-+0-9.' at position: 84
{"result":[{"rows":[0]},{"data":[44,#192#16#0(nabas - (Server 213) pacote36-trafegusgr]}]}#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
(the error message contains about 23000 of those '#0')
It works if I reconnect but when you have to implement in a system that have hundreds of '.open' and remote method calls it isn't the best option.
And since the error is only thrown the second time I click the button and call the method, it looks like it doesn't need to reconnect, it must be something I'm doing wrong.
Here's the project:
https://drive.google.com/file/d/0B6YhWGZN7O24Zl9pYkx6d3hrdDA/view?usp=sharing
it uses the postgresql connection from devart (DevartPostgreSQL)

IBM BLUEMIX BLOCKCHAIN SDK-DEMO failing

I have been working with HFC SDK for Node.js and it used to work, but since last night I am having some problems.
When running helloblockchain.js only few times works, most time I get this error when it tries to enroll a new user:
E0113 11:56:05.983919636 5288 handshake.c:128] Security handshake failed: {"created":"#1484304965.983872199","description":"Handshake read failed","file":"../src/core/lib/security/transport/handshake.c","file_line":237,"referenced_errors":[{"created":"#1484304965.983866102","description":"FD shutdown","file":"../src/core/lib/iomgr/ev_epoll_linux.c","file_line":948}]}
Error: Failed to register and enroll JohnDoe: Error
Other times, the enroll works and the failure appears deploying the chaincode:
Enrolled and registered JohnDoe successfully
Deploying chaincode ...
E0113 12:14:27.341527043 5455 handshake.c:128] Security handshake failed: {"created":"#1484306067.341430168","description":"Handshake read failed","file":"../src/core/lib/security/transport/handshake.c","file_line":237,"referenced_errors":[{"created":"#1484306067.341421859","description":"FD shutdown","file":"../src/core/lib/iomgr/ev_epoll_linux.c","file_line":948}]}
Failed to deploy chaincode: request={"fcn":"init","args":["a","100","b","200"],"chaincodePath":"chaincode","certificatePath":"/certs/peer/cert.pem"}, error={"error":{"code":14,"metadata":{"_internal_repr":{}}},"msg":"Error"}
Or:
Enrolled and registered JohnDoe successfully
Deploying chaincode ...
E0113 12:15:27.448867739 5483 handshake.c:128] Security handshake failed: {"created":"#1484306127.448692244","description":"Handshake read failed","file":"../src/core/lib/security/transport/handshake.c","file_line":237,"referenced_errors":[{"created":"#1484306127.448668047","description":"FD shutdown","file":"../src/core/lib/iomgr/ev_epoll_linux.c","file_line":948}]}
events.js:160
throw er; // Unhandled 'error' event
^
Error
at ClientDuplexStream._emitStatusIfDone (/usr/lib/node_modules/hfc/node_modules/grpc/src/node/src/client.js:189:19)
at ClientDuplexStream._readsDone (/usr/lib/node_modules/hfc/node_modules/grpc/src/node/src/client.js:158:8)
at readCallback (/usr/lib/node_modules/hfc/node_modules/grpc/src/node/src/client.js:217:12)
E0113 12:15:27.563487641 5483 handshake.c:128] Security handshake failed: {"created":"#1484306127.563437122","description":"Handshake read failed","file":"../src/core/lib/security/transport/handshake.c","file_line":237,"referenced_errors":[{"created":"#1484306127.563429661","description":"FD shutdown","file":"../src/core/lib/iomgr/ev_epoll_linux.c","file_line":948}]}
This code worked yesterday, so I don't know what could be happening.
Does anybody know how can I fix it?
Thanks,
Javier.
ibm-bluemix
blockchain
These types of intermittent issues are usually related to GRPC. An initial suggestion is to ensure that you are using at least GRPC version 1.0.0.
If you are using a Mac, then the maximum number of open file descriptors should be checked (using ulimit -n). Sometimes this is initially set to a low value such as 256, so increasing the value could help.
There are a couple of GRPC issues with similar symptoms.
https://github.com/grpc/grpc/issues/8732
https://github.com/grpc/grpc/issues/8839
https://github.com/grpc/grpc/issues/8382
There is a grpc.initial_reconnect_backoff_ms property that is mentioned in some of these issues. Increasing the value past the 1000 ms level might help reduce the frequency of issues. Below are instructions for how the helloblockchain.js file can be modified to set this property to a higher value.
Open the helloblockchain.js file in the Hyperledger Fabric Client example and find the enrollAndRegisterUsers function.
Add “grpc.initial_reconnect_backoff_ms": 5000 to the setMemberServicesUrl call.
chain.setMemberServicesUrl(ca_url, {
pem: cert, "grpc.initial_reconnect_backoff_ms": 5000
});
Add “grpc.initial_reconnect_backoff_ms": 5000 to the addPeer call.
chain.addPeer("grpcs://" + peers[i].discovery_host + ":" + peers[i].discovery_port,
{pem: cert, "grpc.initial_reconnect_backoff_ms": 5000
});
Note that setting the grpc.initial_reconnect_backoff_ms property may reduce the frequency of issues, but it will not necessarily eliminate all issues.
The connection to the eventhub that is made in the helloblockchain.js file can also be a factor. There is an earlier version of the Hyperledger Fabric Client that does not utilize the eventhub. This earlier version could be tried to determine if this makes a difference. After running git clone https://github.com/IBM-Blockchain/SDK-Demo.git, run git checkout b7d5195 to use this prior level. Before running node helloblockchain.js from a Node.js command window, the git status command can be used to check the code level that is being used.

EF4 EntityException - The underlying provider failed on Open

Okay, this is a new one. I'm trying to debug my project, which I've done many times in the past, and I'm now getting this exception in one of my repositories. I haven't seen it before now. I haven't touched my repos in days, and my connection string is the same as its always been. The inner exception states:
{"A network-related or instance-specific error occurred while establishing 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 allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)"}
And the code it's choking on is:
public class HGArticleRepository : IArticleRepository
{
private HGEntities _siteDB = new HGEntities();
public List<Article> Articles
{
get { return _siteDB.Articles.ToList(); } // <-- this is the line
}
// more repo code
}
Again, like I said, I've never encountered this exception before, and I haven't touched my domain code in days.
This error usually means:
Connection String points to nonexistent SQL Server.
Connection String points to SQL Server that was shut down. Or not started.
Named pipes transport was disabled in SQL Server settings.
Check them carefully one by one. In your case I guess it is 2.
A second option of solution:
Review that IIS is running.
In my case it was stopped, so I got the same error.

SSL_Connection failed with SSL_ERROR_SYSCALL with errno=2?

SSL_Connect API is failing with return value 5 errno=2.
can any one help me in how to trace the same? can any one let me know what could cause this issue?
OS: Windows 2003 Std Sp2 32 bit
You can use following APIs to check the error further as it will store the error as a string in buf.
value = ERR_get_error();
ERR_error_string_n(value,buf,sizeof buf);
Furthermore, I also received this error when I added "SET_MODE_AUTO_RETRY" to CTX object and created an SSL object. I removed it and made changes to retry on my own in case of some error after some delay.
Another check you can do is what port value are you using? If it is not 443 then please try with 443; it may help.
I am also new to this so just sharing what I tried in order to resolve these issues.