Page MenuHomePhabricator

Avatars not working on SocialProfile
Closed, InvalidPublic

Description

Whenever I attempt to upload an avatar, I get an error.

/avatars and /images are both owned by www-data.

To test to see if it was caused by an issue with my mediawiki installation and database I created a new installation and database on my server. On this new server, I still had the exact same error.

Here's an example of the error messages that I get:

Screenshot from 2023-02-17 16-55-52.png (142×499 px, 9 KB)

Event Timeline

Set $wgShowExceptionDetails = true; in your wiki's LocalSettings.php and provide detailed information about the version of SocialProfile as well as the version of MediaWiki you're using, in addition to the full backtrace, which becomes available once you've set the aforementioned variable and triggered the error again.

[292ea3c4494fa46ac7e6c41c] /mediawiki-1.39.1/index.php/Special:UploadAvatar Error: Call to undefined function imagecreatefrompng()

Backtrace:

from /var/www/html/mediawiki-1.39.1/extensions/SocialProfile/UserProfile/includes/avatar/UploadAvatarTrait.php(109)
#0 /var/www/html/mediawiki-1.39.1/extensions/SocialProfile/UserProfile/includes/avatar/UploadAvatarTrait.php(219): UploadAvatar->createThumbnail()
#1 /var/www/html/mediawiki-1.39.1/includes/specials/SpecialUpload.php(614): UploadAvatar->performUpload()
#2 /var/www/html/mediawiki-1.39.1/includes/specials/SpecialUpload.php(246): SpecialUpload->processUpload()
#3 /var/www/html/mediawiki-1.39.1/extensions/SocialProfile/UserProfile/includes/specials/SpecialUploadAvatar.php(69): SpecialUpload->execute()
#4 /var/www/html/mediawiki-1.39.1/includes/specialpage/SpecialPage.php(701): SpecialUploadAvatar->execute()
#5 /var/www/html/mediawiki-1.39.1/includes/specialpage/SpecialPageFactory.php(1428): SpecialPage->run()
#6 /var/www/html/mediawiki-1.39.1/includes/MediaWiki.php(316): MediaWiki\SpecialPage\SpecialPageFactory->executePath()
#7 /var/www/html/mediawiki-1.39.1/includes/MediaWiki.php(904): MediaWiki->performRequest()
#8 /var/www/html/mediawiki-1.39.1/includes/MediaWiki.php(562): MediaWiki->main()
#9 /var/www/html/mediawiki-1.39.1/index.php(50): MediaWiki->run()
#10 /var/www/html/mediawiki-1.39.1/index.php(46): wfIndexMain()
#11 {main}

The Mediawiki version is 1.39

Social Profile version is SocialProfile: master
2023-01-02T08:27:57

d3a506e

Boldly closing this as this looks to be a pure server-side misconfiguration issue rather than a code-level problem.

It seems that you don't have $wgUseImageMagick = true; set in your wiki's LocalSettings.php and maybe $wgImageMagickConvertCommand is also missing or invalid; thus SocialProfile tries to use PHP's built-in GD image manipulation functions, but your particular PHP build was compiled without GD support. You need either ImageMagick and the appropriate configuration variables, or alternatively GD for image manipulation operations.

Social Profile version is SocialProfile: master
2023-01-02T08:27:57

d3a506e

Although nothing avatar-related has been touched in a while, you may still wish to upgrade your copy of SocialProfile to the latest master version, as there are some potentially useful bug fixes and tweaks pushed to the repo since early January (e.g. 1c5d011ae7d45f0a48b8646de95019796eb30ad1, eb95856101b5b643ea85bf1803b6cde9acbbe7b3, e6dfea4fb7d0f822028b1333e3be1c453777194b and if you're using FanBoxes, 194e0a5cd5a1154d5dff1c9f934529379b0ca87a), and, of course, regular localization updates courtesy of TWN.

Not really, but I'll update and see if that works

Screenshot from 2023-02-18 00-04-26.png (116×577 px, 18 KB)