Join the community today
Register Now

Xenforo Issue with Xenforo and ImageMagick avatar uploads

Discussion in 'Forum software usage' started by brainlet2000, May 8, 2020.

  1. brainlet2000

    brainlet2000 Member

    42
    4
    8
    Jan 21, 2020
    Ratings:
    +7
    Local Time:
    1:13 PM
    1.17.7
    10.3.21
    I've had Imagemagick PECL extension enabled in the Xenforo attachment settings for months.

    Now suddenly out of nowhere avatars can no longer be uploaded with ImageMagick with the following error:

    Code:
         RuntimeException: Failed to save image to temporary file; image may be corrupt or check internal_data/data permissions src/XF/Service/User/Avatar.php:263 
    When I use PHP built-in GD image library as the default image processor instead it works fine, but GIFs can't be uploaded for avatars.

    I already chmoded 777 internal data and data folders(as root). Any idea what is wrong here?

     
  2. eva2000

    eva2000 Administrator Staff Member

    54,911
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,811
    Local Time:
    10:13 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Try running cmupdate command and then run centmin.sh menu option 15 to update imagick PHP extension + yum packages due to Remi ImageMagick yum changes Beta Branch - Update REMI YUM ImageMagick6 package name obsoleting in 123.09beta01

    But the error does look like internal_data/data permissions related - ensure directory and files are owned by nginx user/group.

    When you log in via pure-ftpd virtual ftp user, files uploaded are already nginx user/group permission based. But if you upload files via root user via SFTP, they're root user owned. Getting Started Guide step 2 outlines vhost setup and file permissions which are nginx/nginx user and group and how to set them if you uploaded via root SFTP.
    Code (Text):
    chown -R nginx:nginx /home/nginx/domains/newdomain.com/public
    
     
  3. brainlet2000

    brainlet2000 Member

    42
    4
    8
    Jan 21, 2020
    Ratings:
    +7
    Local Time:
    1:13 PM
    1.17.7
    10.3.21
    Yep, these steps solved it. You're a god damn genius like always. I think it was just ImageMagick glitching out somehow, not sure. Maybe because I updated centminmod and nginx. No idea.

    Thank you, @eva2000.