Issue with topic/posts images

Hello all,

For quite some time now I am trying to fix weird issue(s):

  1. Topic image stopped being generated.

  1. Image inside topics/posts are not clickable anymore. (click to enlarge)

I’ve tried all possible configs I can think of, nothing seems to work.
I tried safe mod, the issue still occurs there.
Nothing useful to be found in logs as well.

Any idea how to fix it?
My website is https://cybernative.ai/

Also, “Convert remote (hotlinked) images to local images by downloading them” doesn’t seem to work as well.

It does work (topic image preview) when I just insert image URL (not from my website).

Hello :wave:

Never mind this, I just wrote this before I checked raw

Can you check the following site settings?

max image width default value: 690
max image height default value: 500
create thumbnails default value: ON

If you changed these settings before than it won’t affect the existing uploads so you have to do it manually.
If these settings are correct then you can instant check it with Rebuild HTML on the actual posts. Or try to upload a new image.
Rebuild HTML on Posts or Topics

If the thumbnail is generated correctly after these then you can bulk rebake the all posts.

cd /var/discourse/
./launcher enter app

rake posts:rebake

So I just checked your posts raw version. It looks like these images are added in composer with static HTML code. <img src"..." alt="...">. So these are not uploaded by using the default upload flow and it won’t generate thumbnail.

Did you try to just drag and drop image in composer or use the upload button?

However… Can you share more information about your setup? I see you are using Cloudflare which can cause issues depends on your setup. e.g. rocket loader usually break things… The uploads goes to local or S3? etc…

Is there any error in browser console when you upload an image?

3 Likes

Hey @Don, thank you for your response.

All mentioned settings are set to default:
image
image

Yes, images are inserted with static html as it was all the time, it did generate thumbnail before. (I use API to upload image to website then use that URL to insert)

The thumbnail is NOT generated even when I upload image via composer.
This was uploaded via composer - Test of images here - CyberNative

None of my CDN/S3 setup changed, everything used to work before.

Speaking of my setup, I have somewhat weird bypass of custom CDN URL error (https caused) by using S3 replication to another bucket. It is slower, but working.

I will check browser console, but the images are uploaded fine, they just are not clickable/thumbnailed. Checked browser console, nothing.

Respectfully,
Byte

I’ve modified my posting script to use default-like workflow, unfortunately, it does not work.

Any idea what else should I check?

Somehow fixed:

  1. disable s3 uploads for backup.
  2. restore from backup.
  3. rebake posts, keep s3 uploads disabled.
    ~ it generates thumbnails slowly.
  4. My TODO: enable s3 uploads & run
rake uploads:migrate_to_s3
rake posts:rebake_uncooked_posts

Still playing around final solution, it just works sometimes until it doesn’t

1 Like

Ok it stops working on enabling s3 uploads. I think the issue might be S3 replication to another bucket that has Cloudflare CDN. I implemented this weird solution because Discourse did not allow dots in S3, preventing me from doing it the right way.

I think it will be great if Discourse used non-cdn S3 URL to download/crop/manipulate/thumbnail images.
My delay due to replication might be preventing it from working???

Struggle continues…

Does not work, going to switch my CDN to CloudFront since Discourse does not allow dots in bucket name and therefore Cloudflare.

idk, now I use CloudFront and found the single issue - “Enable S3 Setting”.
It works besides thumbnails and images being “clickable”.
Thumbnails is a big lose for me.