App opnieuw opbouwen - Vreemde fout

AI-generated summary

Users LotusJeff and keithkhl are encountering a recurring error during Discourse app rebuilds: “/root is not writable,” appearing during S3 asset upload and expiration rake tasks. Despite running commands as root and successfully uploading images post-rebuild, the error persists. LotusJeff confirms the session was under root, yet Ed_S questions whether the process itself ran as root. keithkhl reports a similar issue with db:migrate failing, initially suspecting PostgreSQL version incompatibility (15 vs 16/17), and tried modifying app.yml hooks to switch client versions — to no avail. Eventually, keithkhl found that installing the PostgreSQL vector extension resolved the build failure, though the “/root not writable” warning still appears. The issue appears tied to environment or permissions during rake tasks, possibly unrelated to actual functionality since uploads and app access work fine. Further investigation into user context during rake execution or environment variables (like HOME) may be needed to fully resolve the warning.

I was performing my monthly maintenance and updates to Discourse and noticed the following errors during rebuild:

I, [2025-03-22T15:54:02.806441 #1]  INFO -- : > cd /var/www/discourse && sudo -E -u discourse bundle exec rake s3:upload_assets
`/root` is not writable.

and

I, [2025-03-22T15:54:12.239681 #1]  INFO -- : > cd /var/www/discourse && sudo -E -u discourse bundle exec rake s3:expire_missing_assets
`/root` is not writable.

Post rebuild:

  1. I am able to create posts and have new images uploaded to S3 without any issue.
  2. I was able to enter the app and run the rake commands without any issue.

Any ideas or suggestions?

You are on sudo and on root, correct?

All were attempted under “root” with the same session.

But was the process running as root?

Which is why I posted the question. This has never happened before with numerous rebuilds.

Ik zit in dezelfde situatie.

Voor mijn geval wordt db:migrate niet goed uitgevoerd.

geprobeerd met verschillende backend servers, maar allemaal met dezelfde foutmelding.

ik dacht aanvankelijk dat het kwam doordat postgres 16 of 17 niet ondersteunde, dus ik probeerde te draaien met de volgende hooks.

nog steeds werkte niets.

hooks:
  after_code:
    - exec:
        cd: /var/www/discourse
        cmd:
          - export HOME=/var/www/discourse
          - export BUNDLE_USER_HOME=/var/www/discourse/.bundle
          - apt-get update
          - apt-get remove -y postgresql-client-15
          - apt-get install -y postgresql-client-16

Nadat bijna alle extra app.yml-items waren verwijderd, stuitte ik op een fout die PG-vector toeschreef.

Met de installatie van de Postgre-vector-extensie werd het buildproces succesvol voltooid, hoewel ik nog steeds ‘niet schrijfbaar /root’ zie.