1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.4 Broken Avatars

Discussion in 'XenForo Questions and Support' started by TDUBS, Sep 22, 2014.

  1. TDUBS

    TDUBS Active Member


    So over the last few days, I've been experiencing issues with avatars breaking when sometimes someone uploads an avatar, the image is broken. One morning I logged on and was spammed with server error logs indicating that the directories within /data/ and /internal_data/ were not given the permissions 777, in which I did. Those errors stopped occurring, but now I'm getting this;


    ErrorException: getimagesize(/usr/local/lsws/www/html/data/avatars/l/3/3195.jpg): failed to open stream: No such file or directory -library/XenForo/Model/Avatar.php:252
    Generated By: Luc, Today at 5:41 AM
    Stack Trace:
    #0 [internal function]: XenForo_Application::handlePhpError(2, 'getimagesize(/u...', '/usr/local/lsws...', 252, Array)
    #1 /usr/local/lsws/www/html/library/XenForo/Model/Avatar.php(252): getimagesize('/usr/local/lsws...')
    #2 /usr/local/lsws/www/html/library/XenForo/ControllerPublic/Account.php(582): XenForo_Model_Avatar->recropAvatar(3195, 0, 0)
    #3 /usr/local/lsws/www/html/library/XenForo/FrontController.php(347): XenForo_ControllerPublic_Account->actionAvatarUpload()
    #4 /usr/local/lsws/www/html/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
    #5 /usr/local/lsws/www/html/index.php(13): XenForo_FrontController->run()
    #6 {main}
    Request State:
    array(3) {
    ["url"] => string(57) "http://www.forumurl.com/index.php?account/avatar-upload"
    ["_GET"] => array(1) {
    ["account/avatar-upload"] => string(0) ""
    ["_POST"] => array(8) {
    ["use_gravatar"] => string(1) "0"
    ["avatar_date"] => string(10) "1411303074"
    ["avatar_crop_x"] => string(1) "0"
    ["avatar_crop_y"] => string(1) "0"
    ["_xfToken"] => string(8) "********"
    ["_xfRequestUri"] => string(35) "/index.php?account/personal-details"
    ["_xfNoRedirect"] => string(1) "1"
    ["_xfResponseType"] => string(4) "json"
    I can verify the listed image does not exist, but why is it this occurring to begin with? Someone's broke when they uploaded a 200x200 image as well. If they're uploading bigger images, wouldn't it resize or deny their request to upload it. I personally tried uploading this image http://oi62.tinypic.com/2ld9bwo.jpg and it didn't even deny the request or resize, just broke the avatar.

    Any ideas? Thanks!
  2. Mike

    Mike XenForo Developer Staff Member

    So do you get the same error if you try to upload an avatar and then try to recrop it?

    It's possible these errors are remnants from the failure before; the system thinks there's an avatar but the file is missing.

    It certainly seems like a permission issue, so do make sure you've done the chmod to all files/directories recursively.
    TDUBS likes this.
  3. TDUBS

    TDUBS Active Member

    For some reason the sub directories within /data/ were not accepting the permission changes when I was doing it via Filezilla. Every time I would view the permissions, it'd still display 755, so I just redid them entirely and now it works. The guy who was having the issue above now has the image as his avatar.


Share This Page