An unusable DATA_DIR stops the standalone server with an error that does not name DATA_DIR #148

Closed
opened 2026-10-14 16:08:47 +02:00 by clawbot · 2 comments
Collaborator

README.md lines 218 to 221, at v1.0.0-rc1: "A variable set to a value the server cannot use ... stops it from starting, with an error naming the variable." For DATA_DIR this does not hold when the backend runs on its own (make run, or the binary outside the image): internal/reportbuf/reportbuf.go lines 126 to 130 create the directory at start and fail with create data dir: mkdir /proc/nope: no such file or directory, which names the path but not DATA_DIR. Every setting checked in internal/config/config.go names its variable, and in the image netwatch-server prepare-data-dir names DATA_DIR (cmd/netwatch-server/main.go line 55), so only the standalone case differs.

How to see it: DATA_DIR=/proc/nope ./netwatch-server (or the image's binary run directly with that setting): the start fails and the logged error is create data dir: mkdir /proc/nope: no such file or directory.

What is right: the README sentence above; the error should read DATA_DIR "/proc/nope": ....

Severity: low.

Definition of done

  • The error for a DATA_DIR that cannot be created or read names DATA_DIR and the value, like the other settings' errors.
  • A test in internal/reportbuf/reportbuf_test.go starts the buffer on an uncreatable DATA_DIR and checks the error names DATA_DIR.
  • TODO.md updated in the same commit; commit title ends (closes #N) with this issue's number.

Model: fable-5-1

`README.md` lines 218 to 221, at `v1.0.0-rc1`: "A variable set to a value the server cannot use ... stops it from starting, with an error naming the variable." For `DATA_DIR` this does not hold when the backend runs on its own (`make run`, or the binary outside the image): `internal/reportbuf/reportbuf.go` lines 126 to 130 create the directory at start and fail with `create data dir: mkdir /proc/nope: no such file or directory`, which names the path but not `DATA_DIR`. Every setting checked in `internal/config/config.go` names its variable, and in the image `netwatch-server prepare-data-dir` names `DATA_DIR` (`cmd/netwatch-server/main.go` line 55), so only the standalone case differs. **How to see it**: `DATA_DIR=/proc/nope ./netwatch-server` (or the image's binary run directly with that setting): the start fails and the logged error is `create data dir: mkdir /proc/nope: no such file or directory`. **What is right**: the README sentence above; the error should read `DATA_DIR "/proc/nope": ...`. **Severity**: low. ## Definition of done - [ ] The error for a `DATA_DIR` that cannot be created or read names `DATA_DIR` and the value, like the other settings' errors. - [ ] A test in `internal/reportbuf/reportbuf_test.go` starts the buffer on an uncreatable `DATA_DIR` and checks the error names `DATA_DIR`. - [ ] `TODO.md` updated in the same commit; commit title ends ` (closes #N)` with this issue's number. Model: fable-5-1
clawbot self-assigned this 2026-10-14 16:08:47 +02:00
Author
Collaborator

Plan: one PR with #161, as both are small changes to internal/reportbuf/reportbuf.go. The error for a DATA_DIR that cannot be created or read names DATA_DIR and its value, as the other settings' errors do.

Model: opus-5-5

Plan: one PR with https://git.eeqj.de/sneak/netwatch/issues/161, as both are small changes to `internal/reportbuf/reportbuf.go`. The error for a `DATA_DIR` that cannot be created or read names `DATA_DIR` and its value, as the other settings' errors do. Model: opus-5-5
Author
Collaborator

Done in #169, which covers #148 and #161 in one commit.

Model: opus-5-5

Done in https://git.eeqj.de/sneak/netwatch/pulls/169, which covers https://git.eeqj.de/sneak/netwatch/issues/148 and https://git.eeqj.de/sneak/netwatch/issues/161 in one commit. Model: opus-5-5
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/netwatch#148