Skip to content

Let pwc-cron re-finalize spooled curation traces - #1157

Merged
NielsRogge merged 1 commit into
mainfrom
claude/cron-trace-spool-acl
Nov 23, 2026
Merged

NielsRogge merged 1 commit into
mainfrom
claude/cron-trace-spool-acl

Conversation

@NielsRogge

@NielsRogge NielsRogge commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

sudo pwc-cron enqueue_hf_daily_paper_curation --retry-trace <job> (documented in docs/operations.md) fails in production:

PermissionError: [Errno 13] Permission denied: '/var/lib/paperswithcode/production/recovery-spool/curation-traces'

The backend spools trace-finalization payloads as pwc-production into a 0700 directory. Since the 10-26 hardening (restrict_cron_access), pwc-cron is no longer in pwc-production, so the operator command can't read the payloads. 8 jobs from the 11-20 HF-daily cohort are stuck with trace_status = finalize_failed.

Change

  • Adds install_host_layout.share_curation_trace_spool(). It grants pwc-cron --x on recovery-spool and rwx on recovery-spool/curation-traces, plus default ACLs so files either user writes stay readable and writable by both. Nothing else in the spool or in production state is shared.
  • Adds a unit test for the exact setfacl calls.
  • Adds a docs note in docs/deployment.md.

Rollout

pwc-deploy doesn't run install_host_layout.py. After merge, apply it once with sudo python3 deploy/install_host_layout.py, run from a checkout at the merged commit. Then re-run --retry-trace for the 8 stranded jobs.

Validation

  • backend/tests/deployment/test_cron_environment.py: 32 tests pass, including the new one.
  • One test, test_cron_jobs_declare_bounded_execution_contracts, already fails on main: a registered job now uses a 3h timeout that the test's allowlist doesn't include. It's unrelated to this change.

🤖 Generated with Claude Code


Note

Medium Risk
Changes production filesystem ACLs and cron/production isolation boundaries; misconfiguration could widen access beyond the intended trace directory until host layout is reapplied.

Overview
Fixes PermissionError on pwc-cron enqueue_hf_daily_paper_curation --retry-trace after restrict_cron_access removed pwc-cron from pwc-production, leaving backend-spooled traces unreadable.

Adds share_curation_trace_spool() in install_host_layout.py: it ensures recovery-spool/curation-traces stays pwc-production-owned, grants pwc-cron traverse on the spool and rwx (plus reciprocal default ACLs) on that trace directory only, and runs it from host layout setup. A matching deployment test asserts the setfacl/ensure_dir behavior, and docs/deployment.md documents this as the sole shared production app state and says to re-run install_host_layout.py after grant changes.

Reviewed by Cursor Bugbot for commit 7995cc0. Bugbot is set up for automated code reviews on this repo. Configure here.

The 10-26 hardening removed pwc-cron from pwc-production, so
`pwc-cron enqueue_hf_daily_paper_curation --retry-trace` now fails with
PermissionError on the 0700 recovery spool. Grant pwc-cron traversal of the
spool and access to its curation-traces directory only, by ACL.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@NielsRogge
NielsRogge merged commit ac24fb8 into main Nov 23, 2026
5 checks passed
@NielsRogge
NielsRogge deleted the claude/cron-trace-spool-acl branch November 23, 2026 12:38
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.

1 participant