Solved pkg No address record

byrnejb

Well-Known Member

Reaction score: 27
Messages: 446

I am configuring a development jail to use an internal pkg repository populated by Poudriere. The /usr/local/etc/pkg/repos/Poudriere.conf file contains this:

Code:
Poudriere: {
  url: http://http://vhost01.internal.hamilton.harte-lyne.ca/poudriere/packages/freebsd_12_2x64-PORTS_12_2"
  enabled: yes
  }

When I use pkg inside this jail I get the following error:
Code:
[root@accounting-2 ~ (master)]# pkg search ncurses
pkg: Repository Poudriere missing. 'pkg update' required
pkg: http://http//vhost01.internal.hamilton.harte-lyne.ca/poudriere/packages/freebsd_12_2x64-PORTS_12_2"/meta.txz: No address record
pkg: http://http//vhost01.internal.hamilton.harte-lyne.ca/poudriere/packages/freebsd_12_2x64-PORTS_12_2"/packagesite.txz: No address record

pkg update
Updating Poudriere repository catalogue...
pkg: http://http//vhost01.internal.hamilton.harte-lyne.ca/poudriere/packages/freebsd_12_2x64-PORTS_12_2"/meta.txz: No address record
repository Poudriere has no meta file, using default settings
pkg: http://http//vhost01.internal.hamilton.harte-lyne.ca/poudriere/packages/freebsd_12_2x64-PORTS_12_2"/packagesite.txz: No address record
Unable to update repository Poudriere
Error updating repositories!

However, drill shows that the domain name is resolved by DNS:

Code:
drill vhost01.internal.hamilton.harte-lyne.ca A
;; ->>HEADER<<- opcode: QUERY, rcode: NOERROR, id: 53997
;; flags: qr aa rd ra ; QUERY: 1, ANSWER: 1, AUTHORITY: 4, ADDITIONAL: 4
;; QUESTION SECTION:
;; vhost01.internal.hamilton.harte-lyne.ca.    IN    A

;; ANSWER SECTION:
vhost01.internal.hamilton.harte-lyne.ca.    172800    IN    A    192.168.216.41
. . .

drill -x 192.168.216.41
;; ->>HEADER<<- opcode: QUERY, rcode: NOERROR, id: 10688
;; flags: qr aa rd ra ; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2
;; QUESTION SECTION:
;; 41.216.168.192.in-addr.arpa.    IN    PTR

;; ANSWER SECTION:
41.216.168.192.in-addr.arpa.    38400    IN    PTR    vhost01.internal.hamilton.harte-lyne.ca.

Actually, I would prefer to simply provide the IPv4 address and avoid the DNS nonsense but url: http://192.168.216.41/ . . . gives the same error.

This behaviour evidently prevents pkg from finding, or at least using, the repository. Why does pkg report it cannot find that which drill can?
 

astyle

Daemon

Reaction score: 626
Messages: 1,415

Take a good look at the URL...
http://http://vhost01.internal.hamilton.harte-lyne.ca/poudriere/packages/freebsd_12_2x64-PORTS_12_2
Note the double http://

Shouldn't it be just one?

Edit your Poudriere.conf (oh, and double-check your pkg.conf for good measure).
 
OP
B

byrnejb

Well-Known Member

Reaction score: 27
Messages: 446

Cut and paste error to the message box. The correct url is in the config file.

Code:
cat /usr/local/etc/pkg/repos/Poudriere.conf
# Must start apache24 on host with /usr/local/etc/apache24/poudriere.d/poudriere.conf
Poudriere: {
# url: http://192.168.216.41/poudriere/packages/freebsd_12_2x64-PORTS_12_2"
  url: http://vhost01.internal.hamilton.harte-lyne.ca/poudriere/packages/freebsd_12_2x64-PORTS_12_2"
  enabled: yes
  }

pkg search ncurses
pkg: Repository Poudriere missing. 'pkg update' required
pkg: http://192.168.216.41/poudriere/packages/freebsd_12_2x64-PORTS_12_2"/meta.txz: Not Found
pkg: http://192.168.216.41/poudriere/packages/freebsd_12_2x64-PORTS_12_2"/packagesite.txz: Not Found

pkg search ncurses
pkg: Repository Poudriere missing. 'pkg update' required
pkg: http://vhost01.internal.hamilton.harte-lyne.ca/poudriere/packages/freebsd_12_2x64-PORTS_12_2"/meta.txz: Not Found
pkg: http://vhost01.internal.hamilton.harte-lyne.ca/poudriere/packages/freebsd_12_2x64-PORTS_12_2"/packagesite.txz: Not Found

It does not matter if I use the numeric IP address or the domain name. The result is the same.
 

astyle

Daemon

Reaction score: 626
Messages: 1,415

Then this points to the idea that the Poudriere repo is not published properly on your internal network. As in, the folder structure on your Poudriere server is not visible to other machines via the HTTP protocol. drill can find the host, which is good, which means the problem is with local config on the host. Check your apache.conf file, and see if you can publish a simple web page.
 
OP
B

byrnejb

Well-Known Member

Reaction score: 27
Messages: 446

I failed to add the output of wget, which works.
Code:
wget
wget http://vhost01.internal.hamilton.harte-lyne.ca/poudriere/packages/freebsd_12_2x64-PORTS_12_2/meta.txz
--2021-07-23 17:16:30--  http://vhost01.internal.hamilton.harte-lyne.ca/poudriere/packages/freebsd_12_2x64-PORTS_12_2/meta.txz
Resolving vhost01.internal.hamilton.harte-lyne.ca (vhost01.internal.hamilton.harte-lyne.ca)... 192.168.216.41
Connecting to vhost01.internal.hamilton.harte-lyne.ca (vhost01.internal.hamilton.harte-lyne.ca)|192.168.216.41|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 796
Saving to: 'meta.txz.2'

meta.txz.2            100%[=======================>]     796  --.-KB/s    in 0s     

2021-07-23 17:16:30 (113 MB/s) - 'meta.txz.2' saved [796/796]


This is what a web browser shows:
Code:
Index of /poudriere/packages/freebsd_12_2x64-PORTS_12_2
     Name    Last modified    Size
     Parent Directory          -
     .latest/     2021-07-23 10:52     -
     .real_1627051924/     2021-07-23 10:52     -
     All/     2021-07-23 10:51     -
     Latest/     2021-07-23 10:52     -
     .buildname     2021-07-23 10:51     21
     .jailversion     2021-07-23 10:51     16
     meta.conf     2021-07-23 10:52     163
     meta.txz     2021-07-23 10:52     796
     packagesite.txz     2021-07-23 10:52     101K

[RANT]I really dislike this ajax editor.[/RANT]
 

astyle

Daemon

Reaction score: 626
Messages: 1,415

So... wget works, web browser works... then poudriere.conf on your server is the next thing to try...

But seriously, on your own internal network, I would discourage doing anything terribly complicated - that makes it hard to debug your own setup later. Setting stuff up for security is good, but lining stuff up - that's a LOT of work, and it requires taking some good notes that you don't get lost in.

In your opening post, you used pkg inside a jail, right? then there might be something about the way you set up that jail. Jails are good for limiting network traffic in and out. I personally don't have a very good handle on working with jails.
 
OP
B

byrnejb

Well-Known Member

Reaction score: 27
Messages: 446

I do not know how I managed to remove the leading double quote from the paste above, but it is present in the actual conf file:
The contents of /usr/local/etc/pkg/repos/Poudriere.conf are:
Code:
Poudriere_12-2-http: {
#   url: "http://192.168.216.41/poudriere/data/packages/freebsd_12-2x64-PORTS-12-2",
    url: "http://192.168.216.41/poudriere/packages/freebsd_12-2x64-PORTS-12-2",
#   mirror_type: "http",
#    signature_type: "pubkey",
#    pubkey: "/usr/local/etc/pki/tls/certs/ca.harte-lyne.hamilton.vhost04.crt",
#    enabled: no
    enabled: yes
}
 
OP
B

byrnejb

Well-Known Member

Reaction score: 27
Messages: 446

The jail is, and has been, used to connect to the internet without difficulty. The jail can use pkg to install and update packages from freebsd.org. As the jail DNS resolution works, as does a wget http retrevial, and pkg can retrieve packages from the freebsd.org repositories, then there is no reason to believe that a network configuration issue is involved.

I believe that I have found the problem.

url: "http://192.168.216.41/poudriere/packages/freebsd_12_2x64-PORTS_12_2/"

url: "http://192.168.216.41/poudriere/packages/freebsd_12-2x64-PORTS-12-2/"

The one that works has an underscore instead of a dash (12_2 instead of 12-2). Both repos exist, probably because I cannot type.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 12,685
Messages: 39,278

Didn't you run into issues with your naming convention? Don't use a dash (-) in your poudriere jail or ports naming. I'm betting the one with a dash is from your older attempts, just remove those directories entirely to avoid confusion (the package directories aren't cleaned when you delete a jail or a ports tree in poudriere).
 
OP
B

byrnejb

Well-Known Member

Reaction score: 27
Messages: 446

Didn't you run into issues with your naming convention? Don't use a dash (-) in your poudriere jail or ports naming. I'm betting the one with a dash is from your older attempts, just remove those directories entirely to avoid confusion (the package directories aren't cleaned when you delete a jail or a ports tree in poudriere).
Yes I did. Which is why I switched to the underscore to build. However, I mistyped the repo name in the pkg repo config file. And I have removed the dash directories now.
 

astyle

Daemon

Reaction score: 626
Messages: 1,415

# mirror_type: "http",
One thing I'm spotting in your Poudriere.conf is the line I'm quoting from your post... mirror_type: "http", seems to be commented out. I'm not sure if that even helps, but sometimes things do get commented out by accident, and then nothing works. I've run into that kind of issue elsewhere, on a different topic, but the idea is the same.
 
OP
B

byrnejb

Well-Known Member

Reaction score: 27
Messages: 446

I now have a different question, which I will ask in another thread.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 12,685
Messages: 39,278

For my custom repos I only have an url and an enabled, nothing else.
 
OP
B

byrnejb

Well-Known Member

Reaction score: 27
Messages: 446

One thing I'm spotting in your Poudriere.conf is the line I'm quoting from your post... mirror_type: "http", seems to be commented out. I'm not sure if that even helps, but sometimes things do get commented out by accident, and then nothing works. I've run into that kind of issue elsewhere, on a different topic, but the idea is the same.
Those lines are artifacts of various trials of mine when trying to discover what was wrong. I got tired to retyping things. Particularly given my penchant for mistyping. Commented line evidently have no impact on pkg.
 

astyle

Daemon

Reaction score: 626
Messages: 1,415

byrnejb : Have you considered editors/nano? It's one of the most forgiving editors when it comes to typos. I know it's possible to do something like # echo 'linprocfs /proc linprocfs rw 0 0' >> /etc/fstab, or use ee or ed or vi, but these are very unforgiving when it comes to typos.
 
OP
B

byrnejb

Well-Known Member

Reaction score: 27
Messages: 446

I may take a look later. At the moment it would inconvenient in the extreme to change editors.
 

astyle

Daemon

Reaction score: 626
Messages: 1,415

FWIW, I don't even bother specifying a default editor in my (or root's) .profile... I install nano from get get-go.
 
Top