Announcement

#1 2012-11-06 22:45:31

Kaz
Member
2012-11-06
18

Backend attempting to using ImageMagic and generating http 500 error

EDIT

Over the course of this thread we discovered that there were two different errors occurring:

1.) Installing the `User Tags` plugin with (at least) version 2.4.5 will cause an HTTP Error (500) when trying to upload using the flash uploader

This can be resolved by uninstalling the plugin, or using the browser upload instead.

2.) A web server that does not have Image Magick installed and is configured to auto detect graphic library (default) will attempt to execute 'convert' on the server while trying to work out which library to use. This attempt may be repeatedly logged by the web server as an error, and could - in rare situations - lead to an unexpected script being executed.

This can be resolved either by specifying GD as the library in local config ($conf['graphics_library'] = 'gd';), or by adding checks into the code (http://piwigo.org/forum/viewtopic.php?p … 57#p136957).

---------------------

I installed a gallery earlier today with version 2.4.5 and have uploaded 122 photos using the flash uploader

I just attempted to upload some new photo's and the flash uploader gives me a server 500 error.

I've checked my apache2 log file, and the log generated is an unusual error "sh: convert: not found"

According to a quick google search that's an attempt by the shell to access ImageMagick commands, which are not installed.

ImageMagick was not required when uploading the previous 122 photos, so I'm not entirely sure what's changed.

According to the Admin Home page the environment is using the GD 2.0 graphic library.

I've installed a few plugins :

Comments on Albums
Community
Crypto Captcha
Google+1
GThumb+
TweetThis
User Tags
Virtualize

The only two that seem like they might effect graphical environment settings are the GThumb+ and Virtualize plugins, but the error remains after deactivating them.

I can upload images fine using the browser uploader, but the flash one worked fine earlier.

What in the backend is trying to use ImageMagick instead of GD 2.0, and how do I undo it?

Last edited by Kaz (2012-11-08 21:58:12)

Offline

 

#2 2012-11-06 23:01:08

flop25
Piwigo Team
2006-07-06
7037

Re: Backend attempting to using ImageMagic and generating http 500 error

Hello
Weird
Use http://piwigo.org/doc/doku.php?id=pwg24 … magemagick  but it's recommended to use IM


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#3 2012-11-07 14:02:58

Kaz
Member
2012-11-06
18

Re: Backend attempting to using ImageMagic and generating http 500 error

Thanks for the reply, but I don't really see how that helps.

First off, and most importantly, I do not wish to use ImageMagick. As ImageMagick is not even installed on the server, all I would end up doing is preventing the browser upload script from working and I'd be in a worse place.

The gallery worked fine initially until something was changed, probably by one of the plugins on the site, which as there was no warning saying otherwise, I had assumed were tested first??. The default for the installation is GD. Piwigo worked fine using GD for 122 uploads. I wish to use GD.

I installed Piwigo to avoid having to waste time writing a gallery script, but seem to instead by spending time troubleshooting. I like the basics of the program, and am prepared to give it a go, but I'm not installing additional functionality to my linux shell to do so, especially when that functionality is not required by default.

------

If it makes a difference, In addition to the plugins mentioned, I also temporarily installed the 'CoolIris-Piclens' plugin, but didn't like the way it turned the gallery into a giant CoolIris advert and disabled it.

------

Secondly, even if I did wish to install and use ImageMagick, the section you've linked my to says "Use the following variables with Localfiles Editor".

Use the variables where? When I enable LocalFiles editor the 'local config' tab just includes a comment saying "File does not exist and will be created by LocalFiles Editor".

If I click 'Display reference file : "config_default.inc.php"' then it says

Piwigo encountered a non recoverable error

_data//plugins/ no write access

#1    mkgetdir /...path to install..../gallery/plugins/user_tags/include/t4u_config.class.php(32)
#2    t4u_Config::__construct /...path to install..../gallery/plugins/user_tags/include/t4u_config.class.php(43)
#3    t4u_Config::getInstance /...path to install..../gallery/plugins/user_tags/init.php(31)
#4    include_once /...path to install..../gallery/plugins/user_tags/main.inc.php(35)
#5    include_once /...path to install..../gallery/include/functions_plugins.inc.php(236)
#6    load_plugin /...path to install..../www/gallery/include/functions_plugins.inc.php(250)
#7    load_plugins /...path to install..../gallery/include/common.inc.php(137)
#8    include_once /...path to install..../gallery/plugins/LocalFilesEditor/show_default.php(26)

_data is chmoded 777 (as is local and upload) and the _data/plugins directory 'does' have write access. Looking at the error message, there is clearly an error in the variables somewhere though, as the error uses a double forward slash.

Last edited by Kaz (2012-11-07 14:08:22)

Offline

 

#4 2012-11-07 19:14:15

flop25
Piwigo Team
2006-07-06
7037

Re: Backend attempting to using ImageMagic and generating http 500 error

Kaz wrote:

Thanks for the reply, but I don't really see how that helps.

because you should have read

Code:

// Library used for image resizing. Value could be 'auto', 'imagick',
// 'ext_imagick' or 'gd'.

Kaz wrote:

I installed Piwigo to avoid having to waste time writing a gallery script, but seem to instead by spending time troubleshooting

95% of the time it works perfectly 4.5% is due to exotic server config

You said

Kaz wrote:

I installed a gallery earlier today with version 2.4.5

but you updated your Piwigo, or...!?
because I can't understand what changed if you were previously in 2.4 yet

Kaz wrote:

When I enable LocalFiles editor the 'local config' tab just includes a comment saying "File does not exist and will be created by LocalFiles Editor".

Don't know why people blocks here.. could you help us improve that : what could be written there? Nothing like a blank page?
Do the blanks paper have a "write here" mention? ^^

Kaz wrote:

_data//plugins/ no write access

first time ever I see this
do you have a index.htm in it or others files? If yes what chmod?


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#5 2012-11-07 20:30:08

Kaz
Member
2012-11-06
18

Re: Backend attempting to using ImageMagic and generating http 500 error

This is a brand new gallery on a pretty standard server configuration, not an upgrade. There is nothing particularly 'exotic' about it.

The installation processes was as follows:

I downloaded the package version of 2.4.5 and uploaded to a 'gallery' directory. I followed the installation manual (rather than the net install). After installing I activated the 'Check Upgrades' plugin and nothing seemed to happen. I then decided to google for directory permissions (which are not documented in the installation manual).

I found a webpage that advised me to set the `_data` and `local` directories to chmod 777, and also (if I wanted to allow for user uploads) to set the `upload` directory to chmod 777. Those directories are currently set to 777.

I then proceeded to upload 122 images using the multi-file uploader (flash) from the admin interface. Once they were uploaded, I set up a few tags and decided to have a look through the plugins.

I downloaded a few plugins, a couple came up ad unsupported so I deleted them from the server (without activating them). I virtualized the structure (not really sure what benefit that gave me) and tested out the various other plugins to see if I wanted them or not. After testing them out, I deactivated the cooliris plugin, and left the others mentioned active.

I then went to upload a couple more images, received a server 500 error, and checked my apache2 error log to find the ImageMagick error.

The `_data` folder (chmod 777) contains a file called dummy.txt, no index file, and 4 folders. The folders are `combined`, `i`, `plugins` and `templates_c`. All are set with 777 permissions.

The `_data/combined` folder contains 42 items, all css or js files. It does not contain an index file.

The `_data/i` folder contains a subfolder called `upload` which contains nested subfolders for the date and a mixture of jpg and png files. With exception of the final folder containing files, no folders contain index files.

The `_data/plugins` folder contains index.htm and user_tags.dat.

The `_data/templates_c` folder contains an index file and a selection of template files with a .php extension.

All the directories inside `_data` have chmod 777, all the 'files' within those directories, are created with the server standard umask of 644.

The `local/config` directory contains the database.inc.php file I uploaded during the install process, an index file, and nothing else.

With regards to the Local Files editor, I'm a little confused by your question. Are you saying that the config file should (by default) be empty?

If so, then I'd changing the comment from 'File does not exist and will be created by LocalFiles Editor' to something else would be best. I'll have a quick think of what `I'd` put.

Offline

 

#6 2012-11-07 20:48:06

flop25
Piwigo Team
2006-07-06
7037

Re: Backend attempting to using ImageMagic and generating http 500 error

Kaz wrote:

The installation processes was as follows:

thx a lot!

Kaz wrote:

The `_data/plugins` folder contains index.htm and user_tags.dat.

okay so piwigo already created a dat files. So it's localfiles editor and it's double slash as you suspected

Kaz wrote:

Are you saying that the config file should (by default) be empty?

yes the local one, on the contrary of the default condig

So try
$conf['graphics_library'] = 'gd';
which should force piwigo to use GD only


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#7 2012-11-07 20:58:12

Kaz
Member
2012-11-06
18

Re: Backend attempting to using ImageMagic and generating http 500 error

In addition

I now have a local config file that contains :

Code:

// Library used for image resizing. Value could be 'auto', 'imagick',
// 'ext_imagick' or 'gd'. If value is 'auto', library will be choosen in this
// order. If choosen library is not available, another one will be picked up.
$conf['graphics_library'] = 'gd';

I still receive a server 500 error when trying to upload using the flash uploader. Although it no longer writes anything to my apache error log.

Offline

 

#8 2012-11-07 21:00:27

flop25
Piwigo Team
2006-07-06
7037

Re: Backend attempting to using ImageMagic and generating http 500 error

That's a first step ^^
Are your files bigger than the previous one? yoi might try to allocate more memory to php since Gd is the Graphical library


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#9 2012-11-07 21:02:10

flop25
Piwigo Team
2006-07-06
7037

Re: Backend attempting to using ImageMagic and generating http 500 error

Also could you try to use the other web upload form : "You are using the Flash uploader. Problems? Try the Browser uploader instead."


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#10 2012-11-07 22:25:28

Kaz
Member
2012-11-06
18

Re: Backend attempting to using ImageMagic and generating http 500 error

Yes, as mentioned in the original post, I 'can' use the browser based uploader.

It's not a memory issue.

I was previously able to upload 10 files at a time, all larger than the one I tried to upload earlier.

Ignoring the better option (flash uploader) because something odd has happened with the software isn't a fix. If I'm going to use it, I'd rather know what's wrong with the gallery and fix it.

I wish to have a gallery where users can upload, and if the default uploader doesn't work, then I'll just get bug reports from my userbase.

The server 500 error has to be coming from the piwigo code, because an 'actual' 500 error isn't occuring on the server (at least not anymore now it's been forced to use GD).

Maybe there would be a way to improve the quality of the error message?

I'm prepared to have a quick look the code, but don't want to have to read and understand the entire source, just to find the area that deals with flash uploads (rather than browser uploads).

I'd like to know where in the code this error 'could' happen.

To be honest, I'll switch to a different gallery if I can't find a reason for the error, rather than use software that - at least for this install - has an unknown error.

Offline

 

#11 2012-11-07 22:53:04

flop25
Piwigo Team
2006-07-06
7037

Re: Backend attempting to using ImageMagic and generating http 500 error

Kaz wrote:

Yes, as mentioned in the original post, I 'can' use the browser based uploader.
It's not a memory issue.
I was previously able to upload 10 files at a time, all larger than the one I tried to upload earlier.

My bad! I forgot that important point!

Kaz wrote:

Ignoring the better option (flash uploader) because something odd has happened with the software isn't a fix. If I'm going to use it, I'd rather know what's wrong with the gallery and fix it.

you're right and I'm gonna notify the dev who made this flash uploader

Kaz wrote:

Maybe there would be a way to improve the quality of the error message?

hard for 500 errors : you would need to write after each step in alog

check http://piwigo.org/dev/browser/trunk/adm … ss.inc.php
but as you can see there is add_uploaded_file() http://piwigo.org/dev/browser/trunk/adm … c.php#L155 and prepare_directory() you might check too
As you also can see many errors are handled yet


Kaz wrote:

To be honest, I'll switch to a different gallery if I can't find a reason for the error, rather than use software that - at least for this install - has an unknown error.

I would do the same. To be honest too the plugin Community is not ambitious enough to get a whole participative gallery.
But you can use pLoader or other extensions/software to upload in piwigo (but might require an admin account)


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#12 2012-11-07 23:08:27

Kaz
Member
2012-11-06
18

Re: Backend attempting to using ImageMagic and generating http 500 error

Thanks for that, I'll have a scan through.

Out of interest, is there a way of undoing whatever I did with the virtualize plugin?

As far as 'changing things' go, that plugin most certainly changed a lot.

Also

Code:

  function file_upload_error_message($error_code)
    .....
    default:
      return l10n('Unknown upload error');

is that server 500 (at least in the context we're talking about)??

Offline

 

#13 2012-11-07 23:18:10

flop25
Piwigo Team
2006-07-06
7037

Re: Backend attempting to using ImageMagic and generating http 500 error

500 errors is an apache error : the server was overloaded, or encounter a misconfiguration or a bug etc. So it's not a php/mysql/piwigo/smarty bug, in a sens the error returned was not an error classicly returned by php/mysql/piwigo/smarty. But that's the combination of these systems with Apache which caused this somehow... yes debugging is hard

The virtualize plugin changes Physical albums/pictures in /gallery folder, to virtual album and places pictures in /upload folder. I don't like the idea of sucj an bipolar system, and certainly one day virtual and physical album will be merged.

just googled the thing and you might use this http://www.redips.net/php/write-to-log-file/
If you change of gallery script could you at least help us to debug? in order to correct and improve Piwigo? :)


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#14 2012-11-08 16:46:56

Kaz
Member
2012-11-06
18

Re: Backend attempting to using ImageMagic and generating http 500 error

Flop, the 500 errors being reported by me, are not being generated by Apache. If an 'actual' 500 error was happening, I'd see a classic white screen apache error, and I'd see something reported in the apache error log.

Piwigo is displaying the name of the image being uploaded followed by the text HTTP Error (500), as per the attached image (screenshot 1). That text is coming from piwigo not the server, it's simply deciding that an unknown issue is the fault of the server.

Originally, piwigo was configured (according to screenshot 2) with GD as the graphics library of choice. Something in the Piwigo code was attempting to use ImageMagick which is not installed. As default config is for GD, that's not a true 'server error', thats a bug in the piwigo code. It just happens that because piwigo tried to access the shell, it was reported, now, because we're specifically specifiying gd as the library and avoiding some sections of code that were calling imagemagick in error.

Whatever the issue is, is related to how Piwigo is uploading image files, because GD works fine on my server. I know this because I use it a fair bit, I also know this because prior to activating a couple of plugins, everything worked.

I'm pretty sure the issues are related to incompatability between the flash uploader and a plugin.

Offline

 

#15 2012-11-08 16:48:37

Kaz
Member
2012-11-06
18

Re: Backend attempting to using ImageMagic and generating http 500 error

I just installed a second version of the boards, and after uploading the same image to the same place over and over, I now know 'which' plugin is responsible.

I'll go over it as soon as I've finished eliminating all the other plugins (just in case there are multiple responsible plugins)

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2022 · Contact