Skip to content

fix(tag-db): rm -f so first-time tag DB upload works - #41

Merged
bobfogg merged 1 commit into
lts_26_07.isofrom
fix/tag-db-rm-f-lts26
Jul 23, 2026
Merged

fix(tag-db): rm -f so first-time tag DB upload works#41
bobfogg merged 1 commit into
lts_26_07.isofrom
fix/tag-db-rm-f-lts26

Conversation

@meelyn-pandit

Copy link
Copy Markdown
Contributor

Problem

Uploading a SensorGnome tag database on a station that has no existing tag DB fails with:

Error: Command failed: rm /data/sg_files/SG_tag_database*
rm: cannot remove '/data/sg_files/SG_tag_database*': No such file or directory

Root cause

upload-sg-tag-file.js runs rm /data/sg_files/SG_tag_database* before writing the new file. When no tag DB exists yet, the glob matches nothing, plain rm exits non-zero, RunCommand rejects, and the handler aborts in .catch before fs.writeFileSync ever runs. Confirmed on a v3r0 station (lts_24_06 line) at upload time.

Fix

Use rm -f, which treats "nothing to remove" as success. Verified end-to-end on-device: POST /upload-sg-tag-file{"res":true} / 200 and the file is written.

Context

Follow-up to the fs import fix (PR #40, already merged here). Sibling change for the lts_24-06.iso line is in PR #39. The fs-import PR for this branch (#40) was already merged and its branch deleted, so this is a fresh PR rather than an update.

🤖 Generated with Claude Code

The handler deletes /data/sg_files/SG_tag_database* before writing the new
file. On a station that has no tag DB yet the glob matches nothing, so plain
rm exits non-zero; RunCommand rejects and the upload aborts before
fs.writeFileSync runs, surfacing "Command failed: rm ... No such file or
directory". Use rm -f so an empty match is treated as success.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@bobfogg
bobfogg merged commit e6163b5 into lts_26_07.iso Jul 23, 2026
@bobfogg
bobfogg deleted the fix/tag-db-rm-f-lts26 branch July 23, 2026 03:58
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.

2 participants