Re: Probably something stupid -- cannot find SRV records and fails

From: Ronald Klop <ronald-lists_at_klop.ws>
Date: Tue, 16 Jul 2024 06:46:04 UTC
Van: Karl Denninger <karl@denninger.net>
Datum: 16 juli 2024 01:01
Aan: "freebsd-pkg@freebsd.org" <freebsd-pkg@freebsd.org>
Onderwerp: Probably something stupid -- cannot find SRV records and fails

> 
> 
> 
> 
> I have a Crochet build environment that runs on a native FreeBSD OS (on metal) without problems and has for quite some time.  I'm trying to move that build environment to a VM running on VirtualBox; the host is Windows 11.
> 
> Everything appears to work as expected normally, including pulling the source from HEAD, setting up a worktree for stable/14, doing a buildworld/kernel and such and in fact the crossbuild for ARM64 via Crochet -- except the package grab at the end for a set of packages I want on the embedded media output once the install of the system itself into the md is complete.
> 
> Again this works fine on my long-standing build box that runs on actual metal, and as far as I can tell there isn't any difference -- I have the same setup (to grab "latest" rather than "quarterly") in /etc/pkg/FreeBSD.conf, for example.
> 
> I am getting this, which is a replay (by hand) of what Crochet does at that point -- it does not chroot during the build and runs in the native (in this case AMD64) context, but with the "-c" flag to the mounted install filesystem for the pkg command (which is on an md):
> 
> # pwd
> /work/OBJ/ARM64-14-STABLE/_.mount.freebsd
> # env ASSUME_ALWAYS_YES=YES pkg -d -c . install rsync sshbuard ntimed ffmpeg mpg321 git
> DBG(1)[53612]> pkg initialized
> Updating FreeBSD repository catalogue...
> DBG(1)[53612]> PkgRepo: verifying update for FreeBSD
> DBG(1)[53612]> PkgRepo: need forced update of FreeBSD
> DBG(1)[53612]> Pkgrepo, begin update of '/var/db/pkg/repos/FreeBSD/db'
> DBG(1)[53612]> Request to fetch pkg+https://pkg.FreeBSD.org/FreeBSD:14:aarch64/latest/meta.conf
> DBG(1)[53612]> curl_open
> pkg: No SRV record found for the repo 'FreeBSD'
> DBG(1)[53612]> Fetch: fetcher used: pkg+https
> DBG(1)[53612]> curl> fetching https://pkg.FreeBSD.org/FreeBSD:14:aarch64/latest/meta.conf
> 
> DBG(1)[53612]> CURL> No mirror set url to https://pkg.FreeBSD.org/FreeBSD:14:aarch64/latest/meta.conf
> 
> DBG(1)[53612]> CURL> attempting to fetch from https://pkg.FreeBSD.org/FreeBSD:14:aarch64/latest/meta.conf, left retry 3
> 
> * Couldn't find host pkg.FreeBSD.org in the .netrc file; using defaults
> * Could not resolve host: pkg.FreeBSD.org
> * Closing connection
> DBG(1)[53612]> CURL> No mirror set url to https://pkg.FreeBSD.org/FreeBSD:14:aarch64/latest/meta.conf
> 
> DBG(1)[53612]> CURL> attempting to fetch from https://pkg.FreeBSD.org/FreeBSD:14:aarch64/latest/meta.conf, left retry 2
> 
> * Couldn't find host pkg.FreeBSD.org in the .netrc file; using defaults
> * Could not resolve host: pkg.FreeBSD.org
> * Closing connection
> DBG(1)[53612]> CURL> No mirror set url to https://pkg.FreeBSD.org/FreeBSD:14:aarch64/latest/meta.conf
> 
> DBG(1)[53612]> CURL> attempting to fetch from https://pkg.FreeBSD.org/FreeBSD:14:aarch64/latest/meta.conf, left retry 1
> 
> * Couldn't find host pkg.FreeBSD.org in the .netrc file; using defaults
> * Could not resolve host: pkg.FreeBSD.org
> * Closing connection
> pkg: An error occured while fetching package
> DBG(1)[53612]> Request to fetch pkg+https://pkg.FreeBSD.org/FreeBSD:14:aarch64/latest/meta.txz
> pkg: packagesite URL error for pkg+https://pkg.FreeBSD.org/FreeBSD:14:aarch64/latest/meta.txz -- pkg+:// implies SRV mirror type
> repository FreeBSD has no meta file, using default settings
> DBG(1)[53612]> Request to fetch pkg+https://pkg.FreeBSD.org/FreeBSD:14:aarch64/latest/data.pkg
> pkg: packagesite URL error for pkg+https://pkg.FreeBSD.org/FreeBSD:14:aarch64/latest/data.pkg -- pkg+:// implies SRV mirror type
> DBG(1)[53612]> Request to fetch pkg+https://pkg.FreeBSD.org/FreeBSD:14:aarch64/latest/data.txz
> pkg: packagesite URL error for pkg+https://pkg.FreeBSD.org/FreeBSD:14:aarch64/latest/data.txz -- pkg+:// implies SRV mirror type
> DBG(1)[53612]> Request to fetch pkg+https://pkg.FreeBSD.org/FreeBSD:14:aarch64/latest/packagesite.pkg
> pkg: packagesite URL error for pkg+https://pkg.FreeBSD.org/FreeBSD:14:aarch64/latest/packagesite.pkg -- pkg+:// implies SRV mirror type
> DBG(1)[53612]> Request to fetch pkg+https://pkg.FreeBSD.org/FreeBSD:14:aarch64/latest/packagesite.txz
> pkg: packagesite URL error for pkg+https://pkg.FreeBSD.org/FreeBSD:14:aarch64/latest/packagesite.txz -- pkg+:// implies SRV mirror type
> Unable to update repository FreeBSD
> Error updating repositories!
> #
> 
> What I don't understand here is that it works perfectly fine on a native host, and I don't see anything obvious.  I can ping pkg.freebsd.org:
> 
> # ping pkg.freebsd.org
> PING pkgmir.geo.freebsd.org (173.228.147.98): 56 data bytes
> 64 bytes from 173.228.147.98: icmp_seq=0 ttl=49 time=58.336 ms
> ^C
> --- pkgmir.geo.freebsd.org ping statistics ---
> 1 packets transmitted, 1 packets received, 0.0% packet loss
> round-trip min/avg/max/stddev = 58.336/58.336/58.336/0.000 ms
> 
> Further, a "fetch" against the first requested file (meta.conf) that the pkg command complains about succeeds:
> 
> # fetch https://pkg.FreeBSD.org/FreeBSD:14:aarch64/latest/meta.conf
> meta.conf                                              178  B 1687 kBps    00s
> 
> Any ideas on where to look?  I turned debugging on with "-d" because the original build was not giving me any idea of what was happening, but this appears to imply there's no connectivity out of the VM in that it can't resolve the hostname -- but there is, obviously.
> 
> Pkg against the base installed system works properly and have a decent number of packages installed (specifically git and its dependencies, which was loaded to grab the source tree of course.)
> 
> Thanks in advance.
> 
> -- 
> Karl Denninger
> karl@denninger.net
> /The Market Ticker/
> /[S/MIME encrypted email preferred]/
> 
> 
> 
> 
> 
> 
> 
> 



Pkg -c .
This does chroot. Did you configure /etc/resolv.conf in the arm64 mount?

try chroot . ping pkg.freebsd.org in that same directory. 

Regards,
Ronald