Back

Function Failed host lookup

  • 0
  • Self Hosted
  • Functions
laurencetroyv
1 May, 2024, 22:37

as the title suggest, my function cannot look up to my appwrite console. it's just giving me error

TypeScript
Exception: AppwriteException: , Failed host lookup: 'my.domain.tech' (0)
#0      main (package:account/main.dart:144)
<asynchronous suspension>
#1      Future.any.onValue (dart:async/future.dart:608)
<asynchronous suspension>
TL;DR
Developers having trouble with host lookup issues. It's suggested to use a CNAME record pointing to the main domain. The developer set `_APP_DOMAIN_FUNCTIONS` and set up DigitalOcean networking correctly. The issue might be with DNS servers, IPv6, or firewall settings. Checking the `/etc/hosts` file and performing curl tests inside and outside the server can help diagnose the problem. The domain itself is confirmed to be working fine.
laurencetroyv
1 May, 2024, 22:39

tried running docker ps -a command to see what's error, and all seems running good

Steven
1 May, 2024, 22:58

does that domain name work?

laurencetroyv
1 May, 2024, 23:54

Yes, the domain name is working correctly

Steven
1 May, 2024, 23:57

something is screwing up your dns records. try doing a curl from inside the runtime container

Steven
1 May, 2024, 23:58

and on your server

laurencetroyv
2 May, 2024, 00:03

How do I do it?

laurencetroyv
2 May, 2024, 10:07

found it tried curl my.domain.tech its saying could not resolve host

laurencetroyv
2 May, 2024, 10:07

tried it in my server, it gets an error but trying it outside my server it doesn't give an error

Steven
3 May, 2024, 00:06

tried it in my server What do you mean?

Steven
3 May, 2024, 00:06

check your /etc/hosts to see if something weird is being done with your domain routing.

either that or maybe firewall

laurencetroyv
4 May, 2024, 02:18

What do you mean? I connected to my server using ssh command and then I used curl inside it but it returns could not resolve host

check your /etc/hosts I have not changed anything in my hosts file but this is the result when checking the file

TypeScript
GNU nano 6.2
/etc/hosts
Your system has configured 'manage_etc_hosts' as True.
As a result, if you wish for changes to this file to persist
then you will need to either
a.) make changes to the master file in /etc/cloud/templates/hosts.debian . tmp1
b.) change or remove the value of 'manage_etc_hosts' in
/etc/cloud/cloud.cfg or cloud—config from user—data
127. O. 1.1 Otoscopia Otoscopia
127.0.O.1 localhost
# The following lines are desirable for IPv6 capable hosts
: : 1 localhost ip6—10caIhost ip6—Ioopback
#02: :1 ip6—aIInodes
ff@2: : 2 ip6—a11routers

either that or maybe firewall I have setup a firewall to only allow inbound connection of ssh port 22 and https port 443 while the outbound rules are :

TypeScript
Name        Protocol    Port Range
ICMP        ICMp
All TCP     TCP         All ports
All UDP     UDP         All ports
laurencetroyv
4 May, 2024, 02:23

I could ping my server inside the ssh terminal, but on the outside it returns Request timed out. this was supposed to be working a few weeks ago

laurencetroyv
4 May, 2024, 02:23

kinda weird why is it acting this way

Steven
4 May, 2024, 02:49

Ok so if you can't curl from your server (not even inside the container) it definitely won't work in the container

Steven
4 May, 2024, 02:56

Maybe it's an ipv6 problem?

Steven
4 May, 2024, 02:58

Or maybe the DNS server your server is using is different/special?

laurencetroyv
4 May, 2024, 02:59

I have a question, I set my _APP_DOMAIN_FUNCTIONS=functions.mydomain.tech and I setup my digitalocean networking Type A to *.functions.mydomain.tech with the value of my digitalocean droplet, is this correct?

Steven
4 May, 2024, 03:00

You should be using a cname record pointing to your main domain.

This shouldnt cause this problem though

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