470,814 Members | 1,203 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,814 developers. It's quick & easy.

Error during migration run: no PostgreSQL user name specified in startup packet

1 Bit
yarn migrate:run && yarn start
yarn typeorm migration:run --config ./lib/src/ormconfig
/usr/src/app/node_modules/.bin/typeorm migration:run --config ./lib/src/ormconfig
Error during migration run:
{ error: no PostgreSQL user name specified in startup packet
at Connection.parseE (/usr/src/app/node_modules/pg/lib/connection.js:606:11)
at Connection.parseMessage (/usr/src/app/node_modules/pg/lib/connection.js:403:19)
at Socket.<anonymous> (/usr/src/app/node_modules/pg/lib/connection.js:123:22)
at Socket.emit (events.js:193:13)
at addChunk (_stream_readable.js:295:12)
at readableAddChunk (_stream_readable.js:276:11)
at Socket.Readable.push (_stream_readable.js:231:10)
at TCP.onStreamRead (internal/stream_base_commons.js:154:17)
name: 'error',
length: 121,
severity: 'FATAL',
code: '28000',
detail: undefined,
hint: undefined,
position: undefined,
internalPosition: undefined,
internalQuery: undefined,
where: undefined,
schema: undefined,
table: undefined,
column: undefined,
dataType: undefined,
constraint: undefined,
file: 'postmaster.c',
line: '2217',
routine: 'ProcessStartupPacket' }
error Command failed with exit code 1.
Feb 20 '21 #1
1 3992
2,449 Expert Mod 2GB
Double check your ormconfig file at /lib/src/ormfconfig

It might look like this.
Expand|Select|Wrap|Line Numbers
  1. import { ConnectionOptions } from 'typeorm';
  3. const config: ConnectionOptions = {
  4.   type: 'postgres',
  5.   host: process.env.POSTGRES_HOST,
  6.   port: Number(process.env.POSTGRES_PORT),
  7.   username: process.env.POSTGRES_USER,
  8.   password: process.env.POSTGRES_PASSWORD,
  9.   database: process.env.POSTGRES_DB,
  10.   entities: [
  11.     __dirname + '/../**/*.entity{.ts,.js}',
  12.   ],
  13.   cli: {
  14.     migrationsDir: 'src/migrations',
  15.   }
  16. };
  18. export = config;
You might need to change your env variables. Or you can try manually inserting them in that file after the ":".

more information here:
Feb 25 '21 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

5 posts views Thread by Tony Wright | last post: by
3 posts views Thread by dstewart | last post: by
reply views Thread by Pavel N. Shtanko | last post: by
reply views Thread by Frank_00001 | last post: by
2 posts views Thread by ticars | last post: by
reply views Thread by mihailmihai484 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.