diff --git a/troubleshooting.html b/troubleshooting.html index 550f93c..d66c0b0 100644 --- a/troubleshooting.html +++ b/troubleshooting.html @@ -41,7 +41,8 @@
Symptom (any of these share the same root cause):
+Could not create path "/appdata_*/richdocuments/remoteData/discovery".Diagnose:
+# Confirm a specific dir is unwritable for www-data
+ssh homework03 \
+ 'sudo -n docker exec -u www-data nextcloud-aio-nextcloud \
+ bash -c "mkdir -p /mnt/ncdata/race/files/_probe && echo OK > /mnt/ncdata/race/files/_probe/foo || echo DENIED; rm -rf /mnt/ncfiles/race/files/_probe"'
+# If DENIED, list the perms:
+ssh homework03 'sudo -n ls -la /srv/nc-files/race/files/ /srv/nc-files/admin/files/ /srv/nc-files/appdata_*/richdocuments/remoteData/'
+ Fix (narrow — Option A):
+ssh homework03 'sudo -n bash -s' <<'EOF'
+# Snapshot for rollback
+SNAP=/var/tmp/office-perm-snapshot-$(date -u +%Y%m%d-%H%M%S)
+find /srv/ncfiles -type d \( -path '/srv/ncfiles/*/files' -o -path '/srv/ncfiles/appdata_*/richdocuments/remoteData' \) -printf '%m %u:%g %p\n' | sort > "$SNAP"
+echo "snapshot: $SNAP"
+
+# Add group-write to every parent www-data needs to create under
+for d in $(find /srv/nc-files -type d \( -path '/srv/nc-files/*/files' -o -path '/srv/nc-files/appdata_*/richdocuments/remoteData' \) -printf '%p\n'); do
+ chmod g+w "$d"
+done
+EOF
+ Fix (sweep — Option B, for repeat occurrences):
+ssh homework03 'sudo -n find /srv/nc-files -group www-data -type d \
+ ! -perm -g+w -exec chmod g+w {} +'
+ Why this happens: Nextcloud AIO spawns the nextcloud container running as uid 0 during initial setup. It creates the entire data tree, dir modes included, before the runtime drops to www-data. NFS preserves those modes forever; the export never re-runs the owning UID through a daemon-side map. Result: root:www-data 0755 everywhere from the factory, no group-write.
Verify:
+ssh homework03 'sudo -n docker exec -u www-data nextcloud-aio-nextcloud \
+ bash -c "mkdir -p /mnt/ncdata/race/files/_vfile && echo OK > /mnt/ncdata/race/files/_vfile/x && cat /mnt/ncdata/race/files/_vfile/x && rm -rf /mnt/ncdata/race/files/_vfile"'
+# Expect: OK / OK / OK
+ Rollback: the snapshot file lists every dir's pre-fix mode. To restore:
+SNAP=/var/tmp/office-perm-snapshot-20260811-175027 # (example)
+ssh homework03 "sudo -n awk 'NR>2 {print \$3}' $SNAP | while read d; do chmod 755 \"\$d\"; done"
+
+