Skip to content

rest-api: Fix the AST2700 reset reason and two robustness bugs - #317

Open
louis-nexthop wants to merge 1 commit into
meta:heliumfrom
nexthop-ai:rest-api-ast2700-fixes
Open

louis-nexthop wants to merge 1 commit into
meta:heliumfrom
nexthop-ai:rest-api-ast2700-fixes

Conversation

@louis-nexthop

@louis-nexthop louis-nexthop commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Description

  • node_bmc.py: Reset Reason reads the AST2700 WDT0 timeout counter (0x14C37010) instead of the WDTA one (0x14C37410). A reboot resets through WDT0; WDTA is the boot watchdog and only counts its own timeouts, so Reset Reason reported "Power ON Reset" after every reboot.
  • rest_fruid.py, rest_fruid_pim.py, fboss-lite rest_fruid.py, rest_sensors.py: Popen has no TimeoutError, so a command that timed out raised AttributeError. They now catch subprocess.TimeoutExpired, kill the command and read its output.
  • rest_gpios.py: a FRU without a Product Name no longer raises KeyError.

Motivation

Found bringing up an AST2700 fboss-lite machine; none of it is board-specific.

Test Plan

On the AST2720 variant of Nexthop's BMC with this change. A warm reboot resets through WDT0, which counts it, and Reset Reason reports it:

root@bmc:~# reboot
Connection to <BMC IP> closed by remote host.
U-Boot 2023.10 <version string elided>
RST: WDT0 SOC 
RST: WDT7 SW 
DRAM:  4 GiB
Loading Environment from SPIFlash... SF: Detected w25q01jv with page size 256 Bytes, erase size 4 KiB, total 128 MiB
OK
Hit any key to stop autoboot:  2  1  0 
root@bmc:~# uptime
 17:07:18 up 1 min,  load average: 0.95, 0.32, 0.11
root@bmc:~# devmem 0x14C37010 32
0x00000100
root@bmc:~# curl -s -m 90 http://localhost:8080/api/sys/bmc | python3 -c "import sys,json; print(json.load(sys.stdin)[\"Information\"][\"Reset Reason\"])"
User Initiated Reset or WDT Reset

The other endpoints:

root@bmc:~# for u in /api/sys/mb/fruid /api/sys/gpios /api/sys/sensors; do curl -s -o /dev/null -w "%{http_code} $u\n" http://localhost:8080$u; done
200 /api/sys/mb/fruid
200 /api/sys/gpios
200 /api/sys/sensors

@meta-cla meta-cla Bot added the CLA Signed label Nov 14, 2026
@meta-codesync

meta-codesync Bot commented Nov 14, 2026

Copy link
Copy Markdown

This pull request has been imported. If you are a Meta employee, you can view this in D131938858. (Because this pull request was imported automatically, there will not be any future comments.)

- node_bmc.py: Reset Reason reads the AST2700 WDT0 timeout counter
  (0x14C37010) instead of the WDTA one (0x14C37410). A reboot resets
  through WDT0; WDTA is the boot watchdog and only counts its own
  timeouts, so Reset Reason reported "Power ON Reset" after every reboot.
- rest_fruid.py, rest_fruid_pim.py, fboss-lite rest_fruid.py,
  rest_sensors.py: Popen has no TimeoutError, so a command that timed
  out raised AttributeError. Catch subprocess.TimeoutExpired, kill the
  command and use its output.
- rest_gpios.py: a FRU without a Product Name no longer raises KeyError.

Signed-off-by: Louis Maliyam <louis@nexthop.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant