Error trying to edit a post with an image in (NginX Proxy Manager?)

Umm no. I have 18TB free…LOL.

1 Like

Ok. I used the:

./launcher rebuild app

I still see the:

I, [2022-04-29T16:46:00.618865 #1]  INFO -- : > cd /var/www/discourse && [ ! -d 'node_modules' ] || su discourse -c 'yarn install --production && yarn cache clean'
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"
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"
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".

and it ends with:

FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake themes:update assets:precompile' failed with return #<Process::Status: pid 720 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.
29d02d2c0c6e0dde4f6d7b625db30c7b69626a80ec8100a44e8caf88565d1c7e

I get the following error and yet /home/discourse is 777’ed. What’s up with that???

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"
node:fs:1336
  handleErrorFromBinding(ctx);
  ^

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

I also see the following errors and again my /home/discourse is 777’ed and even that doesn’t give it access. How is the ownership and access supposed to be set? The discourse user only exists inside the container.

I, [2022-04-29T16:45:47.705749 #1]  INFO -- : > cd /var/www/discourse && su discourse -c 'bundle install --deployment --retry 3 --jobs 4 --verbose --without test development'
[DEPRECATED] The `--deployment` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set --local deployment 'true'`, and stop using this flag
[DEPRECATED] The `--without` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set --local without 'test development'`, and stop using this flag
`/home/discourse` is not writable.

The only other error that I see at all is an error about port 6379. Am I missing something in terms of opening ports?

130:M 29 Apr 2022 16:45:10.722 # Warning: Could not create server TCP listening socket *:6379: bind: Address already in use
130:M 29 Apr 2022 16:45:10.722 # Failed listening on port 6379 (TCP), aborting.
Updating files: 100% (31051/31051), done.

After that was done, I ran discourse-doctor since the forum was stopped. Despite what it says below, the forum was started again:

FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake themes:update assets:precompile' failed with return #<Process::Status: pid 722 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.
922dd1e5bd9c3ec682864fff915eb2c12f4bf88805d555bc78f067ac2910540a
==================== END REBUILD LOG ====================
Failed to rebuild app.

Checking your domain name . . .

Connection to discussion.scottibyte.com succeeded.
You should probably remove any non-standard plugins and rebuild.
Attempting to restart existing container. . . 
x86_64 arch detected.

starting up existing container
+ /usr/bin/docker start app
app
ce202d9cd2ce   local_discourse/app   "/sbin/boot"   12 days ago   Up Less than a second   0.0.0.0:80->80/tcp, :::80->80/tcp, 0.0.0.0:443->443/tcp, :::443->443/tcp   app
Restarted the container.


==================== PLUGINS ====================
          - git clone https://github.com/discourse/docker_manager.git

No non-official plugins detected.

See https://github.com/discourse/discourse/blob/main/lib/plugin/metadata.rb for the official list.

The discourse-doctor found the following errors:

 d.indkey, pg_get_indexdef(d.indexrelid), t.oid,
	                pg_catalog.obj_description(i.oid, 'pg_class') AS comment
	FROM pg_class t
	INNER JOIN pg_index d ON t.oid = d.indrelid
	INNER JOIN pg_class i ON d.indexrelid = i.oid
	LEFT JOIN pg_namespace n ON n.oid = i.relnamespace
	WHERE i.relkind IN ('i', 'I')
	  AND d.indisprimary = 'f'
	  AND t.relname = 'user_search_data'
	  AND n.nspname = ANY (current_schemas(false))
	ORDER BY i.relname
	
2022-04-29 16:59:55.223 UTC [720] discourse@discourse LOG:  duration: 174.472 ms  execute <unnamed>: INSERT INTO "user_search_data" ("raw_data","user_id","locale","version","search_data") VALUES ('system system', -1, 'en', 3, '''system'':1A,2B ') ON CONFLICT ("user_id") DO UPDATE SET "raw_data"=excluded."raw_data","locale"=excluded."locale","version"=excluded."version","search_data"=excluded."search_data" RETURNING "user_id"
I, [2022-04-29T16:59:55.668214 #1]  INFO -- : 
I, [2022-04-29T16:59:55.668479 #1]  INFO -- : > cd /var/www/discourse && su discourse -c 'bundle exec rake themes:update assets:precompile'
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"
node:fs:1336
  handleErrorFromBinding(ctx);
  ^

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,
  syscall: 'mkdir',
  code: 'EACCES',
  path: '/home/discourse/.config/configstore'
}
error Command failed with exit code 1.

So, after the discourse-doctor, the forum is back up albiet with the same exact errors I initially posted. Graphics are a requirement and so I am thinking that graphics no longer work in this version. This error started in 2.9.0 beta3 and I am at 2.9.0 beta 4 now. Is there a way to downgrade or fix this mess?

@JammyDodger it all comes down to this:

$ yarn install --production
Error: EACCES: permission denied, open '/home/discourse/.config/yarn'


Note that there is no .config in the /home/discourse. So, I created .config.

If this helps, here is the update dashboard as of now.

The reason your forum comes back online after Discourse-Doctor is because it’s restarting the existing, pre-rebuild version of the site. So, you’ll be online, but unfortunately you’ll also be back at square one.

If you have a recent back-up, you may find it quicker to spin up a new droplet with a fresh instance and restore your site there?

I’ve searched the site for similar errors, as I’m afraid it’s not one I’ve got any personal experience with, but I did not understand the answers enough to be able to advise on them. :slightly_smiling_face: @pfaffman is normally good at these. Would something like this work, or is it a total red herring?

1 Like

So, as a last ditch effort, I performed a backup from the admin GUI. The log indicated that the backup was successful. I tried to download the backup. The forum sent me email with the link to the backup. I clicked on it and it looked like it downloaded, but there was no file downloaded. My forum shows backups, but none of them will download. I figured worse case I would install a Discourse from scratch and upload a backup. Sadly, I can’t download backups from my current forum and there are no errors in the log. This product makes me feel like I am some kind of complete newbie and I am not.

I chowned inside the container as you indicated. I get an email for the backup link. I clicked it. I specified the download folder on my Ubuntu desktop. It comes back immediately and nothing is downloaded. I am at the point where I am ready to lose my last two years of forum notes and trash my Youtube channel. This product resists all attempts at repair, backup, or restore.

:thinking: I think you should hangfire on any more risky changes until someone with more knowledge can offer some specific advice. I appreciate this is really frustrating, but doing something rash could be regrettable.

I have multiple reliable image backups of the server that I can restore at any time. The thing is that I need my current data from the server and discourse will not give up a copy of the backup that it did. I don’t know where to go from here. I am considering just screen shotting all my graphics and copying text and recreating everything in phpBB which does work.

So, my problem is not upload a backup. It’s downloading the backup from the forum. So, to try to fix the launcher issue, I chowned the /home/discourse inside the container to discourse since it was root. I ran the launcher again and…

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"
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".

This product is replete with hundreds of errors and fixing one or two results in no improvements. Two weeks ago I was running fine and then it self-destructed and there is nowhere to go to fix this mess.

Well, that’s something. :+1: Just as long as you’re comfortable with that safety net, and are aware and happy to take on the risks with experimenting. I self-host, and it can be quite nerve-wracking to go ‘off-script’ without some guidance when you have content you care about.

Could you give us some more details about your set up and how you’ve been maintaining your server so far? Maybe that could shed some light on how this happened, and sound familiar to someone else in the community that’s experienced a similar issue. What server and specs do you have? You’ve mentioned you followed the standard install guide, but you were unclear on some of the routine commands, could you have missed an important update to your server, etc?

1 Like

Rather than download via the web interface, you can instead scp or rsync it elsewhere.

I can’t make sense of what’s happening here.

The /home/discourse referred to in the UX upgrade is inside the container, so you’d not expect to see those files in your local filesystem.

But you do understand the difference between inside and outside the container.

That won’t change anything about a rebuild since you’re not looking at that container.

Have you done a

git pull?

Are you on the main and not the master branch?

2 Likes

I do understand inside and outside the container. I can’t find the backup folder.

OK. So Huge progress @JammyDodger. Thank you for your help. So, I restored a backup of my Discourse server from January. It came up perfectly and then I upgraded it to the latest with a “git pull” and then a app rebuild. Good news ZERO ERRORS now.

I finally managed to export the backup from the old server and import it. All my data is in the forum and the forum has no errors.

Unfortunately, I still cannot edit any post with a graphic or create a new post with a graphic. I get 500 errors or just a “could not create post”. Feel free to try this out on https://discussion.scottibyte.com/ Good news is as long as my posts are text only I am good and I am updated to the latest version and no errors.

1 Like

I feel like my problem must be related to inability for Discourse to access the image upload cache either when creating a post with images or editing an existing post with images. I am also completely upgraded to 2.9.0.beta4. In beta1 I did not see this problem. I am thinking it occurred in either beta3 or beta4. Whenever editing an existing post with images, I get a 500 error when attempting to save the edit. When creating a new post with images, I get:
image
If I either edit or create a post with text and hyperlinks without embedded graphics, it works fine.

Editing an existing post that has any images in it on Discourse 2.9.0.beta4 fails with the following error:

image
Creating a new topic fails as soon as I upload an image with this error:
image

Does anyone have any idea how to fix this? It started after I upgraded to beta4.

Hi @vmsman :slightly_smiling_face:

Can you keep your posts for a problem to one topic, rather than cross-posting and creating multiple. If someone can help, it will give them all the relevant info in one place and make it easier to track. :+1:

This is good news though. :+1: Would the working backup now allow you to spin up a fresh instance and install there?

So, I totally upgraded. All the rebuild bugs are gone. I restored the backup. I still cannot upload images.

So, I built a new server from scratch. It had no errors. I restored my backup. I still have the same 500 errors in editing posts with graphics. I also can’t create posts with images. I even tried to create a post before restoring the backup from the virgin install and it would not do graphics. Something must have changed with Discourse 2.9.0.beta4. Everything worked back in beta2. I must come to the conclusion that this is a network gotcha. I have my discourse and my other hosted apps behind NginX Proxy Manager and all of the other apps are fine. As a test, I pulled NginX Proxy Manager and exposed the server directly and the errors went away. So, I come to the conclusion that beta4 is doing something different network wise.

1 Like

That sounds like you might be onto something. :+1: Let’s update the title again and see if that can get you some more responses.

I’m afraid I only know the standard install, so my NginX Proxy sills are nonexistent. :slightly_smiling_face: