Failed to download image ... on 127.0.0.2:53: no such host

Hi I am getting this error often when updating the application in OpenBalena:

Failed to download image ‘registry..com/v2/5a8fad87778dd00e977ed2c5af1320a9@sha256:c12e071188f203fa9e12dba843d3ab0d61e7364c918270f66479c8cb6706090d’ due to '(HTTP code 500) server error - Get https://registry..com/v2/: dial tcp: lookup registry..com on 127.0.0.2:53: no such host ’

any help is appreciated!

Hi

This issue seems to be in your configuration: the registry is being reported as https://registry..com/v2/5a8fad8.... which is missing your domain.

Has this setup been working OK previously, or is this the first time you have tried this? Have you modified any of the files in the ./config directory which is produced when you initialise the instance?

Hi

This issues happens randomly, sometimes it takes a few reboots or “balena deploy” to overcome this. I also try using the “–nocache” option in “deploy”; seems to help sometimes.

When I posted my question, I intentionally changed the URL to https://registry.MyApp,com/, that’s why you don’t see the name in full.

thanks

If to take the error message (“no such host”) at face value, and given the intermittent nature of the issue, could it be a name resolution problem? (DNS server problem?) Is registry.MyApp.com “statically registered” with an internet domain registrar (like, for the sake of argument, godaddy.com), or is it some dynamic DNS setup, or even a .local domain name? In the case of the two latter, flaky resolution is possible. As it happens, someone in this other (unrelated) thread was getting a similar error, and they concluded it was because of using a .local domain name:

I may be completely off track in this comment, but I thought I’d raise it anyway. :slight_smile:

Hi

I have registered these names in our internal DNS server, where server.myAppName.com is our server that hosts our hub application and is also where OpenBalena resides:

api.myAppName.com 10.0.0.107
registry.myAppName.com 10.0.0.107
vpn.myAppName.com 10.0.0.107
s3.myAppName.com 10.0.0.107
dashboard.myAppName.com 10.0.0.107
server.myAppName.com 10.0.0.107

This issue doesn’t not always happen, but when it does it seems to take a few reboots and/or deploys to overcome.

Hi @yylee,

I’ve come across something similar before (although not using OpenBalena), on a network which was running multiple DNS servers. Is it possible that there’s another server handing out DHCP leases/DNS resolution (which would explain reboots until a new lease points to the ‘right’ DNS server)?

Alternatively, do you have any sort of DNS propagation going on internally which might cause this?

Balena devices can be manually configured using the config.json in the boot partition of an image to use specific DNS servers (see https://github.com/balena-os/meta-balena/blob/master/README.md#dnsservers for information on the tag). You should be able to create a new image for your device and add { "dnsServers": "<internalDnsServer>" } to the config.json in the boot partition before flashing to a device to achieve this. If this works consistently, it sounds like it may indeed be a duplicate DHCP/DNS server issue.

Best regards, Heds

Thanks @hedss, I will investigate in this direction.