Image Upload doesn't work.

zappzarapp

Joined: 2009-10-21
Posts: 11
Posted: Wed, 2009-10-21 12:21

Hi,

I installed Gallery3 without any Problems on my Webspace und everything semms to work ok, but i can't upload any images. (I already worked myself through a lot of threads in this forum but wasn't able to solve the problem by myself)

I created an Album and when I try to upload pictures I have the following problem (i tried it with a 100kB File so it can't be that the file is to big):

First everything seems to be ok:

Then i select a picture and they get uploaded (not really, but the upload animation plays):

When it's completed and i click on close the page refreshes and there are no images in the gallery:

In the var/logs i get the following entry (everytime i try to upload an image):
2009-10-21 14:05:53 +02:00 --- error: Uncaught Exception: @todo FORBIDDEN in file modules/gallery/helpers/access.php on line 189
There are no other entries in the log-file.

The folders for my album "Matthias-Test" got created in var/albums,resizes,thumbs but they are empty. But since the folders got created i don't think it's a write permission problem.

The PHP-Info from the server can be seen here (but it's only a html snapshot - the gallery3 server isn't zappzarapp.at):
http://zappzarapp.at/grafiken/gallery3/php_info.html

If someone is willing to take a closer look at the gallery i can send the URL,Admin Account Data to them with a private message or e-mail.

~~
Matthias

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 22888
Posted: Wed, 2009-10-21 13:36

2 things that spring to mind from your php info:
upload_tmp_dir is empty.
I know nothing about suhosin but have seen issues about it in the passed.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
zappzarapp

Joined: 2009-10-21
Posts: 11
Posted: Thu, 2009-10-22 05:01

Hm.. but i also have a TYPO3 and Wordpress Installation on the same server and there the upload works fine (with upload_tmp_dir set to No value) I could try to ask the Hosting-Company if they could (temporarily) turn of suhosin.

Matthias

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16503
Posted: Sun, 2009-10-25 09:20

I don't know much about suhosin, but I do know there are 2 versions. One is a "patch" and one is some plugin of sorts. The patch seems to not interfere with much if anything, the full on plugin seems to have some flags, that when set, interfere with all kinds of web applications.

So I doubt it's suhosin for you. Could be, but I doubt it.

I would also try upgrading to the latest experimental code.
http://codex.gallery2.org/Gallery3:Upgrading
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
zappzarapp

Joined: 2009-10-21
Posts: 11
Posted: Tue, 2009-10-27 14:19

The only difference with the latest experimental code is a broken layout.. the upload still doesn't work.
But i have another error message in the log File but can't make anythink of it:

Quote:
2009-10-27 15:17:03 +01:00 --- error: Uncaught Exception: @todo FORBIDDEN in file modules/gallery/helpers/access.php on line 189
2009-10-27 15:17:03 +01:00 --- error: #0 /www/htdocs/w00a900a/web/gallery3/modules/gallery/helpers/access.php(121): access_Core::forbidden()
#1 /www/htdocs/w00a900a/web/gallery3/modules/gallery/controllers/simple_uploader.php(42): access_Core::required('add', Object(Item_Model))
#2 [internal function]: Simple_Uploader_Controller->add_photo('2')
#3 /www/htdocs/w00a900a/web/gallery3/system/core/Kohana.php(291): ReflectionMethod->invokeArgs(Object(Simple_Uploader_Controller), Array)
#4 /www/htdocs/w00a900a/web/gallery3/system/core/Event.php(209): Kohana::instance()
#5 /www/htdocs/w00a900a/web/gallery3/system/core/Bootstrap.php(55): Event::run(Array)
#6 /www/htdocs/w00a900a/web/gallery3/index.php(86): require('/www/htdocs/w00...')
#7 {main}

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16503
Posted: Tue, 2009-10-27 15:34
Quote:
The only difference with the latest experimental code is a broken layout..

Follow the tips for unpacking the code EXACTLY:
http://codex.gallery2.org/Gallery3:Upgrading

If you just overwrite your files, then there are some orphaned files and because of Kohana's cascading file system they too are getting loaded and creating double login links and other issues.

As for uploading. Are you able to use the Server Add option?
http://codex.gallery2.org/Gallery3:Modules:serveradd
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
zappzarapp

Joined: 2009-10-21
Posts: 11
Posted: Tue, 2009-10-27 18:23

Ok,
i made a fresh install of the experimental version - the "Server Add Option" works (thanks) - but i still can't upload the images the "normal" way.

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16503
Posted: Tue, 2009-10-27 18:58

Then do try to add a valid path to upload_tmp_dir. I don't know about Typo3, but perhaps our flash uploader works differently than WPs

You could also try using Wireshark to watch the network traffic while uploading (don't ask how to use it, I can barely manage with it)

Also try from a different network. You could try sending me a PM (click write to author) login details and I can try uploading using the Simple Uploader. Try from different browsers and different versions of flash.

What Operating System and browser are you using? Windows and Firefox? Try reinstalling flash with the latest version?
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16503
Posted: Tue, 2009-10-27 20:09

Let's try getting some debug info:
FAQ: How do I see debug information?

Also, see if you can get your host to get ImageMagick installed and try that instead of GD.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
zappzarapp

Joined: 2009-10-21
Posts: 11
Posted: Wed, 2009-10-28 05:54

If i activate the debug-mode and upload images it works exactly like without the debug-mode (seems like it uploads, but doesn't)

I wanted to change to ImageMagick, here are my TYPO3 Imagemagick Settings:

But if i change the gallery3 settings to the following:

i get "We could not locate ImageMagick on your system."

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16503
Posted: Wed, 2009-10-28 13:07

Do you have SSH access?

If so, go to the command line and type which convert
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
zappzarapp

Joined: 2009-10-21
Posts: 11
Posted: Wed, 2009-10-28 17:33

Well i don't have a SSH Access, but the PHP-Code
passthru("/usr/bin/composite");
gets me the following result:

Quote:
Version: ImageMagick 6.3.8 02/18/08 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2008 ImageMagick Studio LLC

Usage: composite [options ...] image [options ...] composite
[ [options ...] mask ] [options ...] composite

Image Settings:
-affine matrix affine transform matrix
-alpha option activate, deactivate,
.....
.....

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16503
Posted: Wed, 2009-10-28 18:59

Try:
<?php echo exec('which convert'); ?>

____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
zappzarapp

Joined: 2009-10-21
Posts: 11
Posted: Wed, 2009-10-28 19:32

This gets no result. But passthru is the same like exec with the difference that the output of the command line function is passed to the browser directly - so with the passthru("usr/bin/convert") the convert function in the /usr/bin direcory gets executed and i get the command line reply with the help because i passed no parameters:

Quote:
Version: ImageMagick 6.3.8 02/18/08 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2008 ImageMagick Studio LLC

Usage: convert [options ...] file [ [options ...] file ...] [options ...] file

Image Settings:
-adjoin join images into a single multi-image file
-affine matrix affine transform matrix
-alpha option activate, deactivate, reset, or set the alpha channel
-antialias remove pixel-aliasing

So even if the "which convert" doesn't give a result, the convert file is in /usr/bin and executeable (or i wouldn't get a result with the passthru function) i think.

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16503
Posted: Wed, 2009-10-28 19:41

The which command is what Gallery uses to find the binary to use. If you can't execute the which command or it's not on your server this is going to fail.

I believe right now the only option to get around this is to edit a few files.

Looks like 2 lines in modules/gallery/helpers/graphics.php and modules/gallery/helpers/movie.php

Or ask your host if they'll install it or make it available for you.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
zappzarapp

Joined: 2009-10-21
Posts: 11
Posted: Wed, 2009-10-28 20:45

I understand, but (if i understand correct) why do i have the option to set the imagemagick path in the configuration when the gallery is trying to find it by itself and not (?) relying on the path set in the config.

I think the Gallery should use the config path if a path is given and only try to find it by itself if there is no path available.

I made the following change in graphics.php

Quote:
// ImageMagick
$path = exec("which convert");
$path = "/usr/bin/convert";

and now im gets recognized.

But it didn't change the upload problem - still can't upload photos.

Matthias

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16503
Posted: Wed, 2009-10-28 20:56

Please upgrade to the latest experimental code. I just noticed your core version is 14. That's several weeks old now
http://codex.gallery2.org/Gallery3:Upgrading

It may or may not fix this, but I really don't want to troubleshoot something using old code when there is a possibility the problem has been fixed.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
zappzarapp

Joined: 2009-10-21
Posts: 11
Posted: Wed, 2009-10-28 21:29

Ok,
i downloaded the latest source from the website, renamed the old gallery3 folder, copied the new files in a new gallery3 folder and copied the old var directory to the new folder. Then i started the upgrader and upgraded to core version 16. But my Upload Problem just doesn't want to go away..

I just don't know what this error message in the logfile means:

Quote:
2009-10-28 22:24:53 +01:00 --- error: Uncaught Exception: @todo FORBIDDEN in file modules/gallery/helpers/access.php on line 189
2009-10-28 22:24:53 +01:00 --- error: #0 /www/htdocs/w00a900a/web/gallery3/modules/gallery/helpers/access.php(121): access_Core::forbidden()
#1 /www/htdocs/w00a900a/web/gallery3/modules/gallery/controllers/simple_uploader.php(42): access_Core::required('add', Object(Item_Model))
#2 [internal function]: Simple_Uploader_Controller->add_photo('37')
#3 /www/htdocs/w00a900a/web/gallery3/system/core/Kohana.php(291): ReflectionMethod->invokeArgs(Object(Simple_Uploader_Controller), Array)
#4 /www/htdocs/w00a900a/web/gallery3/system/core/Event.php(209): Kohana::instance()
#5 /www/htdocs/w00a900a/web/gallery3/system/core/Bootstrap.php(55): Event::run(Array)
#6 /www/htdocs/w00a900a/web/gallery3/index.php(86): require('/www/htdocs/w00...')
#7 {main}

But maybe the server where i installd it just sucks ;) (TYPO3 and Wordpress are running on it without problems though)

Matthias

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16503
Posted: Wed, 2009-10-28 22:20

I'm going to have to have a developer poke their head in here. I'm studying your error message closer. I'm just guessing here so I may be way off base, but...

Quote:
2009-10-27 15:17:03 +01:00 --- error: #0 /www/htdocs/w00a900a/web/gallery3/modules/gallery/helpers/access.php(121): access_Core::forbidden()

If I'm reading that right, on line 121 of access.php it's checking to see if the user has access. Well you do because you're logged in as admin, but I'm wondering if for some reason the flash uploader is some how not using your session. Which seems like this has popped up for someone else before, but I can't seem to find that thread.

Do you know what version of Apache is running on the server?

____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
zappzarapp

Joined: 2009-10-21
Posts: 11
Posted: Thu, 2009-10-29 11:42

The Apache Version is 2.2.10

 
Calanquemar

Joined: 2009-10-14
Posts: 9
Posted: Sun, 2009-11-01 08:57

Hi there,

I got the same problem with the last G3 upgrade BUT :

I did upload 700 photos before today, then installed/desinstalled some softwares like Adobe Dreamweaver and reloaded
Flash plugin.

Now, I can't upload anymore. Well, the image is loaded but when I want to end, I get this message :

Alors, l'erreur est la suivante :
@todo FORBIDDEN

Fichier : modules/gallery/helpers/access.php, ligne : 189
Et voici comment nous sommes arrivés ici :
modules/gallery/helpers/access.php [390]:
access_Core::forbidden( )
modules/gallery/controllers/simple_uploader.php [87]:
access_Core::verify_csrf( )
Simple_Uploader_Controller->finish( )
system/core/Kohana.php [291]:
ReflectionMethod->invokeArgs( Simple_Uploader_Controller Object
(
[uri] => URI Object
(
)

[input] => Input Object
(
[use_xss_clean:protected] => 1
[magic_quotes_gpc:protected] => 1
[ip_address] =>
)

)
)
system/core/Event.php [209]:
Kohana::instance( )
system/core/Bootstrap.php [55]:
Event::run( Array
(
[0] => Kohana
[1] => instance
)
)
index.php [86]:
require( system/core/Bootstrap.php )[/i]

I tried many different browsers, IE 8, Opera 10, FF 3.5, same error, it's really annoying !
(Server Apache version is 2.2.13)

I reinstalled G3 to a new directory and copied the Var directory in it.
All the directories have -755 and nevertheless I get the message
"Album is not writable" :-(

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7934
Posted: Sun, 2009-11-01 18:04

Are you using Suhosin? The Flash uploader is actually a slightly different client than your browser and while we use tricks to try to make sure that the Flash uploader shares the same session as your browser, it's possible that in your case this is failing. We know that Suhosin can interfere. We check for this situation, but perhaps we're overlooking a setting.

Here's a related FAQ:
http://codex.gallery2.org/Gallery3:FAQ#Why_am_I_seeing_errors_about_suhosin.session.encrypt.3F
---
Problems? Check gallery3/var/logs
bugs/feature req's | upgrade to the latest code | use git

 
Calanquemar

Joined: 2009-10-14
Posts: 9
Posted: Sun, 2009-11-01 19:28

Hi,
Thanks for taking some of your (precious) time to give a help.

I dunno what Suhosin is lol, but I discovered important things that may help other ppl :

- My Windows is Vista SP2 (a fresh one on a new Dell PC too).

- I DELETED ALL the files from the (hidden) directories /users/AppData/TEMP
This directory was full of files cuz I installed/desinstalled some softwares.
(I understood something was wrong here when suddenly, I couldn't launch a new soft I had bought 2 days ago).

- I had some TOOLSBARS in IE8, I'm sure most of ppl have those toolbars too.
I DELETED ALL OF THEM ! For instance, The Google Toolbar in IE8 was hiding some small windows
in G3 !

- I set OFF the windows popup blocker

- I desinstalled ALL the plugins (Adobe, Macromedia...) and reinstalled ONLY the really
necessary ones for Gallery3.

And... The miracle came : I can know upload, EVEN with the error. I mean, from time to time (maybe in the sub-albums), I get the error when adding pics BUT they are in, despite the errors !

I tested IE8, FF3.5 and Safari (from Apple). With IE8, I discovered one more thing, from time to time I lose the Admin Mode, dunno why. Of course without clicking disconnect ;-)

I hope that can help !
Thanks again for your great job :-)