Skip to content

expected terminator at last byte error on node 0.6.6 #88

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

Closed
pvencill opened this issue Jan 19, 2012 · 3 comments
Closed

expected terminator at last byte error on node 0.6.6 #88

pvencill opened this issue Jan 19, 2012 · 3 comments

Comments

@pvencill
Copy link

I know this came up in previous versions of node, and it was patched, but I'm getting this error trying to do a parameterized insert:

STATEMENT: INSERT INTO web_user_sessions (sid, session, expires) values ($1,$2,$3)
LOG: execute : INSERT INTO web_user_sessions (sid, session, expires) values ($1,$2,$3)
DETAIL: parameters: $1 = '{hashed_session_id_extracted', $2 = '{"lastAccess":1327000512568,"cookie":{"originalMaxAge":14400000,"expires":"2012-01-19T23:15:12.573Z","httpOnly":true,"path":"/"}}', $3 = '2012-01-19 23:15:12.573'
LOG: connection received: host=127.0.0.1 port=49057
FATAL: invalid startup packet layout: expected terminator as last byte
LOG: unexpected EOF on client connection

The problem is occurring on Ubuntu 10.10 running postgres 9.1, node 0.6.6 and pg v0.6.9

I looked in writer.js and it looks like the pg source is updated with the described null terminator patch. It may also be significant that the same node app works fine locally in my dev box (running Mac OSX Lion, postgres 9.0.4, node 0.6.6 and pg v0.6.9) as well as on Heroku (but I know they're running node 0.4.7)

@brianc
Copy link
Owner

brianc commented Jan 24, 2012

Could I get a gist or some small code snippet to reproduce this (if possible please don't make it rely on your internal schema, but use a temp table or something similar so it runs on a fresh postgres install)?

@pvencill
Copy link
Author

pvencill commented Feb 8, 2012

Sorry for the delay; I spent some time trying to replicate the problem from the console on the server, unsuccessfully. It's likely something in my queries that I'm missing.

@pvencill pvencill closed this as completed Feb 8, 2012
@kristokaiv
Copy link

happened to me as well
client.query('SELECT * from myschemaname.user where email = $1::text', ['^(smth)'], function(err, result) { ....

server log: ^[^[[D2013-11-20 23:03:35 EET LOG: unexpected EOF on client connection

when i change it to email = 'somebody@somewhere' then all is fine. so it seems to be related with the parameters insertion.

System:

select version();

version

PostgreSQL 9.1.9 on x86_64-unknown-linux-gnu, compiled by gcc (Debian 4.7.2-5) 4.7.2, 64-bit
(1 row)

running on virtualbox VM, databases are utf-8 encoding. both client and server encodings are utf8

npm -v pg
1.3.14

brianc pushed a commit that referenced this issue Dec 27, 2019
* Update CI versions

PostgreSQL 9.1 is no longer available on 14.04.

* Add Node 9 to CI
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants