Site Logo and Icons Break due to subfolder config

Hey guys,

Your work on discourse is great,
Just need small help,

After running discourse for few days I am having trouble with setting logo, as it breaks after few days (404 error in console),
All images in post working fine,

I can not upload again any logo,
Delete, reset and upload again doesn’t work,
at the same time Gravatar also stopped working,
I am not using cdn to serve images,
discourse is setup on subfolder using this post Subfolder support with Docker

Any ideas @tgxworld?

Probably better if @david looks at this cause he is in the middle of a revamp here.

3 Likes

This suggests there is an issue bigger than just site logos. Are you seeing any errors in /logs? What kind of server are you running Discourse on? Do you have available disk space?

2 Likes

Right now /logs are empty,
16 gb available disk space using NGINX server,

We don’t have enough traffic so we are on 5$ DO droplet Ubuntu 18.10 x64

1 Like

What happens if you try and re-upload a logo?

uploading 100% then blank,

Now my /logs have few errors

Deprecation notice: The flags webhook is deprecated. Please use reviewable instead. 
At /var/www/discourse/config/initializers/012-web_hook_events.rb:82:in `block (2 levels) in <top (required)>`

6 Webhook event failed: Connection refused - connect(2) for 172.17.0.2:443 (Errno::ECONNREFUSED)

6 Errno::ECONNREFUSED (Failed to open TCP connection to www.thetechbasket.com:443 (Connection refused - connect(2) for "www.thetechbasket.com" port 443)) /usr/local/lib/ruby/2.6.0/net/http.rb:949:in rescue in block in connect'

Try going to the rails console

/var/discourse/launcher enter app
rails c

and then run

SiteSetting.logo

Do you get anything returned?

3 Likes

Hmmm, that looks correct. But the URL it’s pointing to returns a 404: https://www.thetechbasket.com/community/uploads/default/original/1X/318d1773f36e3e13192b2007fffa029d71fad86c.png

Have you done anything which might have deleted files from your server? (Normally they would be under /var/discourse/shared/standalone/uploads/default).

Anyway, to try and recover, you can delete the upload record from the database and upload again. So in this case, run Upload.find(10).destroy! from the rails console.

1 Like

Ok now logo uploaded and working fine for now,
but I can not upload other logo and icons,

I don’t see any new files in /var/discourse/shared/standalone/uploads/default

original/1X contains two images but not accessible on /community/uploads/default/original/1X/

Error

`ActionController::MissingFile (Cannot read file /var/www/discourse/public/community/uploads/default/original/1X/318d1773f36e3e13192b2007fffa029d71fad86c.png)
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.2.1/lib/action_controller/metal/data_streaming.rb:69:in `send_file'

/var/www/discourse folder does not exist

Actual structure of discourse on my server is like this

/var/www/thetechbasket.com/discourse/

/var/discourse/

Is folder upload folder not mapped correctly? or permission issue?

Actually you can say right now upload functionality is totally broken,
on upload image path is created but it can not be accessed (404)

Why isn’t discourse installed at /var/discourse?

How was this installed?

Discourse installed at
/var/www/thetechbasket.com/discourse/

following this post

And where does that tell you not to install it in /var/discourse?

Remapping is carried out by nginx, which is what that guide covers.

Discourse still needs to be installed in the normal way

Ok Thats my mistake,

What should I do now to move discourse to correct location with current settings,

Out of curiosity why are you going through the pain of a subfolder install?

This seems to be very relevant to your situation. A lack of understanding of the concepts here is going to keep coming back and biting you.

2 Likes

Actually you already know why everyone wants to have community on subdirectory instead of subdomain,
subdomain is treated as separate site in SERP and we don’t want to manage two sites,

I think for now I am going to stick to subdirectory,

So tell me how I can do it.

You’ve already made it clear that you have:

  • A broken Discourse installation, having deviated from the install guide
  • Gaps in your technical knowledge in implementing the subfolder install.

Google make it quite clear that subfolders and subdomains are treated equally - as your don’t currently have the expertise to install this you probably need to consider making a post in the marketplace.

And bear in mind that complications do arise with subfolders and updates - you’re going to need to retain someone to help you maintain it down the line.

2 Likes