Photo upload with Custom Fields module returns Error 400 - Invalid upload with Chrome, works with I.E./FF

kydan

Joined: 2013-02-25
Posts: 13
Posted: Mon, 2013-02-25 18:36

While writing the post below I found that using Chrome 24.0.1312.57 m and up to 25.0.1364.97 (latest at time of writing) causes this problem, while under IE and FF upload seems to work, albeit with a strange bug where the green bar of a successful upload will disappear from the list after about 5 seconds. However, the photos and their custom fields still appear. Not sure if anyone can help with this, but since I spent so much time writing it up, I figured I'd have it out there so others dont go through the same pain.

Quote:
Hi guys,

Im having trouble with a gallery3 instance. When I try to upload any photo, regardless of size, I get an error saying the file is too large. However, I have a my memory_limit set at 128M, my post_max_size at 10M and upload_max_filesize = 12M. The photos are well under 1 MB. Using the developer console in Chrome I find that I am getting 400 Bad Request ERROR: Invalid upload back from the server. According to the documentation found here: http://codex.galleryproject.org/Gallery3:Troubleshooting:Uploading an 400 error is caused by the following:

Your temp directory is not writable
Your temp directory is full
Your max size setting for upload size is to low.

there is no documentation as to which "temp" folder is being referred to here. If its /var/www/gallery/var/temp - i've cleared that, and its got the same permissions and ownership as the rest of the var directory.

PHP 5.3.10
Gallery 3.0.4
Apache 2.2.22

 
kydan

Joined: 2013-02-25
Posts: 13
Posted: Wed, 2013-03-06 15:32

Further troubleshooting shows that this is not limited to chrome. Safari and FF on OSX also have the same issue. I'm at a loss as to what the problem is! Any help?

Nick

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sun, 2013-03-10 17:57

I just installed the custom fields module and don't have any issues adding items.
Post what the gallery3/var/logs/ say

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
kydan

Joined: 2013-02-25
Posts: 13
Posted: Mon, 2013-03-11 16:21

floridave,

my var/www/gallery/var/logs/2013-03-11.log.php log shows only the following:

<?php defined('SYSPATH') or die('No direct script access.'); ?>

Im not sure why its writing out a bit of php code like that to a log file, searching for the line only turned up the option to create a local.php file to enable more verbose logging. http://codex.galleryproject.org/Gallery3:FAQ

I did that, and saw no additional debugging.

Beforehand I was noticing that I was getting the error in my logs: date_default_timezone_get(): It is not safe to rely on the system's timezone settings so I added date.timezone="americas/new york" to my php.ini for apache2. I dont suspect this is related, but thats all I got so far.

Kydan

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Mon, 2013-03-11 20:17

This bit of php code <?php defined('SYSPATH') or die('No direct script access.'); ?> is to prevent others from viewing the logs from a browser in other words normal for all log files.
Is the one line fromt the logs after you try to add a item?

Don't know then. It works for me, perhaps the author or other community members have ideas.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
kydan

Joined: 2013-02-25
Posts: 13
Posted: Tue, 2013-03-12 17:37

Dave,

yep that is the only line I get when I try to add. Just to test, I deleted the latest log and then immediately reuploaded a photo with the module enabled and the log only has the one line: <?php defined('SYSPATH') or die('No direct script access.'); ?> Is there a quick way to make logging more verbose? I'm at a loss as to how to get more info on this. It was working fine a few weeks ago, and I'm not sure what has changed. Also, do you know if the dev is still around?

Kydan

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2013-03-12 19:26

FAQ: How do I see debug information?
The Apache error logs might yield a clue.

I'm assuming he is still about. Send him a PM or facebook poke,
http://galleryproject.org/node/101988#comment-379742

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
kydan

Joined: 2013-02-25
Posts: 13
Posted: Tue, 2013-03-12 19:56

alas, I have tried the what's listed in that FAQ entry already. there is nothing in my apache error.log nor the access.log and creating a local.php didnt reveal anything else additional either. I'll try PM'ing the dev.