Gatehouse still dials the old port INC-2378

Open3 versionsNetworking · Easy · Fix · about 20 min ·Linux

Lab machine

A private Linux machine with the problem already set up. Sessions last up to 60 minutes.
Mara Okafor opened INC-2378 at 14:35SEV-3

At 14:28 Ivo cut Waybill over to its green build on a new port. At 14:32 every scanner request through Gatehouse started coming back 502. Waybill answers fine on its own, and the label portal behind the same Gatehouse still works.

Gatehouse is the edge: scanners, the tracking site, and the label portal all reach their services through it. A blue/green cutover moved Waybill to a new port, and somewhere between the edge and the app the change did not arrive.

"Waybill answers on its own, I checked. Don't restart Gatehouse, it carries the label portal for all eight depots. Reload it." (Mara)

A proxy runs the configuration it last loaded, merged from several files. Find out what it is actually dialling, and why, before you change anything.

Your task

Get the scanners' requests through Gatehouse to Waybill green again. Leave Waybill where the cutover put it, apply the change to Gatehouse with a reload, and leave one place that says where Waybill lives.

On the machine

  • bin/hostlog -u gatehouse and var/log/gatehouse/access.log: where the 502s go
  • run/gatehouse/effective.conf: what the running Gatehouse loaded
  • opt/gatehouse/bin/gatehouse -t: what it would load from disk now
  • etc/gatehouse/gatehouse.conf and every file it includes
  • ss -ltnp, var/log/deploy.log, etc/waybill/waybill.env: where Waybill listens now
  • home/ivo/.bash_history

Timeline

14:24Waybill green (2.5.2) starts on a new port next to blue.
14:28Ivo switches traffic to green and drains blue (CHG-5131).
14:31Blue is stopped. Its port closes.
14:32Gatehouse: /healthz 502, dial tcp 127.0.4.12:<blue port> refused.
14:35INC-2378 opened. "Don't restart Gatehouse, it carries the label portal. Reload it."

Done when

  1. Scanners get Waybill's answer through Gatehouse again, and the label portal keeps working.
  2. Waybill stays on its green listener, and the retired blue port stays closed.
  3. Gatehouse is reloaded, not restarted.
  4. The Waybill upstream is defined in one place, and it all still works after a reboot.

Hints

Hint 1

Waybill answers on its own, so look at the hop in front of it. Which address does Gatehouse dial, according to its own log?

Hint 2

Compare `run/gatehouse/effective.conf` (what is running) with `opt/gatehouse/bin/gatehouse -t` (what is on disk).

Hint 3

`gatehouse -t` lists every file it read. If two files define the same upstream, the one read last wins.

Hint 4

Make the files say the green port in one place, test with `gatehouse -t`, then `bin/hostctl reload gatehouse`.

Show the solution

Find Waybill's green port (`ss -ltnp`, `etc/waybill/waybill.env`, or the deploy log). Make `etc/gatehouse/conf.d/waybill.conf` the only place that defines `upstream waybill`, pointing at 127.0.4.12 and that port. Run `opt/gatehouse/bin/gatehouse -t`, then `bin/hostctl reload gatehouse`, and confirm with `curl` on the customer path and `run/gatehouse/effective.conf`.