Unable to view or upload images

I recently migrated my forum from one server to another. Current version is 2.6.0.beta2 Everything else is working fine, however, the previously uploaded images are not visible as well as users are unable to upload new images. Also, users are not able to update their profile pictures.

I tried a few things that were mentioned in this forum, however, none seemed to work for me. Need help!

Were you previously using s3 or some similar s3-compatible storage?

What necessitated the change? How are the servers different and how was the new server built?

I have never used S3 on this server, even for testing.

I had to change the server because I wanted to change the region. The new server is identical to the old server in every way, except for the region. I was using cloudfront CDN but after migration I invalidated the complete cache.

I can see the old images are available on the new server as they were included with the backup, but still this issue.

Did you upgrade the old instance to the same level prior to making/restoring the backup?

Yes, everything was identical in both the servers. I followed proper steps for migration, and also checked issues faced by other users during migration.

The problem is not just that I’m not able to view old images, users are not able to upload new images too. I guess it is a problem with some image driver (sorry for the vague guess).

And this is using the standard install?

Yes, with the steps mentioned at discourse/docs/INSTALL-cloud.md at main · discourse/discourse · GitHub

좋아요, 다시 정리해 보겠습니다. 기존 서버는 표준 설치 방식으로 되어 있었죠. 동일한 방식으로 구축된 시스템에 재설치를 진행했고, 백업을 복원했습니다.

페이지 소스를 살펴보면 이미지 URL은 어떤 형태인가요? /var/discourse/standalone/web-only/uploads/default 에 있는 업로드 파일과 비교해 보면 어떻게 되나요?

이미지 링크를 직접 열면 어떤 일이 발생하나요?

이 두 설치 중 어느 것이 두 컨테이너(two-container) 구성이었나요?

재현 단계를 명확히 알 수 없으므로 #contribute:bug에서 #support로 카테고리를 변경합니다. 근본 원인을 파악할 수 있다면 버그로 등록해야 할 수도 있지만, 현재로서는 해당 사항이 없습니다.

Looks like the images for my forum are uploaded in /var/discourse/shared/standalone/uploads/default/optimized/1X. There are many images stored with multiple resolutions, however, the image file name on the forum and in the directory are not same.

I get 404 code for https://forumcdn.domain.com/uploads/default/optimized/1X/55cfd1bf40edcb3ac19d3e412a5ad63f93c0a854_2_225x250.png but when I replace the image file name with a file name from the directory, it works. All the image files are intact and can be viewed when opened directly, it is just that the file names on the forum are different.

Is include thumbnails in backups enabled on the source instance?

If not:

Include generated thumbnails in backups. Disabling this will make backups smaller, but requires a rebake of all posts after a restore.

Which means you will need to rake posts:rebake

include thumbnails in backups was disabled on the source instance. I just ran rake posts:rebake inside the discourse container and I got the following result:

root@vps-app:/var/www/discourse# rake posts:rebake
Rebaking post markdown for 'default'
      628 / 628 (100.0%)
628 posts done!

To be double sure, I invalidated the CDN cache but still I’m unable to view any images. Also, I’m unable to upload any images so I doubt this solution can solve that issue.