when this error come how to solve this error - mysql

I am developing an app in node.js socke.io redis mysql , so this error arrvied some time don't know when it arrived and how to find where this error come , how to solve this error .?
node.js:178
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: ETIMEDOUT, Connection timed out
at Socket._onConnect (net.js:600:18)
at IOWatcher.onWritable [as callback] (net.js:186:12)**strong text**

I believe I read somewhere on stackoverflow or someplace that socket.io is not yet completely comptatible with 0.5.0-pre. Could you try the latest official build v0.4.8 instead and report back?
That's correct :). I read it on stackoverflow.com and found the link to it also: node v0.5.0 pre Socket.IO crashes on connection (independent of transport)

This is caused by a socket error emitting an "error" event, but not finding any listeners for "error" events. In this case, node converts the event into an exception.
So the simple thing to check is make sure that you are listening for errors on all of your connections.
There is a tricky bug right now where some sockets emit errors before, or possibly after the user code can be listening for errors. I see this a lot when doing HTTPS. If you are hitting this uncatchable error situation, there's not much you can do about this besides changing node to not convert those socket errors into exceptions. If you can come up with a reliable way to reproduce this issue, it'll get fixed much more quickly.

Related

Cannot read property 'query' of undefined error: mysql and node.js

I'm trying to send information from android to mysql database through express server (using node js)
however there seems to be a problem in the code, it keeps showing error, but I just can't find what's wrong.
I think there's problem with connection.query statement.
Actually this is not my code, but it's the source code of my teacher. I checked everything in the android twice, but there's nothing wrong. There's gotta be something wrong here :(
This is what it is keep saying. Please help :( Stock for few days...
When you call the getConnection() method, the callback function passed to it should check for errors first. The reason you're running into the "cannot get property of undefined" error is most likely because the connection object is never returned and therefore undefined, probably because getConnection() encounters an error.
Try adding an error check condition and log the error to see why getConnection() fails:
mysql_connection_info.getConnection(function(err, connection) {
// check for errors in getting the connection
if(err) {
console.log(err)
return
}
// carry on with the actual query if there are no errors
})
I think you are missingmysql_connection_info.connect()
place it just after creating the connection pool.

Wakanda server start JSON error unexpected EOF

WAK 1.1.3 - during solution load, get a backend error:
[Backend] Error
[Backend] SyntaxError: JSON Parse error: Unexpected EOF
But it is not clear what file has this issue. How to most efficiently isolate this? I see nothing in the logs. The application has been running stably. I assume this is in a method, but am not finding it after a thorough search.
Thanks for guidance.
Kirk
Unexpected EOF error could be as small as forgetting to close function body with a right curly bracket.
I recommend first checking all the code on the backend you have modified since the last successful restart.
Secondly, since this occurs during solution load, the error is likely in bootstrap code including login listener. Or in model.js. You could try comment out all code in bootstrap.js or model.js see if the solution can load.

Autodesk DM API: Is Retry appropriate here?

I've got an application that's been working for a long time.
Recently we created a new app/keys for it, and it's behaving strangely.
(I did figure out the scope requirements had been put in place. I am requesting bucket:create bucket:read data:read data:write).
When I upload a file to a bucket, I've traditionally called done the call to get the object details afterwards, to verify that it's successfully uploaded.
With the new key, I am intermittently getting this error:
GetObjectDetails: InternalServerError {"fault":{"faultstring":"Execution of ServiceCallout servicecallout-auth-acm-request failed. Reason: timeout occurred servicecallout-auth-acm-request","detail":{"errorcode":"steps.servicecallout.ExecutionFailed"}}}
Is this something I should be re-trying with a sleep in between? or is it indicative of something wrong with the upload?
(FYI - putting in a retry seems to have have resolved this for me, but I still don't know if that's the right answer - and if this issue might happen on other calls).
It could be that the service requires a slight delay between a put object and a get, so I would suggest either use a timer or a retry as you mentioned. However a successful response from the upload should be enough to ensure your object has been placed to the bucket without the need to double check.

How to solve authentication problems in facebook

I am creating an application that until yesterday seemed to work, but this morning, performing a function as I always do, it turns out this message:
"Fatal error: Uncaught OAuthException: An active access token must be used to query information about the current user. Thrown in ../base_facebook.php on line 1254"
Where am I doing wrong?
you Try to clean the cookies and cache from your firefox browser and try to execute your application once again...and check if you are app works in firefox this time...

How to handle socket error during logout routine

I am writing an instant messaging library. Currently, when a SocketException is raised while reading or writing to the socket, I start the logout routine from inside the application, passing the SocketException to the enduser as an argument of the LogoutEventArgs. This gives the end user a way of seeing what underlying exception actually caused the unrequested logout.
My question, is what am I to do, if during a user call to the Logout function, the socket actually throws an Exception.
Example - End user calls Logout function, and while the logout function is waiting for existing requests to end gracefully, the socket throws an exception in the reading thread.
I have two options as I see it -
Pretend the error didn't occur, and just act like the socket disconnected as part of our Logout.
When the socket exception is raised, see if a logout request is taking place, and if so, override it. Resulting in the original Logout request throwing an AlreadyLoggedOutException, as well as a separate logout event which passes the exception in the LogoutEventArgs.
Also, slightly related - What am I to do if the server initiates a shutdown that wasn't requested (ie.. the read call returns null).. the .NET Messenger server has a tendency to do this if you send a request it doesn't like. Do I treat this as an exception in itself?
I have found the whole disconnecting/logging out part of my library to be a major thorn in my side. I just can't seem to wrap my head around it. Does anyone know of any open source code applications that handle this situation beautifully?
I have been trying to tackle this thing in my head for so long, it's driving me mad.
I decided not to pass the SocketException to the end user, as a disconnect is not truly an exception and should be expected and dealt with. Instead there is a LogoutReason property on the LogoutEventArgs which specifies why the logout occured.
I decided that if the disconnect occurs during Logout then that's not actually an exception for, as the logout was going to disconnect anyway. I simply disregard the exception in this case.