We are experimenting with running xrootd in a docker container, and have found that xrootd dislikes hostnames that begin with numerical digits. Inside the docker container, the hostname is configured as a (seemingly random) hexadecimal sequence, which began with the digit '3' in our instance. This triggered an error on xrootd startup: XrdConfig: unable to determine host name.

Going deeper, in src/Xrd/XrdConfig.cc:372, we see a call to new XrdNetAddr((int)0). The constructor for XrdNetAddr calls gethostname, then XrdNetAddr::Set, where the problem is triggered. On src/XrdNet/XrdNetAddr.cc:227, we see else if (*hSpec >= '0' && *hSpec <= '9'), which is used to detect whether the hostname is in a colon-hex or dotted decimal format. If true, inet_pton is called, passing the input address hSpec. inet_pton assumes that its input is in one of the two formats, or it returns 0. In this case, hSpec is filled by gethostname, which returns the generated hexadecimal hostname.

The correct behavior is probably to use a more sophisticated means of detecting the format of hSpec, so such hostnames can be passed to the last else branch.


Reply to this email directly or view it on GitHub.



Use REPLY-ALL to reply to list

To unsubscribe from the XROOTD-DEV list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=XROOTD-DEV&A=1