R
Railwayā€¢5mo ago
Faith

GetAddrInfoReqWrap.onlookup FAILING my deployment

GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:108:26) { #12 7.515 errno: -3008, #12 7.515 code: 'ENOTFOUND', #12 7.515 syscall: 'getaddrinfo', #12 7.515 hostname: 'postgres.railway.internal' #12 7.515 } hey everyone i get this error and i have no idea why this is happening it worked perfectly before adding migrations being build beforehand
Solution:
"start": "sleep 3 && node build/index.js && yarn sync && yarn migrate:run",
"start": "sleep 3 && node build/index.js && yarn sync && yarn migrate:run",
...
Jump to solution
39 Replies
Percy
Percyā€¢5mo ago
Project ID: 05fccf62-810b-455f-83a0-a63bcb5042c0
Faith
Faithā€¢5mo ago
05fccf62-810b-455f-83a0-a63bcb5042c0
"build": "tsc && yarn sync && yarn migrate:run",
"sync": "cd build && npx typeorm migration:generate ./migration/Init -o -d ./data-source.js",
"migrate:run": "cd build && npx typeorm migration:run -d ./data-source.js",
"build": "tsc && yarn sync && yarn migrate:run",
"sync": "cd build && npx typeorm migration:generate ./migration/Init -o -d ./data-source.js",
"migrate:run": "cd build && npx typeorm migration:run -d ./data-source.js",
Fragly
Fraglyā€¢5mo ago
could you try adding a 3 second sleep in in your start command?
Faith
Faithā€¢5mo ago
im not using the start at all sir its when the docker is being build
Fragly
Fraglyā€¢5mo ago
oh yea, private neworking is not available during build, you'd need to place migrations in your start command
Faith
Faithā€¢5mo ago
oh shizzle lemme test it sir one sec
"start": "ts-node src/index.ts && yarn sync && yarn migrate:run",
"start": "ts-node src/index.ts && yarn sync && yarn migrate:run",
like this?
Fragly
Fraglyā€¢5mo ago
perhaps, see if it works ( although I wouldn't recommend running typescript in production )
Faith
Faithā€¢5mo ago
it shouldnt run typescript it should build then use the build right wait omg no its ts-node hahaahaha its first time doing this bare with me "start": "node ./build/index.ts && yarn sync && yarn migrate:run",
Fragly
Fraglyā€¢5mo ago
all good šŸ™‚
Faith
Faithā€¢5mo ago
allrighttyyy lemme test now my orm is giving me errors šŸ˜”
Faith
Faithā€¢5mo ago
No description
Faith
Faithā€¢5mo ago
i can copy paste text if this is not readable
Fragly
Fraglyā€¢5mo ago
could you try
"start": "sleep 3 && node ./build/index.ts && yarn sync && yarn migrate:run",
"start": "sleep 3 && node ./build/index.ts && yarn sync && yarn migrate:run",
Attacler/Bart
Attacler/Bartā€¢5mo ago
are you using alpine?
Faith
Faithā€¢5mo ago
idk this i didnt do anything but connect my app yes sir where can i check?
Attacler/Bart
Attacler/Bartā€¢5mo ago
easiest way of trying is to add ENABLE_ALPINE_PRIVATE_NETWORKING=true to the env variables
Faith
Faithā€¢5mo ago
what does this do?
Fragly
Fraglyā€¢5mo ago
It removes the fallback DNS server
Fragly
Fraglyā€¢5mo ago
if you don't have a dockerfile and you're simply building a node app then you're likely not using an alpine based image
Faith
Faithā€¢5mo ago
yea i just conencted and it used nix or something and did its thing WAIT THE SLEEP WORKED LOL
Fragly
Fraglyā€¢5mo ago
yea I think you're cool then neat!
Faith
Faithā€¢5mo ago
can i ask why sleep šŸ˜‚ i would never have guessed that was the issue
Fragly
Fraglyā€¢5mo ago
Private Networking takes a bit to initialize, so we delay your start command a little to give it some time to initialize
Attacler/Bart
Attacler/Bartā€¢5mo ago
@Fragly cant you skip that by using this?
Faith
Faithā€¢5mo ago
when it builds does it make a folder called /build? because my entites cant be found by my orm now šŸ˜­
Fragly
Fraglyā€¢5mo ago
I don't think so, that will cause more trouble if anything it causes both public and private networking to take a little to initialize instead of just private networking
Faith
Faithā€¢5mo ago
{
"compilerOptions": {
/* Basic Options */
"incremental": true,
"target": "es6",
"module": "commonjs",
"outDir": "build",
{
"compilerOptions": {
/* Basic Options */
"incremental": true,
"target": "es6",
"module": "commonjs",
"outDir": "build",
it should create a build dir right
Fragly
Fraglyā€¢5mo ago
looks like it
Faith
Faithā€¢5mo ago
okayokay ez fix man thank you so much!! im moving my client to this no more droplets šŸ˜­
Fragly
Fraglyā€¢5mo ago
oh try this
Solution
Fragly
Fraglyā€¢5mo ago
"start": "sleep 3 && node build/index.js && yarn sync && yarn migrate:run",
"start": "sleep 3 && node build/index.js && yarn sync && yarn migrate:run",
Faith
Faithā€¢5mo ago
i already fixed the .js
Fragly
Fraglyā€¢5mo ago
we set it to build/index.ts before, instead of build/index.js oh
Faith
Faithā€¢5mo ago
IT WORKS šŸ˜­ THANK!!!
Fragly
Fraglyā€¢5mo ago
<:chad_moment:758939193967378442> no problem
Faith
Faithā€¢5mo ago
im buying u coffee as we speak @Fragly dont have moeny on my card i wrote it down on my reminder when i get paid
Fragly
Fraglyā€¢5mo ago
Thank you so much ā¤ļø šŸ˜­
Faith
Faithā€¢5mo ago
ā¤ļø