Troubleshooting
The failures this guide's lab actually met, in the order a new installer is likely to meet them.
The program panics about a pepper
Symptom: startup dies with
auth.api_key_pepper must be set to at
least 32 bytes.
Cause: the API-key secret from
chapter 3 is unset or too short.
Fix: generate one —
openssl rand -base64 48 — and provide
it as HBOX_AUTH_API_KEY_PEPPER. Keep
it stable afterwards: rotating it
invalidates every API key you have
issued.
The API says 401, but the token is right
Symptom: every authenticated call
answers valid authorization token is required,
with a token fresh from login.
Cause: it was sent as
Authorization: Bearer <token>. This
program wants the bare token in
the header (transcript t06).
Fix: drop the prefix. The same
token also works as a ?token= query
parameter, which is how downloads and
embedded images authenticate.
An item lost its location after an edit
Symptom: after a scripted update, an item's room, quantity or other fields are blank. Cause: updates through the API replace the whole record; omitted fields are stored as blank (chapter 5). The web screens always submit the full form, so this is a scripting trap. Fix: re-send one complete update carrying every field you intend the item to have (transcript t10 shows the repair), and build that habit into every script. There is no undo; exports (chapter 14) are the safety net.
A custom number field fails with a 500
Symptom: saving an item with a
custom field like 6.5 fails; the server
log says cannot unmarshal number …
of type int.
Cause: number fields hold whole
numbers in this build.
Fix: round it, or use a text field
and write "6.5 kg" (transcript t10).
A maintenance entry refuses its cost
Symptom: creating a maintenance
entry with a cost fails with a decoding
error in the log.
Cause: through the API the cost
must be JSON text — "12.50" —
not a bare number.
Fix: quote it. The web form does
this for you (transcript t17).
Uploads fail while everything else works
Symptom: attaching a photo errors;
the log mentions invalid cross-device link
naming a temp file and a documents
path.
Cause: uploads are staged in the
system temp folder and moved into the
document store; the two are on
different filesystems (common in
containers and split-disk installs).
Fix: put the program's temp
location and its storage on the same
filesystem and retry — the identical
upload then succeeds (transcripts
t12–t15).
Asset IDs are blank
Symptom: items show no 000-NNN
number, or labels print without one.
Cause: numbers are assigned by a
housekeeping pass, and some routes
(edits through the API, in the lab)
leave gaps.
Fix: run the ensure asset IDs
action; it assigns numbers to every
entity missing one (transcript t11).
The restarted server isn't the one answering
Symptom: you changed the
configuration, restarted, and nothing
changed — or the new process panics
with bind: address already in use.
Cause: the old process never died
(the lab killed a wrapper and left the
server holding the port), so the port
still belongs to the old configuration.
Fix: find the process actually
listening on the port — ss -tlnp —
stop that one, and confirm the port
is free before starting again. This
trap is not HomeBox's; it belongs to
every long-running program, and it
caught this guide's lab too.
A total doesn't match your arithmetic
Symptom: the statistics page and the item list disagree. Cause: they follow different rules for quantity — chapter 11 measured both. Also check tag totals (no roll-up from child tags) and location totals (direct contents only) before suspecting your data. Fix: decide which question you are answering, then use the figure that answers it — and say which one you used.