Old image uploads become broken images

How is this magic done? I just discovered a whole bunch of linked images tombstoned when a user pointed out their old post had 404s.
Running rake uploads:recover_from_tombstone now, 22/1281!

From a Rails console you can do

Sidekiq.pause!

and

Sidekiq.unpause!

3 Likes

Thanks! However, I guess my issue is different as I never upgrade the site from the web UI but only via ./launcher rebuild app and somehow I was hit with this issue too. The recover_from_tombstone seems to have done the trick though.

2 Likes

I have restored from one server to another, using the same domain, and same version on both.

The issue I have is that all the images are on the backup (tar.gz) file but when restored to the new server, well.
All images are broken, notoriously category images, site logo, user profile images, etc.

I’ve tried to solve it using,

  • rebuild app
  • rake posts:rebake
  • rake posts:missing_uploads
  • rake uploads:recover_from_tombstone

But if I try to check an image, I still get a 404 error, any idea?

1 Like

How did you install the new server?

1 Like

Hi, thanks for checking this out,
The procedure was like,

  1. update old server to latest (via gui)
  2. clone the repo /var/discourse (new server)
  3. copy app.yml from old server to new server
  4. ./launcher rebuild app (new server)
  5. download backup.tar.gz file (old server)
  6. restore backup on new server

Basically that was it.

2 Likes

And still got broken images :sob:

Any idea of what can be done?
The files are on the backup, but they wont be used.

Any idea?

1 Like

No idea. Was there a CDN at some point?

Maybe do a rake posts:rebake?

2 Likes

No CDN

As mentioned here already done that.
No luck

3 Likes

Have you confirmed that the image files are actually in the expected locations on your file system? Also, can you share the URL of your site? That might show us something.

2 Likes

Hello Bart,

Well, not really.
In not really sure where they should be, I opened the backup file and the where there, so I’m guessing they are, where is there a path I should check to confirm?

The site is:

Regards

1 Like

Check

/var/discourse/shared/standalone/uploads/default/original

So for a file like this one (which is broken):

https://discourse.switnet.net/uploads/default/original/1X/d8861c0b6d1855c36178866ec4c19f8db44db589.png

The original should be in

/var/discourse/shared/standalone/uploads/default/original/1X/d8861c0b6d1855c36178866ec4c19f8db44db589.png

If they’re missing, you can just extract the uploads/default/original folder from your backup and move them there (keep the directory structure intact).

5 Likes

Yay!
That was the reason, thank you very much!! :wink:

3 Likes

Nice! I’m glad that helped :slight_smile:

2 Likes

Looks like you just fixed it yourself! That’s good to know.

For anyone else reading this: There was a bug which was introduced shortly after v2.6.0.beta1. I fixed it in https://github.com/discourse/discourse/commit/f51ccea02816c768863b1073977db219f4b66ff3 and backported it to the beta branch.

From now on backups will be created correctly again and restoring a backup that was created in the time between v2.6.0.beta1 and the bugfix will work as well.

7 Likes

Thanks for letting me know, and even more the fix.
Odds we not on my favor this time, thankfully is back to normal.

Regards

2 Likes

This might explain a lot of why I wasn’t able to spin up a totally new test instance last week. Awesome to know, thanks @gerhard and all the team for always improving and answering.

Sorry for the slight off-topic.

2 Likes

Hi All,

Images are broken on our forum, i updated all the plugins and discourse, i rebuilded the app, but still not fixing it ;(.

Here is an example → Nous recherchons de toute urgence RUNNERS et Commis Waiters - Hîtellerie-restauration - Français à Londres - Petites annonces gratuites - Forum

Is the probleme related to s3 ?

Many thanks,

1 Like

You migrated recently? Seems like it’s only the previews (in the optimized folder) that are broken

A rake posts rebake should fix it, I had the same issue after a migration, I forgot about the backup setting that add the optimized files

2 Likes

thanks @Steven for your answer, i didn’t migrate. On your advise i did a post rebake, but i’m still facing the same problem, here another exemple with another post → Le systĂšme Ă©ducatif au Royaume-Uni - DĂ©bats - ConfĂ©rences - Français Ă  Londres - Petites annonces gratuites - Forum

It seems related to catégories because in our accommodation catégorie it seems to be working


1 Like