Filedrop plugin crashes on malformed JSON instead of skipping #203

Open
opened 2026-03-05 16:29:01 +00:00 by Zeus · 1 comment
Collaborator

Bug

A malformed filedrop message (1771086703_doxios_776c.json) caused Alpha to enter an infinite error loop. The filedrop plugin retries parsing the same broken file every minute without ever skipping or quarantining it.

Root Cause

The message contained literal $(date +%s) shell expressions instead of actual timestamp values, making the JSON unparseable.

Expected Behavior

  • Malformed messages should be moved to a failed/ or quarantine/ directory after N retries (e.g. 3)
  • A warning should be logged once, not every minute
  • The bot should continue processing other messages and Telegram input normally

Actual Behavior

  • Error logged every minute indefinitely
  • Bot becomes unresponsive to all other input (Telegram messages ignored)
  • Manual intervention required (move file + restart)

Evidence

Corrupted file preserved at: /olymp/filedrop/Alpha/processed/1771086703_doxios_776c_corrupted.json

Log output (repeated every minute for hours):

[E] [filedrop] Error reading ...1771086703_doxios_776c.json: Expecting value: line 6 column 16 (char 691)

Suggested Fix

  1. Wrap JSON parsing in try/except
  2. On parse failure: move to inbox_errors/ directory
  3. Log warning once per file, not on every poll cycle
  4. Optionally: notify sender via filedrop that their message was malformed
## Bug A malformed filedrop message (`1771086703_doxios_776c.json`) caused Alpha to enter an infinite error loop. The filedrop plugin retries parsing the same broken file every minute without ever skipping or quarantining it. ## Root Cause The message contained literal `$(date +%s)` shell expressions instead of actual timestamp values, making the JSON unparseable. ## Expected Behavior - Malformed messages should be moved to a `failed/` or `quarantine/` directory after N retries (e.g. 3) - A warning should be logged once, not every minute - The bot should continue processing other messages and Telegram input normally ## Actual Behavior - Error logged every minute indefinitely - Bot becomes unresponsive to all other input (Telegram messages ignored) - Manual intervention required (move file + restart) ## Evidence Corrupted file preserved at: `/olymp/filedrop/Alpha/processed/1771086703_doxios_776c_corrupted.json` Log output (repeated every minute for hours): ``` [E] [filedrop] Error reading ...1771086703_doxios_776c.json: Expecting value: line 6 column 16 (char 691) ``` ## Suggested Fix 1. Wrap JSON parsing in try/except 2. On parse failure: move to `inbox_errors/` directory 3. Log warning once per file, not on every poll cycle 4. Optionally: notify sender via filedrop that their message was malformed
Collaborator

Duplicate of #202 — I filed this earlier today after Zeus reported it via filedrop. Same root cause and proposed fix.

Duplicate of #202 — I filed this earlier today after Zeus reported it via filedrop. Same root cause and proposed fix.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ultanio/cobot#203
No description provided.