קבצים מצורפים מוגשים מקומית על השרת אך לא באופן ציבורי

Problem Summary

I’m encountering a 404 error when accessing an image upload via its URL on the live Discourse site (https://techenclave.com), even though the image is present on disk and served correctly internally. I’ve rebaked the post, restarted the app, and verified internal serving works, but it still 404s externally.


What’s Working

1. Upload Exists in DB

Using the Rails console, I confirmed that the upload exists with all correct metadata:

Upload.find_by(sha1: 'a8fbe877e685e6a6994532c946c446b1279da7d2')

Output includes:

  • url: "/uploads/default/original/3X/a/8/a8fbe877e685e6a6994532c946c446b1279da7d2.jpeg"
  • Filename: IMG202506252257011.jpg
  • ID: 170265
  • Used in Post ID: 3125774

2. File Exists on Disk

Verified file is present inside the container:

ls -l /shared/uploads/default/original/3X/a/8/a8fbe877e685e6a6994532c946c446b1279da7d2.jpeg

:check_mark: File exists with correct ownership and permissions:
discourse:www-data, -rw-r--r--.


3. Symlink from Public Folder Works

The public/uploads symlink is intact:

ls -l /var/www/discourse/public/uploads
# => /shared/uploads

4. Discourse Can Serve It Internally

Tested with:

curl -I http://localhost:3000/uploads/default/original/3X/a/8/a8fbe877e685e6a6994532c946c446b1279da7d2.jpeg

Result: HTTP/1.1 200 OK


5. Post Rebaked

Rebaked the post with:

Post.find(3125774).rebake!

6. App Restarted

Ran:

./launcher restart app

Also attempted:

sudo ./launcher rebuild app

(Docker daemon was temporarily unavailable but later fixed.)


What’s Not Working

External Access to Image

Accessing:

https://techenclave.com/uploads/default/original/3X/a/8/a8fbe877e685e6a6994532c946c446b1279da7d2.jpeg

Returns:

404 Not Found

This happens across browsers and in incognito mode.


What I Need Help With

Can someone help identify what could cause:

  • A working upload that serves via localhost:3000,
  • but returns 404 externally on the public domain?

What else should I check? Any related config or logs to inspect?

Thanks in advance!

Even freshly uploaded images are not loading. Getting 404

https://techenclave.com/uploads/default/original/3X/b/3/b38f7bc7a78e572cf46f092ab67837de6f648e46.png

אני מניח שזו לא התקנה רגילה?
זה בעיקר כל מה שנתמך כאן.

איך התקנת את דיסקרוס?

לייק 1

Next time maybe mention that you very recently migrated?

Did you follow this guide when you changed from temp.techenclave.com to techenclave.com ?

2 לייקים

תודה.

ההתקנה הייתה מדריך התקנה סטנדרטי של דיסקרוס ב-GitHub.

כן, ביצעתי הגירה מקומית במחשב הנייד שלי, לקחתי גיבוי ושחזרתי את הגיבוי בשרת על ידי העלאת הקובץ וביצוע שחזור גיבוי מלוח המנהלים. לא הייתי צריך לעשות זאת כי לא כל קבצי הצירוף שוחזרו למרות שהפעולה הראתה הצלחה. בכל מקרה, ביצעתי rsync של קבצים מההתקנה המקומית במחשב הנייד לשרת כדי לעדכן אותם.

השלב הבא היה הגירת דומיין, כפי שציינת נכון, מ-temp לשורש לאחר בדיקת ההגדרה למשך יום.

הסיבה שלא הזכרתי את הנ"ל היא כי גם הקבצים האחרונים שהועלו לאחר כל הפעילות הנ"ל עדיין לא מופיעים. למרות בנייה מחדש. אז לא מצאתי את המידע הזה רלוונטי.

לא עקבתי אחר המדריך הזה. אבל כשאני מסתכל עליו אני יכול לראות שרק שלב היה

  1. הדומיין הישן מופיע ברשימת ה-iframe המותרים יחד עם הדומיין החדש בהגדרות.
  2. מיפוי מחדש של הדומיין בפוסטים שאני הולך לעשות בכל מקרה מאוחר יותר, כולל אפייה מחדש לאחר פתרון הבעיה הזו. הפוסט הנדון עבר אפייה מחדש ואין לו את הדומיין הישן בכתובת ה-URL של התמונה.

האם שני הנקודות האלה רלוונטיות?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.