Join the community today
Become a Member

Xenforo Issue with Xenforo and ImageMagick avatar uploads

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

  1. brainlet2000

    brainlet2000 Member

    30
    1
    8
    Jan 21, 2020
    Ratings:
    +4
    Local Time:
    9:45 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

    44,164
    10,066
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,556
    Local Time:
    5:45 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    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
    
     
    • Winner Winner x 1
  3. brainlet2000

    brainlet2000 Member

    30
    1
    8
    Jan 21, 2020
    Ratings:
    +4
    Local Time:
    9:45 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.
     
    • Like Like x 1