globus / globus-connect-server

Globus Connect Server
6 stars 10 forks source link

globus-connect-server-setup public_name() and public_ip() returning wrong values on specific non-ec2 system #21

Closed danpowers closed 5 years ago

danpowers commented 5 years ago

see https://globusonline.zendesk.com/agent/tickets/345764

globus-connect-server-setup public_name() and public_ip() returning wrong values on specific non-ec2 system.

Admin's system is CentOS7 system not running on an ec2 instance. From the admin's system, a host 169.254.169.254 is reachable with a web server listening on port 80, and it returns 404s formatted like so:

# curl -v http://169.254.169.254/latest/meta-data/public-hostname
* About to connect() to 169.254.169.254 port 80 (#0)
* Trying 169.254.169.254...
* Connected to 169.254.169.254 (169.254.169.254) port 80 (#0)
> GET /latest/meta-data/public-hostname HTTP/1.1
> User-Agent: curl/7.29.0
> Host: 169.254.169.254
> Accept: */*
>
< HTTP/1.1 404 Not Found
< Content-Length: 154
< Content-Type: text/html; charset=UTF-8
< Date: Thu, 02 May 2019 15:33:30 GMT
<
<html>
<head>
<title>404 Not Found</title>
</head>
<body>
<h1>404 Not Found</h1>
The resource could not be found.<br /><br />

</body>
* Connection #0 to host 169.254.169.254 left intact
</html>

The public_name() and public_ip() functions don't catch these 404 messages, causing the message contents to be dumped inappropriately into data_interface and defaults["HOSTNAME"].

The message gets dumped into data_interface if [GridFTP].DataInterface is not set in the gcs.conf file, causing it to show in the data_interface value in the /etc/gridftp.d/globus-connect-server file.

If "Server = %(HOSTNAME)s" is set, the message gets dumped into the server value for the service causing gcs-setup to fail like so:

Invalid value for Server in [GridFTP] section of /etc/globus-connect-server.conf: 404 Not Found

It was possible to work around the issue by having the admin set [GridFTP].DataInterface, [GridFTP].Server, and [MyProxy].Server to the appropriate FQDN hostname.

bester commented 5 years ago

Fixed in 4.0.56