Skip to content

feat(handler): log iata.find failures in Register - #101

Open
nkinkade wants to merge 4 commits into
mainfrom
sandbox-kinkade
Open

nkinkade wants to merge 4 commits into
mainfrom
sandbox-kinkade

Conversation

@nkinkade

@nkinkade nkinkade commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Summary

When a node registers with an IATA code that is not present in the ip2location airport dataset, Register returns a 500 with error type iata.find. This branch was the only 500 path in Register that emitted no server-side log, so the failure was invisible in App Engine logs and could only be diagnosed by reading the code and inspecting raw request URLs.

This adds a single log line capturing the offending IATA code, org, and service, so future occurrences are identifiable directly from the logs.

Motivation

A Milan autonode was switched from IATA LIN (Milan-Linate airport) to MIL. MIL is a valid IATA metropolitan code, but our dataset (ip2location-iata-icao.csv) is airport-keyed and contains no metropolitan codes, so iata.Find("mil") fails and the node gets a 500 on every registration attempt (observed: 323 consecutive 500s over ~14 days). Nothing appeared in App Engine logs because this error branch didn't log — diagnosing it required reading the handler source. The Type/Title fields are returned to the client in the JSON body but never recorded server-side; this closes that observability gap.

Change

log.Printf("iata find failure: iata %q not in dataset (org=%s, service=%s): %v",
    iata, param.Org, param.Service, err)

Consistent with the existing log.Println(...) calls in the same handler (dns register / tracker / service-account-key failures), with the IATA code, org, and service added so the log line is self-identifying.

Testing

  • go build ./... passes
  • go test ./handler/ ./iata/ passes
  • Cloud Build on sandbox-kinkade (mlab-sandbox) green, including deploy

🤖 Generated with Claude Code


This change is Reviewable

nkinkade and others added 4 commits December 18, 2025 13:43
If the requested service is "ndt7" or "ndt7_client", then the Autojoin API
should not return, for example, Wehe servers.

Prometheus (well, gcp-service-discovery) queries the Autojoin API for
script-exporter targets for ndt7 e2e testing. The list endpoint should not
return machines running experiments that are not compatible with the requested
service.
See the change in this commit to understand what the comment was added for,
which may not have previously been obvious.
When a node registers with an IATA code that is not present in the
ip2location airport dataset (e.g. a metropolitan code like MIL rather
than an airport code like LIN), Register returns a 500 with error type
"iata.find". This branch was the only 500 path in Register that emitted
no server-side log, so the failure was invisible in AppEngine logs and
could only be diagnosed by reading the code and inspecting request URLs.

Add a log line capturing the offending iata code, org, and service so
future occurrences are identifiable directly from the logs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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

Successfully merging this pull request may close these issues.

1 participant