Logo is not appearing showing broken after upload

Hi team,

To refresh everything I tried to delete all the logo uploaded by me previously. I connected my site through FTP and deleted all the image from
/var/discourse/shared/standalone/uploads/default/original/1X

Now, I am trying to upload the same logo that I deleted from the setting panel. But after upload, it is showing broken. http://prntscr.com/nimekp

Can anyone tell me what is happening here? I also tried uploading through Installation Wizard but the same issue.

Thank you!

Why would you delete the logo via and not via the ui?

You might be able to put it back via ftp. You’ll need to use the same filename and path.

You’ll need to upload a different logo. My guess is that Discourse knows that you’ve uploaded the file and won’t take a duplicate. You could try making a trivial change to the logo so that it’ll have a new hash.

1 Like

You’ve shot yourself in the :foot:.

You’ve delete all the uploaded files but Discourse also keeps track of the Uploads in the database.
Since we use the SHA1 of the files to prevent duplicates, when you upload the same exact file, Discourse thinks it already has it.

If you want to fix it, you’ll have to delete all the uploads records. SSH into your server and then

cd /var/discourse
./launcher enter app
rails c
Upload.where("id > 0").destroy_all

:warning: Be sure to take a backup before as this is a destructive operation.

FYI: There’s no need to delete uploaded file in Discourse as we’ll automatically delete unused files after a little while.

6 Likes

Please check and tell me if I have done everything correctly:-

Also, tell me how can I view and edit the database as we see in phpmyadmin (GUI). If it is not possible to view the database then how can I access it through the terminal?

Thank you!

Looks ok.

instead of doing rails c you can do rails db.

1 Like

Is it possible to view and manage database through UI?

Strongly suggest you read the RoR guides

https://guides.rubyonrails.org/

1 Like

The easiest way to read the database from the GUI is the Data Explorer Plugin.

rails c puts you in the Rails console. It’s generally safest to use the console as you’re using the Discourse code itself rather than blindly making changes to a database that you don’t understand.

4 Likes

Thank you for clearing my doubt.

1 Like

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