-
Notifications
You must be signed in to change notification settings - Fork 2.5k
TypeError: Cannot call method 'end' of undefined #513
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Your SQL-Query is wrong, therefor an error is given, which you do not catch or handle. INSERT INTO CellDataTemp (Type, MCC, MNC, LAC, Ci, RSSI, GPS_Lat, GPS_Lon, GPS_Uncert, Source)
VALUES (1,),(1, 460, 0, 6339, 41169, -75, 31.24599429, 121.60113167, 15, 1 The first row |
Hi Kai, Thanks for your reply! I think the sql statement recorded here is not correct. I had the correct sql but still got the same problem. I think the issue is related to EMFILE error of MySQL. I'm trying to figure out the root cause. Ryan |
I changed the log information, please see the detail below: [2013-06-19 09:33:52.863] [ERROR] syslog - SQL error code Level 1:EMFILE |
I changed the MySQL configuration open files from 1024 to 16384. However, sometimes the issue still happened when the concurrency level bigger than 1000 on JMeter: mysql@testmachine:~$ ulimit -a |
I am not sure this is a mysql problem. |
Yes, changing on mysql probably won't do. If you're not changing the limit globally (and rebooting after it), don't forget that changing limit in a shell won't change in the system. If you're on a Linux machine, you should be able to do command below when you see problems with the process and see how many open files there are: ls /proc/PID_OF_MYSQL/fd | wc -l ------- edited -------- |
Hi dresende, Thanks for your help! I used the command for monitoring what was really happened when the error occurred. It seems the root cause is the limitation is caused by the node program. Because MySQL and my node program on the different machine, I only changed the limitation on MySQL machine. So, after I changed the value on node program one, the issue fixed. Also thanks kai-koch's help! Thanks you guys! Regards, Ryan |
Hi all,
I used connection pool for my app for inserting records concurrently. There is the very strange issue when I use JMeter for simulating concurrency. If the threads less than 400, the app works fine. However, if I set thread to 1000, I got the following err:
[2013-06-18 15:27:52.628] [ERROR] syslog - SQL error: Error: connect EMFILE
[2013-06-18 15:27:52.629] [ERROR] syslog - SQL source: INSERT INTO CellDataTemp (Type, MCC, MNC, LAC, Ci, RSSI, GPS_Lat, GPS_Lon, GPS_Uncert, Source) VALUES (1,),(1, 460, 0, 6339, 41169, -75, 31.24599429, 121.60113167, 15, 1
[2013-06-18 15:27:52.628] [ERROR] syslog - SQL error: Error: connect EMFILE
[2013-06-18 15:27:52.629] [ERROR] syslog - SQL source: INSERT INTO DataTemp (ID, ID1, ID2, ID3, ID4, ID5, ID6, ID7, ID8, ID9) VALUES (1,),(1, 460, 0, 6339, 41169, -75, 31.24599429, 121.60113167, 15, 1
TypeError: Cannot call method 'end' of undefined
at /home/usr/nodeapps/agps/collectorhttpserver.js:55:24
at Handshake._callback (/home/usr/node_modules/mysql/lib/Pool.js:35:9)
at Handshake.Sequence.end (/home/usr/node_modules/mysql/lib/protocol/sequences/Sequence.js:66:24)
at Protocol.handleNetworkError (/home/usr/node_modules/mysql/lib/protocol/Protocol.js:238:14)
at Connection._handleNetworkError (/home/usr/node_modules/mysql/lib/Connection.js:157:18)
at Socket.EventEmitter.emit (events.js:117:20)
at net.js:426:14
at process._tickCallback (node.js:415:13)
My code is like below:
pool.getConnection(function(err, connection) {
connection.query( 'insert into table(x,x,x) values(x,x,x)', function(err, rows) {
connection.end();
});
});
It seems when the connection.end executed, it actually not created. I don’t know whether the issue caused by some optimized skills by V8 itself. Could anyone give me some helps?
The text was updated successfully, but these errors were encountered: