mysql2 reports EPIPE error instead of ER_BAD_FIELD_ERROR
See original GitHub issueI’m using mysql2
in knex
, which in turn is used in a bookshelf
model.
When I attempt to insert a model that has a field that doesn’t exist in the table mysql2
returns this error:
{ [Error: insert into `test_table` (`create_time`, `text1`, `text2`, `text3`, `text4`, `nonexistent_column`, `text5`) values ('2016-05-04 15:52:17.174', 'http://google.com', '2016-05-04 15:52:11.512', 'http://yahoo.com', 2, 3, 1
) - This socket has been ended by the other party] code: 'EPIPE', fatal: true }
However, given the exact same scenario but using mysql
instead the error is:
[Error: insert into `test_table` (`create_time`, `text1`, `text2`, `text3`, `text4`, `nonexistent_column`, `text5`) values ('2016-05-04 16:05:54.726', 'http://google.com', '2016-05-04 16:05:46.093', 'http://yahoo.com', 2, 3, 1
) - ER_BAD_FIELD_ERROR: Unknown column 'nonexistent_column' in 'field list']
This is incredibly misleading and I’m not sure why EPIPE is returned by mysql2
(or maybe it’s knex?).
mysql2
version is 1.0.0-rc.1.
mysql
version is 2.10.2
Issue Analytics
- State:
- Created 7 years ago
- Comments:14 (6 by maintainers)
Top Results From Across the Web
Maximum query length to avoid EPIPE error in node.js
I had this issue just now and it turned out that the Mysql server I was talking to (it was on Amazon RDS)...
Read more >what is a "write EPIPE" error? - Google Groups
Any ideas on what I'm doing wrong? EPIPE means that writing of (presumably) the HTTP request failed because the other end closed the...
Read more >write EPIPE error on generating html to pdf
Hi Team, I'm trying to generate html to pdf using html-pdf npm . Please check below code const invoicePath = path.resolve(path.join(__dirname,
Read more >mysql2 - npm
fast mysql driver. Implements core protocol, prepared statements, ssl and compression in native JS. Latest version: 2.3.3, last published: a ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
FYI, this what it turned out to be https://github.com/felixge/node-mysql/issues/1411
Connection was lost due to db failover and the pool library that
knex
uses didn’t reacquire one automatically.Sure!
The table is as follows:
and data being inserted is