XF 2.2 Issue Uploading Gif Avatars

michigo

Member
Hi! I'm a new customer and I've been receiving this error whenever I attempt tp upload a gif avatar, I've recently imported from IPS 4.4. to XF 2.2.0

Oops! We ran into some problems. Please try again later. More error details may be in the browser console.

PHP: An exception occurred: [XF\Db\Exception] MySQL statement prepare error [2006]: MySQL server has gone away in src/XF/Db/AbstractStatement.php on line 228 #0 src/XF/Db/Mysqli/Statement.php(196): XF\Db\AbstractStatement->getException('MySQL statement...', 2006, 'HY000') #1 src/XF/Db/Mysqli/Statement.php(39): XF\Db\Mysqli\Statement->getException('MySQL statement...', 2006, 'HY000') #2 src/XF/Db/Mysqli/Statement.php(54): XF\Db\Mysqli\Statement->prepare() #3 src/XF/Db/AbstractAdapter.php(94): XF\Db\Mysqli\Statement->execute() #4 src/XF/Session/DbStorage.php(57): XF\Db\AbstractAdapter->query(' -- XFDB=noF...', Array) #5 src/XF/Session/Session.php(215): XF\Session\DbStorage->writeSession('tdi1kIIaEg4aSB4...', Array, 14400, true) #6 src/XF/Pub/App.php(460): XF\Session\Session->save() #7 src/XF/App.php(2303): XF\Pub\App->complete(Object(XF\Http\Response)) #8 src/XF.php(464): XF\App->run() #9 index.php(20): XF::runApp('XF\\Pub\\App') #10 {main}
 
Your host appears to have an extremely low wait_timeout setting in MySQL. The default is 28800 (seconds) which is incredibly high admittedly, but anything below 60 or 90 can certainly cause some issues with intensive processes that don't relate to MySQL, such as image resizing--particularly with animated GIFs.

Ideally they'd increase whatever they've set it to, though they might be reticent to do that (unless you're on a VPS, for example).
 
Your host appears to have an extremely low wait_timeout setting in MySQL. The default is 28800 (seconds) which is incredibly high admittedly, but anything below 60 or 90 can certainly cause some issues with intensive processes that don't relate to MySQL, such as image resizing--particularly with animated GIFs.

Ideally they'd increase whatever they've set it to, though they might be reticent to do that (unless you're on a VPS, for example).

Okay so I should just ask them to increase that setting? I have access to MySQL but I never really touch it as I have no developer skills lol, is that something I can be guided trough myself?

EDIT: I managed to figure how to view it and my wait_timeot was indeed only set to 20. I'll get a hold of my host to see if they can change it for me since I do not have full access to do it myself.
 
Last edited:
Okay so I've updated my wait_timeout to 28,800 but I'm still getting an error, though it is different now so progress?

Failed to load resource: /account/avatar:1 the server responded with a status of 503 ()

PHP: <!DOCTYPE html> <html style="height:100%"> <head> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" > <title> 503 Service Unavailable </title></head> <body style="color: #444; margin:0;font: normal 14px/20px Arial, Helvetica, sans-serif; height:100%; background-color: #fff;"> <div style="height:auto; min-height:100%; "> <div style="text-align: center; width:800px; margin-left: -400px; position:absolute; top: 30%; left:50%;"> <h1 style="margin:0; font-size:150px; line-height:150px; font-weight:bold;">503</h1> <h2 style="margin-top:20px;font-size: 30px;">Service Unavailable </h2> <p>The server is temporarily busy, try again later!</p> </div></div></body></html>
defaultAjaxError@core-compiled.js?_v=7425a8bd:57

^Disregard! I was trying to do too many things at once and wasn't patient enough, gifs are working smoothly now.
 
Last edited:
Okay new day, new problem it seems. I can upload .gifs fine but for some reason static image photos are not uploading now and giving me this error.

RuntimeException: Failed to save image to temporary file; image may be corrupt or check internal_data/data permissions in src/XF/Service/User/Avatar.php at line 265
  1. XF\Service\User\Avatar->updateAvatar() in src/XF/Pub/Controller/Account.php at line 539
  2. XF\Pub\Controller\Account->actionAvatar() in src/XF/Mvc/Dispatcher.php at line 350
  3. XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 257
  4. XF\Mvc\Dispatcher->dispatchFromMatch() in src/XF/Mvc/Dispatcher.php at line 113
  5. XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 55
  6. XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2300
  7. XF\App->run() in src/XF.php at line 464
  8. XF::runApp() in index.php at line 20
 
If you flip the image manager option back to GD, does that work? This might actually be pointing to Imagemagick/PHP Imagick extension itself not working correctly (if only GIFs work).
 
If you flip the image manager option back to GD, does that work? This might actually be pointing to Imagemagick/PHP Imagick extension itself not working correctly (if only GIFs work).
I just tested it and GD works perfectly, no error at all.

Do I need to reinstall imagick?
 
That does certainly seem to point to Imagick not having the necessary format support. Try going to <url>/admin.php?tools/phpinfo and look for the "ImageMagick supported formats" entry. What does it show? Does it show JPEG and PNG in it? If not, that'll be the cause and it might be down to how the Imagick extension was built and how it may link to the underlying system Imagemagick library (perhaps the underlying library doesn't have the handlers for many formats installed?).
 
That does certainly seem to point to Imagick not having the necessary format support. Try going to <url>/admin.php?tools/phpinfo and look for the "ImageMagick supported formats" entry. What does it show? Does it show JPEG and PNG in it? If not, that'll be the cause and it might be down to how the Imagick extension was built and how it may link to the underlying system Imagemagick library (perhaps the underlying library doesn't have the handlers for many formats installed?).
Ah yes, the regular image formats are missing.

E6602DDD-1796-47C1-AA74-9ABF3ADED2A9.webp
Not sure how that happened.
 
I have another problem uploading gifs, and i dont know how to solve
Code:
Oops! We ran into some problems. Please try again later. More error details may be in the browser console.


And on VPS log have this:

Code:
.560730 [INFO] [1503] [141.101.76.106:28226#APVH_cloudbit.es:443] File not found [/var/www/vhosts/cloudbit.es/httpdocs/foro/data/attachments/117/117084-fdfde44c122e6fe639b72d4e480b7eab.jpg]

    .931384 [INFO] [1503] [141.101.76.106:20342#APVH_cloudbit.es:443] connection to [uds://tmp/lshttpd/APVH_cloudbit_Suphp74.sock] on request #1, confirmed, 1, associated process: 0, running: 0, error: Connection reset by peer!
   
        .931454 [NOTICE] [1503] [141.101.76.106:20342#APVH_cloudbit.es:443] oops! 503 Service Unavailable
       
            .931461 [NOTICE] [1503] [141.101.76.106:20342#APVH_cloudbit.es:443] Content len: 636756, Request line: 'POST /foro/index.php?attachments/upload&type=post&context[thread_id]=37805&hash=a0b47b2585259305617a9e869a8e6255 HTTP/1.1'  
           
                .931467 [INFO] [1503] [141.101.76.106:20342#APVH_cloudbit.es:443] Cookie len: 809, xf_csrf=VGozDVuqS1p41Q8U; xf_lscxf_logged_in=1; xf_user=1%2CQ4PVSfCHXSXl16W0MfZTmF7xYCXOfuvtdOwoIbae; xf_siropu_chat_room_id=1; __cfduid=da01dfc268f7d1d677c945f8de5250aa91603822827; xf_session_install=N4F1Ye87HA--gn18Fcuqh2JGyAaCZHQE; xf_edit_style_id=21; xf_push_notice_dismiss=1; sites-dynamic-list-state-collapsed=%7B%22undefined%22%3A0%2C%22domain%3A1%22%3A0%7D; wordpress_logged_in_ece2eba768baa874e870aa8b9b12006a=est3ban129%7C1606162893%7CxrgYGAWT7OavJcNxN4uLR8Jp12OfZIKmDaZhxKywhcR%7C0d7f59bd1a9a18777d908d06557f193354226bbd137cbe560b15a97c76c2bf66; xf_session=NUrxXVDG-a9GXjy1ovOchVxFTdA6dJAI; xf_session_admin=NSeWniHE8p8Dni6CKBRAkFE-1z4TqZg7; _lscache_vary=f27efde4b6a69d4450f507e24190a4d1; PLESKSESSID=81fd95cadc5dece7f1d5450359957356; uat-iid=1420.D731.5F97.11EA.AEFB.1E18.1F2C.F07D; uat-sid=81FD
               
                    .931484 [INFO] [1503] [141.101.76.106:20342#APVH_cloudbit.es:443] abort request..., code: 4

however I can upload gifs to Wordpress without any problem in the same website but I can't do it in Xenforo 2.2

And no errors on Xenforo admin panel
 
Back
Top Bottom