Back

[SOLVED] node 18 runtime error

  • 0
  • Self Hosted
  • Functions
Drake
14 Apr, 2023, 00:57

Thats good it works in the executor...still bizarre it doesn't work in the runtime container...

TL;DR
The user was experiencing a runtime error in Node 18. They discovered that there was a conflict with the subnet IP and an IP used by the runtime container. They solved the issue by changing the docker0 IP range using the daemon.json file. Additionally, they realized that a paid version of Kaspersky was causing issues and disabling it resolved the problem. The issue was ultimately resolved.
Drake
14 Apr, 2023, 00:58

Is there maybe an ip or subnet conflict with that ip address and another docker network or container?

danilo73
14 Apr, 2023, 00:59

I will check it on portainer

danilo73
14 Apr, 2023, 01:02

No there is no other network or ip

danilo73
14 Apr, 2023, 01:03

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

TypeScript
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:

Drake
14 Apr, 2023, 01:04

How did you set up/install Appwrite?

danilo73
14 Apr, 2023, 01:05

with the default docker compose yml, version 1.3.1 https://appwrite.io/install/compose

Drake
14 Apr, 2023, 01:06

And what did you do with that?

And what about the .env file?

danilo73
14 Apr, 2023, 01:08

The .env file, the same as the official appwrite site. https://appwrite.io/install/env

I change .env vars: secrets, runtimes (only node 18), db, etc

danilo73
14 Apr, 2023, 01:09

then I just do docker compose up -d

danilo73
14 Apr, 2023, 01:09

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

Drake
14 Apr, 2023, 01:10

Sounds fine...

The only thing I can think of is a subnet/IP conflict. Otherwise, I'm not sure

danilo73
14 Apr, 2023, 01:13

Thank you so much for your time. I will try to check the ips in windows and wsl

Drake
14 Apr, 2023, 01:14

And docker subnets too

danilo73
14 Apr, 2023, 01:15

Ok

danilo73
14 Apr, 2023, 02:26

@Steven 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:

TypeScript
added 10 packages, and audited 11 packages in 6s

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

found 0 vulnerabilities
Drake
14 Apr, 2023, 02:27

Wow interesting...thanks for letting me know!

danilo73
14 Apr, 2023, 02:27

Thanks again

danilo73
14 Apr, 2023, 02:28

[SOLVED] node 18 runtime error

danilo73
15 Apr, 2023, 04:48

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.

Drake
15 Apr, 2023, 04:49

This sort of makes sense...I'm still baffled at how Kaspersky fit in and why things worked after you turned it off 🧐

danilo73
15 Apr, 2023, 04:54

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.

danilo73
15 Apr, 2023, 05:08

Or kaspersky had nothing to do, and I made a mistake while trying to repair docker.

Other thing I noticed is that WSL has a dynamic IP, it changes after restart windows. But to avoid possible conflicts i will use daemon.json

danilo73
15 Apr, 2023, 05:27

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

Drake
15 Apr, 2023, 14:33

That sounds like a good plan πŸ‘

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more