fix(deploy): ensure writer-pipeline var is writable by www-data
Tests / writer-pipeline tests (push) Failing after 11s
Tests / bridge tests (push) Successful in 29s
Tests / frontend lib tests (push) Successful in 31s
Tests / writer-pipeline tests (pull_request) Failing after 11s
Tests / bridge tests (pull_request) Failing after 13s
Tests / frontend lib tests (pull_request) Successful in 29s
Tests / writer-pipeline tests (push) Failing after 11s
Tests / bridge tests (push) Successful in 29s
Tests / frontend lib tests (push) Successful in 31s
Tests / writer-pipeline tests (pull_request) Failing after 11s
Tests / bridge tests (pull_request) Failing after 13s
Tests / frontend lib tests (pull_request) Successful in 29s
Writer systemd oneshots run as www-data but deploy never chowned writer-pipeline/var, causing EACCES on aggregated-items.json when the store was created by root. Mirror BIT-743 bridge/config/writers fix; rebuild writer-pipeline on webhook when that tree changes. Paperclip-Issue: BIT-25140 Co-authored-by: Cursor <[email protected]>
This commit is contained in:
1 parent
eff2fdc9de
commit
be0b0c9c6f
3 files changed
+15
No files matched your search
@@ -120,6 +120,8 @@ chown -R www-data:www-data "$APP_DIR/frontend/dist" 2>/dev/null || true
|
||||
chown -R www-data:www-data "$APP_DIR/bridge/dist" 2>/dev/null || true
|
||||
mkdir -p "$APP_DIR/bridge/config/writers"
|
||||
chown www-data:www-data "$APP_DIR/bridge/config/writers"
|
||||
mkdir -p "$APP_DIR/writer-pipeline/var"
|
||||
chown -R www-data:www-data "$APP_DIR/writer-pipeline/var"
|
||||
|
||||
log ""
|
||||
log "=== Deployment complete ==="
|
||||
|
||||
@@ -98,4 +98,16 @@ fi
|
||||
|
||||
bash "$APP_DIR/deploy/scripts/wordpress-sync-options-url.sh" || log "wordpress-sync-options-url skipped or failed"
|
||||
|
||||
# Rebuild writer-pipeline if changed (systemd oneshots run as www-data)
|
||||
if git diff --name-only "$LOCAL" "$REMOTE" | grep -q "^writer-pipeline/"; then
|
||||
log "Writer pipeline changed — rebuilding..."
|
||||
cd "$APP_DIR/writer-pipeline"
|
||||
npm ci --silent
|
||||
npm run build
|
||||
log "Writer pipeline rebuilt."
|
||||
fi
|
||||
|
||||
mkdir -p "$APP_DIR/writer-pipeline/var"
|
||||
chown -R www-data:www-data "$APP_DIR/writer-pipeline/var"
|
||||
|
||||
log "Deploy complete at $REMOTE."
|
||||
@@ -114,6 +114,7 @@ Add for **aggregator / writer-pipeline**:
|
||||
| Single failed ingest; self-heals on retry | Log in issue; no escalation. |
|
||||
| Repeated ingest errors or copyright/licensing uncertainty | Pause automated ingest for the suspect feed; involve **editorial** + **CTO**. |
|
||||
| Data corruption suspicion on `aggregated-items.json` | Stop aggregator; take a **file backup**; restore from known good or re-ingest; involve **CTO** before destructive deletes. |
|
||||
| **`EACCES`** on `writer-pipeline/var/aggregated-items.json` (systemd `User=www-data`) | `var/` or the JSON store was created as **root** (manual run, deploy gap). On CT222: `sudo mkdir -p /opt/news-platform/writer-pipeline/var && sudo chown -R www-data:www-data /opt/news-platform/writer-pipeline/var`; re-run `news-writer-andebol.service` / `news-writer-newsproject.service`. Deploy scripts enforce ownership on every pull (**BIT-25140**). |
|
||||
|
||||
### 4.2 Paperclip and queue hygiene
|
||||
|
||||
|
||||
Reference in new issue
Block a user