#[SOLVED] node 18 runtime error

47 messages · Page 1 of 1 (latest)

cobalt harbor
#

I have appwrite running in WSL (win10).
After deploying a function, the build fails:

this error appears:
Docker Error: npm ERR! code EAI_AGAIN
npm ERR! syscall getaddrinfo
npm ERR! errno EAI_AGAIN
npm ERR! request to https://registry.npmjs.org/node-appwrite failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.org

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2023-04-13T23_42_01_039Z-debug-0.log

woeful scaffold
cobalt harbor
woeful scaffold
cobalt harbor
#

It is installed in a fresh WSL instance (ubuntu 20.04) and a new instance of appwrite

cobalt harbor
woeful scaffold
cobalt harbor
#

inside ubuntu (not inside the container)

woeful scaffold
woeful scaffold
cobalt harbor
#

I got the same result using portainer console

woeful scaffold
# cobalt harbor

so that first one is the problem..im not sure why it can't resolve the domain name

woeful scaffold
# cobalt harbor

what's the result of

docker compose exec appwrite-executor docker run --rm -it openruntimes/node:v2-18.0 sh

And then in the container:

cat /etc/resolve.conf
cobalt harbor
woeful scaffold
#

This might also be helpful to try:

docker compose exec appwrite-executor nslookup registry.npmjs.org
cobalt harbor
#

note the file name is resolv not resolve

cobalt harbor
woeful scaffold
woeful scaffold
cobalt harbor
#

I've made a ping to the registry ip:
docker compose exec appwrite-executor docker run --rm openruntimes/node:v2-18.0 ping 104.16.16.35
it works

PING 104.16.16.35 (104.16.16.35): 56 data bytes
64 bytes from 104.16.16.35: seq=0 ttl=52 time=83.673 ms

but the name doesn't resolve D:

woeful scaffold
#

How did you set up/install Appwrite?

cobalt harbor
woeful scaffold
cobalt harbor
#

then I just do docker compose up -d

#

and successfully access to console and create databases and collections, also i run successfully with the cli

woeful scaffold
cobalt harbor
cobalt harbor
cobalt harbor
# woeful scaffold And docker subnets too

@woeful scaffold you are going to kill me 😅
I was reading this https://askubuntu.com/a/1419872 then i remember that i have a paid kaspersky in this laptop. I suspended it and it works.
I apologize, i have many laptops.

Now the build return:

added 10 packages, and audited 11 packages in 6s

1 package is looking for funding
  run `npm fund` for details

found 0 vulnerabilities
woeful scaffold
cobalt harbor
#

Thanks again

#

[SOLVED] node 18 runtime error

cobalt harbor
# woeful scaffold Wow interesting...thanks for letting me know!

Hi Steven, I was digging inside the problem. I don't know how kaspersky was involved with wsl, but indeed there was a conflict with subnet ip.

docker0 ip-range si 172.17.0.0/16 and my wsl ip is 172.17.240.1 (the same that the runtime container is using for nameserver) that was the reason why "nslookup registry.npmjs.org". For docker 172.17.240.1 is a container.

I try to change wsl ip, but it seems easier to change docker0 ip-range. To change it I used daemon.json. For anyone who needs, here is a guide:
https://medium.com/codebrace/understanding-docker-networks-and-resolving-conflict-with-docker-subnet-ip-range-bfaad092a7ea

Thank you again, I hope this is useful for someone with the same problem.

Medium

As we all know, By default Docker creates 3 networks automatically 
Bridge, Host, and None network.

woeful scaffold
cobalt harbor
#

I think kaspersky block many things, i have node js in wsl and i was getting errors (that cannot connect to registry.npmjs.org when using npm install), other errors about self signed certs, etc etc.

cobalt harbor
cobalt harbor
#

The ip-range for WSL is 172.16.0.0/12 being the minimun 172.16.0.0 and the maximum 172.31.255.255
So the daemon.json ip-range should be 172.32.0.1/16 to avoid future conflicts