Gravatars not working after rebuild / uninitalized constant error

Avatars are not showing up after rebuilding containers

Example url:

https://community.bloom.pm/user_avatar/www.example.com/dmn/25/5_2.png

I checked the db the data is valid

id | user_id | custom_upload_id | gravatar_upload_id | last_gravatar_download_attempt |         created_at         |         updated_at
----+---------+------------------+--------------------+--------------------------------+----------------------------+----------------------------
  4 |       2 |                5 |                    | 2018-04-04 09:14:47.001205     | 2018-04-04 09:14:42.021223 | 2018-04-04 09:16:09.296377
(1 row)
 id | user_id | original_filename | filesize | width | height |                                    url                                    |         created_at         |         updated_at         |                   sha1                   | origin | retain_hours | extension | thumbnail_width | thumbnail_height | etag | secure | access_control_post_id | original_sha1 | animated | verification_status | security_last_changed_at | security_last_changed_reason
----+---------+-------------------+----------+-------+--------+---------------------------------------------------------------------------+----------------------------+----------------------------+------------------------------------------+--------+--------------+-----------+-----------------+------------------+------+--------+------------------------+---------------+----------+---------------------+--------------------------+------------------------------
  5 |       2 | DMN-pic.PNG       |   166259 |       |        | /uploads/default/original/1X/234dc08d7abf51126296472362d5dca6731d54df.PNG | 2018-04-04 09:16:03.160224 | 2018-04-04 09:16:03.165854 | 234dc08d7abf51126296472362d5dca6731d54df |        |              | PNG       |                 |                  |      | f      |                        |               |          |                   1 |                          |
(1 row)

And the file exists on the server

root@d705352cbe86:/var/www/discourse# ls -ail  uploads/default/original/1X/234dc08d7abf51126296472362d5dca6731d54df.PNG
787463 -rwxr-xr-x 1 discourse www-data 166259 Apr  4  2018 uploads/default/original/1X/234dc08d7abf51126296472362d5dca6731d54df.PNG

What could be the problem here ?

I launched rails console and added some debugging lines and ended up seeing InvalidAccess error on uninitialized constant

Did you define your hostname in your app.yml? How did you install Discourse?

this issue is related to

https://meta.discourse.org/t/getting-redirected-to-example-com-after-successful-login/203720/4

2 Likes