Discourse Rebuild not working

I had an error message when trying to add a post with an embedded graphic. It appeared that there was a file protection issue and it was suggested that I perform:

./launcher rebuild app

I did that and got these errors:

Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake themes:update assets:precompile' failed with return #<Process::Status: pid 515 exit 1>
Location of failure: /usr/local/lib/ruby/gems/2.7.0/gems/pups-1.1.1/lib/pups/exec_command.rb:117:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"assets_precompile", "cmd"=>["su discourse -c 'bundle exec rake themes:update assets:precompile'"]}
bootstrap failed with exit code 1
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one.
./discourse-doctor may help diagnose the problem.

The error is a bit baffling. This comes up after about five minutes. The thing is my data is in /var/discourse and not in /var/www/discourse. My last backup was a month ago and I’d like to fix this and not lose the last month. Any ideas? Is it possible to backup the database on the system that won’t rebuild and then restore the database somehow on the backup?

There is an earlier error also:Preformatted text

warning Skipping preferred cache folder "/home/discourse/.cache/yarn" because it is not writable.
warning Selected the next writable cache folder in the list, will be "/tmp/.yarn-cache-1000".
warning Cannot find a suitable global folder. Tried these: "/usr/local, /home/discourse/.yarn"

Error: EACCES: permission denied, mkdir '/home/discourse/.config/configstore'
You don't have access to this file.

    at Object.mkdirSync (node:fs:1336:3)
    at AsyncFunction.module.exports.sync (/var/www/discourse/app/assets/javascripts/node_modules/make-dir/index.js:114:6)
    at Configstore.set all [as all] (/var/www/discourse/app/assets/javascripts/node_modules/configstore/index.js:59:12)
    at Configstore.set (/var/www/discourse/app/assets/javascripts/node_modules/configstore/index.js:91:12)
    at clientId (/var/www/discourse/app/assets/javascripts/node_modules/ember-cli/lib/cli/index.js:55:17)
    at module.exports (/var/www/discourse/app/assets/javascripts/node_modules/ember-cli/lib/cli/index.js:105:13)
    at Object.<anonymous> (/var/www/discourse/app/assets/javascripts/node_modules/ember-cli/bin/ember:34:1)
    at Module._compile (node:internal/modules/cjs/loader:1103:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
    at Module.load (node:internal/modules/cjs/loader:981:32) {
  errno: -13,

There isn’t even a /home/discourse folder at all.

Those paths are outside and inside the container.

Do you have any plugins that might be causing this? Can you delete any non standard plugins and set it that fixes it?

Jay, I think that I figured it out. I was able to connect to the container and the paths inside the container all seemed to be chowned root somehow. I changed them all back to discourse and it is back up. The thing is, I am not sure if the protections are right. This Discourse instance has been running for months without any change and suddenly this happened and I can’t explain why. Ideas?

I think I saw a commit about removing a chown, so it could be a bug.

But so you have any non standard plugins?

My Discourse is very plain vanilla, so no. My best guess is that this occurred after I upgraded to 2.9.0.beta4 which was a few days ago. I didn’t notice the problem till now. Beta3 was running fine. It looked to me that perhaps a major part of the container had been chowned to root. Shouldn’t most of it be owned by discourse?

1 Like

Continued in Error trying to edit a post with an image in (NginX Proxy Manager?) - #22 by vmsman