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

t3c: Status API fails because FQDN is used as a hostname #6174

Closed
smalenfant opened this issue Sep 8, 2021 · 2 comments · Fixed by #6187
Closed

t3c: Status API fails because FQDN is used as a hostname #6174

smalenfant opened this issue Sep 8, 2021 · 2 comments · Fixed by #6187
Labels
bug something isn't working as intended cache-config Cache config generation medium impact impacts a significant portion of a CDN, or has the potential to do so
Milestone

Comments

@smalenfant
Copy link
Contributor

smalenfant commented Sep 8, 2021

Depending how the system is configured, a call to os.HostName() might return the FQDN or the short name of the server. The status API requires a short hostname.

Current behavior:

ERROR: t3c-request.go:59: 2021-09-08T13:59:45.362466293Z: writing data: getting server 'cdn1cdedge0002.coxlab.net' update status: getting server update status: getting uncached: getting server update status from Traffic Ops 'REDACTED': Traffic Ops returned no update statuses for that server

Expected behavior:

Should use the short hostname. This is usually done using hostname -s

Steps to reproduce:

Make sure hostname returns the full FQDN. Run t3c-apply and observe the failure.

@smalenfant smalenfant added the bug something isn't working as intended label Sep 8, 2021
@smalenfant smalenfant added this to the 6.0.0 milestone Sep 8, 2021
@ocket8888 ocket8888 changed the title t3c: Status API fails become hostname FQDN is used t3c: Status API fails because FQDN is used as a hostname Sep 8, 2021
@mitchell852 mitchell852 added cache-config Cache config generation medium impact impacts a significant portion of a CDN, or has the potential to do so labels Sep 9, 2021
@mitchell852
Copy link
Member

categorizing as medium per @rob05c

@rob05c
Copy link
Member

rob05c commented Sep 9, 2021

Code is here: https://github.com/apache/trafficcontrol/blob/814f571/cache-config/t3c-apply/config/config.go#L368

Probably just needs something like:

cacheHostName = strings.Split(cacheHostName, ".")[0]

rob05c added a commit to rob05c/trafficcontrol that referenced this issue Sep 10, 2021
zrhoffman pushed a commit that referenced this issue Sep 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something isn't working as intended cache-config Cache config generation medium impact impacts a significant portion of a CDN, or has the potential to do so
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants