Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Messages showing host names that are IP addresses are ugly #43

Open
DrDaveD opened this issue Nov 1, 2023 · 0 comments
Open

Messages showing host names that are IP addresses are ugly #43

DrDaveD opened this issue Nov 1, 2023 · 0 comments

Comments

@DrDaveD
Copy link
Contributor

DrDaveD commented Nov 1, 2023

Messages showing host names that are passed in as IP addresses show the IP address twice, which is ugly. It's especially ugly with IPv6 addresses because of the extra square brackets around the address which is already in square brackets for the message. Reproduce with the following (using the IP addresses from cvmfs.fnal.gov):

$ echo 'select 1 from dual'| FRONTIER_SERVER="(failovertoserver=no)(proxyurl=http://$(host cvmfs.fnal.gov|sed -n 's/.* has address //p'):8000)(serverurl=http://cmsfrontier.cern.ch:8000/FrontierProd)" LD_LIBRARY_PATH=. ./fn-req
Entered:
select 1 from dual
Param [eNorTs1JTS5RMFRIK8rPVUgpTcwBAD0rBmw_]
Frontier exception caught: Can not get data (Additional Information: [frontier.c:1210]: No more proxies. Last error was: Request 1 on chan 1 failed at Wed Nov  1 17:06:20 2023: -8 [fn-htclient.c:444]: server error (HTTP/1.1 404 Not Found) proxy=131.225.189.138[131.225.189.138:8000] server=cmsfrontier.cern.ch)
$ echo 'select 1 from dual'| FRONTIER_SERVER="(failovertoserver=no)(proxyurl=http://[$(host cvmfs.fnal.gov|sed -n 's/.* has IPv6 address //p')]:8000)(serverurl=http://cmsfrontier.cern.ch:8000/FrontierProd)" LD_LIBRARY_PATH=. ./fn-req
Entered:
select 1 from dual
Param [eNorTs1JTS5RMFRIK8rPVUgpTcwBAD0rBmw_]
Frontier exception caught: Can not get data (Additional Information: [frontier.c:1210]: No more proxies. Last error was: Request 1 on chan 1 failed at Wed Nov  1 17:05:12 2023: -8 [fn-htclient.c:444]: server error (HTTP/1.1 404 Not Found) proxy=2620:6a:0:8421::244[[2620:6a:0:8421::244]:8000] server=cmsfrontier.cern.ch)

It is trying to show the host name followed by the address in square brackets, but it's confusing when the host name is already an IP address. Change it so that if the name of the host is already an IP address, only print out the address and port piece. That is, an IPv4 address would show up like 131.225.189.138:8000 and an IPv6 address would show up like [2620:6a:0:8421::244]:8000.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant