Have installed postgresql in x86 platform using command apt-get install postgresql.
While running npm install-test for the package facing error: no PostgreSQL user name specified in startup packet
Please guide me on solving this issue. Thanks in advance.
Please find below complete logs in x86_64 paltform:
root@30aeeb1c8338:/node-postgres# npm install-test
npm WARN [email protected] requires a peer of ajv@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of pg@>5.0 but none is installed. You must install peer dependencies yourself.
audited 313 packages in 3.153s
found 0 vulnerabilities
[email protected] test /node-postgres
make test-all
Starting lint
node_modules/.bin/eslint lib
Testing optional native install
Cannot find module 'pg-native'
error-tests.js
connection emits stream errors โ
connection emits ECONNRESET errors during normal operation โ
connection does not emit ECONNRESET errors during disconnect โ
connection does not emit ECONNRESET errors during disconnect also when using SSL โ
connection emits an error when SSL is not supported โ
connection emits an error when postmaster responds to SSL negotiation packet โ
outbound-sending-tests.js...................
startup-tests.js.........
inbound-parser-tests.js..........................................................
environment-variable-tests.js............
creation-tests.js.................?.....
utils-tests.js.......................
query-queue-tests.js.........
escape-tests.js................
configuration-tests.js............
prepared-statement-tests.js...........
simple-query-tests.js..............?..
cleartext-password-tests.js..
stream-and-query-error-interaction-tests.js.
early-disconnect-tests.js
throw-in-type-parser-tests.js
emits error โ
calls callback with error โ
rejects promise with error โ
md5-password-tests.js....
result-metadata-tests.js.......
notification-tests.js.
Testing connection
(node:11074) UnhandledPromiseRejectionWarning: error: no PostgreSQL user name specified in startup packet
at Connection.parseE (/node-postgres/lib/connection.js:553:11)
at Connection.parseMessage (/node-postgres/lib/connection.js:378:19)
at Socket.
at Socket.emit (events.js:182:13)
at addChunk (_stream_readable.js:283:12)
at readableAddChunk (_stream_readable.js:264:11)
at Socket.Readable.push (_stream_readable.js:219:10)
at TCP.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)
(node:11074) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:11074) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Testing Pure Javascript
bound-command-tests.js..
{ error: no PostgreSQL user name specified in startup packet at Connection.parseE (/node-postgres/lib/connection.js:553:11) at Connection.parseMessage (/node-postgres/lib/connection.js:378:19) at Socket.
Message: Connection error
Error: Connection error
at Connection.
at Connection.emit (events.js:182:13)
at Socket.
at Socket.emit (events.js:182:13)
at addChunk (_stream_readable.js:283:12)
at readableAddChunk (_stream_readable.js:264:11)
at Socket.Readable.push (_stream_readable.js:219:10)
at TCP.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)
xargs: node: exited with status 255; aborting
Makefile:53: recipe for target 'test-integration' failed
make: * [test-integration] Error 124
npm ERR! Test failed. See above for more details.
Hi @ossdev07 i'm getting the same error when running my project in a docker image. It runs fine locally though (in macos machine).
Did you manage to solve the issue?
@haikyuu Issue got resolved after i have set my own password to postgres user. Below are the steps i have followed to resolve:
1) Need to set environment variables PGUSER and PGDATABASE as export PGDATABASE=postgres and export PGUSER=postgres
2) Need to install libpq-dev.
3) Set password for postgres user as postgres, for example.
4) Update password as postgres from null in lib/default.js, configuration-test.js.
Thank you @ossdev07
I solved my issue as weel. It's indeed environment variables issue. ๐
I guess we can close this issue
Most helpful comment
@haikyuu Issue got resolved after i have set my own password to postgres user. Below are the steps i have followed to resolve:
1) Need to set environment variables PGUSER and PGDATABASE as export PGDATABASE=postgres and export PGUSER=postgres
2) Need to install libpq-dev.
3) Set password for postgres user as postgres, for example.
4) Update password as postgres from null in lib/default.js, configuration-test.js.