Avatar not found after updating to 1.4 beta because of port in URL


(William Di Luigi) #1

As you can see here avatars are not loading after upgrading to 1.4 beta.

The avatar src seems to be: "/user_avatar/cms.di.unipi.it:8000/wil93/120/6_1.png", and it looks wrong (the domain is repeated).


URLs for avatars & emoticons adding :80 to the end of the domain
(Jeff Atwood) #2

Do you have a developer only port setting in your site settings?


(William Di Luigi) #3

I think not… I can’t find a “developer only port” in the settings, however (I searched for “port”).


(Jeff Atwood) #4

It was removed as a visible setting in most Discourse instances because it causes problems (as per above…).

If you set it in previous, older versions of Discourse it will still be present. That’s the only reason I could ever think a port would show up there.


(William Di Luigi) #5

Oh sorry, that is normal: we decided to set up that port because we weren’t allowed to add a subdomain and because we read that discourse had issues when served on a prefix (like example.com/forum). The port was also there in the previous version. However, in the previous version the avatars were visible :smile:


(Jeff Atwood) #6

If that setting exists you will have problems. It is marked as a developer only setting, and hidden in recent versions of Discourse, for a reason…


(Kane York) #7

To kill the setting, enter a SQL console and:

DELETE FROM site_settings WHERE name = 'port';

(Stephen) #8

but if he does that with another site on port 80 Discourse will become inaccessible?


(William Di Luigi) #9

I don’t have that entry:

discourse=> select * from site_settings where name = 'port';
 id | name | data_type | value | created_at | updated_at 
----+------+-----------+-------+------------+------------
(0 rows)

The port is configured on a higher level, using docker:

ioi@cms:~$ docker ps
CONTAINER ID        IMAGE                                          COMMAND                CREATED             STATUS              PORTS                                                                                                                                      NAMES
6a661b7761f9        local_discourse/discourse_allenamenti:latest   "/sbin/boot"           13 hours ago        Up 13 hours         0.0.0.0:2299->22/tcp, 0.0.0.0:8000->80/tcp                                                                                                 discourse_allenamenti                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    

So, the URL is correct (we want it to have a port).

The problem is: it worked before the update :smile:


(William Di Luigi) #10

After a long search, I ultimately solved this issue.

The problem was that (in my YAML config file) I had:

DISCOURSE_HOSTNAME: 'cms.di.unipi.it:8000'

I just had to change it to:

DISCOURSE_HOSTNAME: 'cms.di.unipi.it'

And then run the usual rebuild command. Now the forum is still reachable at the :8000 port, which I want, but it finally shows the avatars :tada: :confetti_ball:


(RĂ©gis Hanol) #11