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

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).

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

1 Like

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

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.

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:

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…

To kill the setting, enter a SQL console and:

DELETE FROM site_settings WHERE name = 'port';
2 Likes

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

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:

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:

2 Likes