-
-
Notifications
You must be signed in to change notification settings - Fork 40.1k
Description
Description
When trying to disable cron jobs in the Clawdbot UI, users encounter the error: "The data couldn't be written because it isn't in the correct format".
Steps to Reproduce
- Open Clawdbot Web UI or macOS app
- Navigate to the Cron section
- Try to disable an existing cron job by clicking the "Disable" button
- Error appears: "The data couldn't be written because it isn't in the correct format"
Expected Behavior
- Cron job should be successfully disabled (enabled: false)
- Job should be updated in the persistent store
- UI should reflect the change without errors
Actual Behavior
- Error message appears when trying to disable cron jobs
- Job remains unchanged in the UI
- No error details provided to help diagnose the issue
Environment Information
- Clawdbot Version: [Latest]
- Platform: [macOS/Linux/Windows]
- Browser: [Chrome/Safari/Firefox]
- Gateway Running: Yes
Investigation Notes
Based on codebase analysis, the error message "The data couldn't be written because it isn't in the correct format" is NOT found in the current Clawdbot codebase, suggesting this error originates from:
- Client-side validation in the Web UI
- Browser/storage limitations
- External dependencies (JSON5 parsing, file system)
- AJV validation failures in the Gateway API
Potential Root Causes
-
JSON5 Parsing Issues (
src/cron/store.ts:25)- Corrupted cron job data in
~/.clawdbot/cron/jobs.json - Invalid JSON5 syntax causing parse failures
- Race conditions during concurrent writes
- Corrupted cron job data in
-
AJV Validation Failures (
src/gateway/server-methods/cron.ts:89-109)- Cron update payload failing TypeBox schema validation
- Missing required fields in the patch operation
- Type mismatches in boolean field validation
-
File System Issues (
src/cron/store.ts:36-47)- Disk space or permission issues
- Concurrent access to the jobs.json file
- Temporary file creation failures
-
Client-Side Validation
- Browser-specific data formatting issues
- Form validation before sending to Gateway
Debugging Steps for Users
1. Check Gateway Logs
# View recent gateway logs for cron-related errors
./scripts/clawlog.sh --category cron
# Or follow logs in real-time
./scripts/clawlog.sh --follow --category cron2. Check Browser Console
- Open Developer Tools (F12)
- Go to Console tab
- Try disabling the cron job again
- Look for JavaScript errors or failed network requests
3. Verify Cron Store Integrity
# Check if jobs.json exists and is valid
cat ~/.clawdbot/cron/jobs.json
# Validate JSON5 syntax (if json5 CLI tool available)
json5 parse ~/.clawdbot/cron/jobs.json4. Test via CLI
# Try disabling via CLI to isolate if it's a UI issue
clawdbot cron list
clawdbot cron disable <job-id>Requested Information
When reporting this issue, please provide:
- Browser Console Output: Any JavaScript errors
- Gateway Logs: Logs from the time the error occurred
- Cron Jobs Content: Contents of
~/.clawdbot/cron/jobs.json(sanitized) - Network Tab: Any failed HTTP requests from browser DevTools
Temporary Workarounds
-
Use CLI instead of UI:
clawdbot cron disable <job-id>
-
Manually edit jobs.json (advanced):
# Stop gateway first # Backup the file cp ~/.clawdbot/cron/jobs.json ~/.clawdbot/cron/jobs.json.bak # Edit the enabled field to false for the problematic job # Restart gateway
-
Remove and recreate the job:
clawdbot cron rm <job-id> # Then recreate it with enabled=false
Code Areas to Investigate
src/cron/store.ts: JSON5 parsing and file operationssrc/gateway/server-methods/cron.ts: AJV validation incron.updateui/src/ui/controllers/cron.ts: Client-side validation intoggleCronJobui/src/ui/views/cron.ts: Form handling and error display
Severity
High - Users cannot manage existing cron jobs, affecting automation functionality.
Priority
High - Core functionality is broken for cron management.
Screenshots
