Avatar upload issue (Ubuntu)

Ok…

First problem - avatar path was ip address 127.0.0.1 whereas all the other urls were localhost - would that make a difference? I changed it anyway, by going into rails c (as it didn’t seem to pick the parameters up from the command line to start discourse (FORCE_HOST=localhost etc), they were blank in rails.

rails c
SiteSetting.force_hostname = "localhost"
SiteSetting.port = 4200
exit

then avatar paths were localhost and not ip address after I restarted the site. Avatars still weren’t working though.

further investigation of logs as soon as I did an avatar import:

tail -n 200 log/development.log

revealed:

convert: no decode delegate for this image format jpeg:/home/bob/discourse/public/uploads/default/original/1X/92bb0d46e6a4b8a1333505b9d2da59a5ed1721ec.jpeg[0]' @ error/constitute.c/ReadImage/752.\nconvert: no images defined jpeg:/tmp/discourse-thumbnail20260202-4096-qjyo93.jpeg' @ error/deprecate.c/ConvertImageCommand/3368.\n">

and after some digging I found out that it was because I had installed imagemagick but not the jpeg delegates FIRST. uninstalled Imagemagick, installed jpeg delegates (and others):

sudo apt install -y libpng-dev libtiff-dev libwebp-dev libheif-dev liblcms2-dev zlib1g-dev libjpeg-turbo8 libjpeg-turbo8-dev

and then reinstalled Imagemagick from source:

./configure \
  --prefix=/usr/local \
  --with-modules \
  --disable-static \
  --with-quantum-depth=16 \
  --with-jpeg=yes \
  --with-png=yes \
  --with-tiff=yes \
  --with-webp=yes \
  --with-heic=yes \
  --with-lcms=yes

make -j"$(nproc)"
sudo make install
sudo ldconfig

restarted the discourse server and avatars instantly worked :slight_smile:

I’m annoyed at myself for getting fixated on the ip/locahost url references instead of checking the basics….but there we go, I learned quite a bit in the last couple of days and it’s working now :slight_smile: