Upload error: bad image file

Okat
Okat's picture

Joined: 2009-04-05
Posts: 60
Posted: Sat, 2009-11-07 19:22

http://www.okat.nl

Didn't notice this before today, but I've been experiencing upload errors on my site. Tried uploading (different) images. I've tried several filetypes and different files and filenames (even some that were uploaded before), updated the G3 version (except for the var dir) to the latest git (gallery-gallery3-e300ede), upgraded all installed modules (gallery-gallery3-contrib-8ab32fe), ran the updater. Tried both GD2 and ImageMagick. Default and custom themes but the problem is still there.
I did not change file/dir permissions (before I tried to fix the problem) and I read threads containing upload errors. I'm positively at a loss.

PHP Version 5.2.4-2ubuntu5.7
Server API Apache 2.0 Handler
memory_limit 64M
Have no access to apache error logs
Have access to SSH

Maybe of interest:
Adding albums works, but they don't seem to be created in the 'albums' dir.
I noticed nothing being created in the temp dir

Stack trace:
#0 /home/vhosting/t/vhost0030521/domains/okat.nl/htdocs/www/modules/gallery/helpers/graphics.php(152): gallery_error_Core::error_handler('gallery_graphic...', Array)
#1 /home/vhosting/t/vhost0030521/domains/okat.nl/htdocs/www/modules/gallery/helpers/photo.php(126): graphics_Core::generate(Object(Item_Model))
#2 /home/vhosting/t/vhost0030521/domains/okat.nl/htdocs/www/modules/gallery/controllers/simple_uploader.php(65): photo_Core::create(Object(Item_Model), '/home/vhosting/...', 'DSC_20081228_17...', 'DSC 20081228 17...')
#3 [internal function]: Simple_Uploader_Controller->add_photo('2')
#4 /home/vhosting/t/vhost0030521/domains/okat.nl/htdocs/www/system/core/Kohana.php(291): ReflectionMethod->invokeArgs(Object(Simple_Uploader_Controller), Array)
#5 /home/vhosting/t/vhost0030521/domains/okat.nl/htdocs/www/system/core/Event.php(209): Kohana::instance()
#6 /home/vhosting/t/vhost0030521/domains/okat.nl/htdocs/www/system/core/Bootstrap.php(55): Event::run(Array)
#7 /home/vhosting/t/vhost0030521/domains/okat.nl/htdocs/www/index.php(86): require('/home/vhosting/...')
#8 {main}

Can someone help me with this?

Login or register to post comments
floridave
floridave's picture

Joined: 2003-12-22
Posts: 16311
Posted: Sat, 2009-11-07 23:17
Quote:
dding albums works, but they don't seem to be created in the 'albums' dir.

This is a issue. See if enabling debug mode gives some clue as to why that fails.
FAQ: How do I see debug information?

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

Login or register to post comments
Okat
Okat's picture

Joined: 2009-04-05
Posts: 60
Posted: Sun, 2009-11-08 09:06

I guess this problem became less interesting. Today the album is added to the "albums" folder.

I did add the local.php file as well, but don't see anything special apart from the following in the log:
Seems to be an imagemagick problem where there was none before. Resize error points to ImageMagick, right?

Running ImageMagick 6.3.7 06/04/09 Q16

2009-11-08 09:59:51 +01:00 --- error: Caught exception rebuilding image: DSC 20081201 230355-1
call_user_func_array() [<a href='function.call-user-func-array'>function.call-user-func-array</a>]: First argument is expected to be a valid callback, 'gallery_graphics::gallery_graphics::resize' was given
#0 /home/vhosting/t/vhost0030521/domains/okat.nl/htdocs/www/modules/gallery/helpers/graphics.php(152): gallery_error_Core::error_handler('gallery_graphic...', Array)
#1 /home/vhosting/t/vhost0030521/domains/okat.nl/htdocs/www/modules/gallery/helpers/photo.php(126): graphics_Core::generate(Object(Item_Model))
#2 /home/vhosting/t/vhost0030521/domains/okat.nl/htdocs/www/modules/gallery/controllers/simple_uploader.php(65): photo_Core::create(Object(Item_Model), '/home/vhosting/...', 'DSC_20081201_23...', 'DSC 20081201 23...')
#3 [internal function]: Simple_Uploader_Controller->add_photo('2')
#4 /home/vhosting/t/vhost0030521/domains/okat.nl/htdocs/www/system/core/Kohana.php(291): ReflectionMethod->invokeArgs(Object(Simple_Uploader_Controller), Array)
#5 /home/vhosting/t/vhost0030521/domains/okat.nl/htdocs/www/system/core/Event.php(209): Kohana::instance()
#6 /home/vhosting/t/vhost0030521/domains/okat.nl/htdocs/www/system/core/Bootstrap.php(55): Event::run(Array)
#7 /home/vhosting/t/vhost0030521/domains/okat.nl/htdocs/www/index.php(86): require('/home/vhosting/...')
#8 {main}
2009-11-08 09:59:51 +01:00 --- alert: exception 'ErrorException' with message 'call_user_func_array() [<a href='function.call-user-func-array'>function.call-user-func-array</a>]: First argument is expected to be a valid callback, 'gallery_graphics::gallery_graphics::resize' was given' in /home/vhosting/t/vhost0030521/domains/okat.nl/htdocs/www/modules/gallery/helpers/graphics.php:152
Stack trace:
#0 /home/vhosting/t/vhost0030521/domains/okat.nl/htdocs/www/modules/gallery/helpers/graphics.php(152): gallery_error_Core::error_handler('gallery_graphic...', Array)
#1 /home/vhosting/t/vhost0030521/domains/okat.nl/htdocs/www/modules/gallery/helpers/photo.php(126): graphics_Core::generate(Object(Item_Model))
#2 /home/vhosting/t/vhost0030521/domains/okat.nl/htdocs/www/modules/gallery/controllers/simple_uploader.php(65): photo_Core::create(Object(Item_Model), '/home/vhosting/...', 'DSC_20081201_23...', 'DSC 20081201 23...')
#3 [internal function]: Simple_Uploader_Controller->add_photo('2')
#4 /home/vhosting/t/vhost0030521/domains/okat.nl/htdocs/www/system/core/Kohana.php(291): ReflectionMethod->invokeArgs(Object(Simple_Uploader_Controller), Array)
#5 /home/vhosting/t/vhost0030521/domains/okat.nl/htdocs/www/system/core/Event.php(209): Kohana::instance()
#6 /home/vhosting/t/vhost0030521/domains/okat.nl/htdocs/www/system/core/Bootstrap.php(55): Event::run(Array)
#7 /home/vhosting/t/vhost0030521/domains/okat.nl/htdocs/www/index.php(86): require('/home/vhosting/...')
#8 {main}

Login or register to post comments
Okat
Okat's picture

Joined: 2009-04-05
Posts: 60
Posted: Mon, 2009-11-09 09:56

By the way; I tried the rescue module as well. And replaced (all) the core files too.
Might be something left I didn't think of apart from installing (including SQL) all over, which I'd rather not do (hassle with users table and uploading all images again), unless you think this is the wisest option.

Just updated everything to latest git (gallery-gallery3-47e0d91). Problem is still there.

Remembered someting: My theme uses thumbnail sizes of 150px, changing it back still produces the same errors.

Login or register to post comments
Okat
Okat's picture

Joined: 2009-04-05
Posts: 60
Posted: Mon, 2009-11-09 19:04

Well, did a complete new install including the database and the problem went away. Still don't know why it happened. Not what I really wanted, since I have to add all groups and users and galleries again, but it's beta after all.

Login or register to post comments
Okat
Okat's picture

Joined: 2009-04-05
Posts: 60
Posted: Mon, 2009-11-09 19:53

Hmm, this is odd. I inserted rows from my old database into the newly created "users", "groups" and "groups_users" tables and all of a sudden I get the error again. After deleting the rows again (apart from the default users/groups) the upload works again. Am trying to reproduce.

Login or register to post comments
Okat
Okat's picture

Joined: 2009-04-05
Posts: 60
Posted: Tue, 2009-11-10 21:52

Unless no-one is really interested, of course

Login or register to post comments
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 9271
Posted: Tue, 2009-11-10 22:58

o.k. I'll bite.

Quote:
I inserted rows from my old database into the newly created "users", "groups" and "groups_users" tables and all of a sudden I get the error again.

Why? There is no API developed yet for G3 to externally do stuff like this. Create the users and groups through the interface to make sure they get created properly.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

Login or register to post comments
Okat
Okat's picture

Joined: 2009-04-05
Posts: 60
Posted: Tue, 2009-11-10 23:25

I know there's no API to do that. It is however a way to insert users into the gallery again. One that is bound to be used by more people than just me. Especially while G3 is still in Beta.
Anyway, I thought someone might be interested because the error someone gets isn't something someone could relate to a (broken) users or groups table. So I thought it might be of interest to
someone.
Haven't been able to totally reproduce. I inserted users this way but created groups the normal way and added the users to the groups the normal way. Everything still works.

Someone who gets the "upload error" and added users/groups the same way as me might read this and know where the problem came from.

My playground (using customized 3nids theme) http://www.okat.nl

Login or register to post comments