[Unsolved mystery...] Archive upload, files won't delete

grooveman

Joined: 2010-02-22
Posts: 43
Posted: Sun, 2010-02-28 18:07

Using php 5.2.6, with archive updload 1.0.10 with gallery-2.3.1-typical-en on a Debian Lenny system.

I have checked the perms on my g2data/lock folder, and it is accessible. I have turned on debugging, but see no error output. I have tested the unzip binary using the Import:Archive link on the left side of the admin panel (at the bottom), and it passes. I have checked the perms of the unzip binary, and that is fine. I have checked the apache logs, and don't see any error output. I have checked that the archive(s) I'm uploading are smaller than the max_post and max_upload size in my config.php -- and they are.

What happens every time I try to upload is that it takes me to a page where an orange progress bar is at the top of the screen, it looks like it is about to do something, but then the "continue" link pops up before the bar moves across the screen. I click on "continue", and I'm back at the upload screen. I check the gallery, and it is still empty.

I cannot think of anything I did wrong, and I'm not seeing anything that wreaks of error output.

Can someone help?

Thank you.

 
Logics
Logics's picture

Joined: 2010-03-11
Posts: 6
Posted: Mon, 2010-03-15 03:33

Same problem here except, depending on what method I use to upload, it sometimes returns a error, "upload error".

Yeah, I figured that out myself. Once (and only once) I managed to get the zip file uploaded but it only showed up in my gallery as a zip file. When you click on it, it asked where do you want to save the file on your local computer. I was not able to repeat that one time.

Gallery URL = http://hosein.office-on-the.net/gallery2/main.php
Gallery version = 2.3.1 core 1.3.0.1
API = Core 7.54, Module 3.9, Theme 2.6, Embed 1.5
PHP version = 5.2.10-2ubuntu6.4 apache2handler
Webserver = Apache/2.2.12 (Ubuntu)
Database = mysqli 5.1.37-1ubuntu5.1, lock.system=flock
Toolkits = LinkItemToolkit, Thumbnail, jpegtran, Getid3, Dcraw, NetPBM, Ffmpeg, ImageMagick, ArchiveUpload, Gd, Exif, SquareThumb
Acceleration = none/0, none/0
Operating system = Linux Evo 2.6.31-20-generic #57-Ubuntu SMP Mon Feb 8 09:05:19 UTC 2010 i686
Default theme = matrix
gettext = enabled
Locale = en_US
Browser = Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.0.249.89 Safari/532.5
Rows in GalleryAccessMap table = 96
Rows in GalleryAccessSubscriberMap table = 217
Rows in GalleryUser table = 4
Rows in GalleryItem table = 212
Rows in GalleryAlbumItem table = 26
Rows in GalleryCacheMap table = 0

+++++++++
Me? A pushover?
Certainly not! Nobody uses Logics. ;-)

 
dduleep

Joined: 2010-03-31
Posts: 9
Posted: Thu, 2010-04-01 03:25

i can't upload zip file for G2 but Archive Upload Settings is

Quote:
unzip binary test results

Binary Name Pass/Fail
unzip Passed

anybody know what i do for upload and extract zip photo album plz help to me.

 
Logics
Logics's picture

Joined: 2010-03-11
Posts: 6
Posted: Thu, 2010-04-01 13:55

I have now found that I can upload zip files, just not from the computer that hosts my gallery. If I log into my gallery website from another computer, I can upload zip files and have them properly unzipped and placed into albums, etc.

If I use Firefox on my Ubuntu LAMP (Linux 2.6.31, Apache2, MySQL5, PHP5) box that hosts my Gallery2, it fails as pointed out above.

So is it my Ubuntu or my Gallery? Why would it work from any other computer (Mostly Firefox or Chrome on Win2K) but not on Firefox/Ubuntu? Is it because it is the same machine or is it because it is Firefox/Ubuntu?

Is your failure on the host machine and what are you hosting on and which browser are you using?

+++++++++
Me? A pushover?
Certainly not! Nobody uses Logics. ;-)

 
grooveman

Joined: 2010-02-22
Posts: 43
Posted: Fri, 2010-04-02 01:55

Not on the same machine. It is uploaded for a separate machine, and I have tried on other machines as well. Same thing happens every time. m The hosting machine doesn't even have a gui on it. Using firefox on a gentoo box. Gallery is hosted on a debian lenny box.

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Fri, 2010-04-02 15:57

Grooveman and dduleep, post your system info and a link to phpinfo:
FAQ: What information is required when I ask for help in the forums?
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
grooveman

Joined: 2010-02-22
Posts: 43
Posted: Sat, 2010-04-03 02:35

That's a lot of info, but here it is...

I appreciate the help.

The link to my phpinfo.

My System is a Debian Lenny system, with these packages installed:

REMOVED -- NOT NEEDED

Thanks again.

G

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Sat, 2010-04-03 02:55

Wrong system info :)

Click this link and follow the steps:
FAQ: What information is required when I ask for help in the forums?
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
grooveman

Joined: 2010-02-22
Posts: 43
Posted: Sat, 2010-04-03 21:48

Whoops! Sorry about that. Here is the information from my "System information":

 Last Run Details:

Gallery URL = https://www.myserver.com/gallery2/main.php  //edited
Gallery version = 2.3.1 core 1.3.0.1
API = Core 7.54, Module 3.9, Theme 2.6, Embed 1.5
PHP version = 5.2.6-1+lenny4 apache2handler
Webserver = Apache/2.2.9 (Debian) PHP/5.2.6-1+lenny4 with Suhosin-Patch mod_ssl/2.2.9 OpenSSL/0.9.8g
Database = mysqli 5.0.51a-24+lenny2, lock.system=flock
Toolkits = ArchiveUpload, Exif, Gd, Ffmpeg, NetPBM, jpegtran, ImageMagick
Acceleration = none, none
Operating system = Linux mywebserver 2.6.26-2-xen-amd64 #1 SMP Thu Nov 5 04:27:12 UTC 2009 x86_64 //edited
Default theme = matrix
gettext = enabled
Locale = en_US
Browser = Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.6) Gecko/20100117 Gentoo Firefox/3.5.6
Rows in GalleryAccessMap table = 22
Rows in GalleryAccessSubscriberMap table = 64
Rows in GalleryUser table = 14
Rows in GalleryItem table = 64
Rows in GalleryAlbumItem table = 11
Rows in GalleryCacheMap table = 0 

Thanks again!

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Sun, 2010-04-04 15:45

First, are you uploading movie files?

If not, disable ffmpeg under Site Admin > Plugins. If so, how big?

Also disable GD and NetPBM

Now go to Site Admin > Archive (under the Import section on the bottom of the left side) and click Test Settings. Does it pass or fail?

If it passes, then go to Site Admin > ImageMagick and click Test Settings. Does it pass or fail?

If that also passes, now try importing again.

If that still doesn't work. Then put Gallery into debug mode and try importing again. That's going to generate a lot of debug output. Copy and paste the debug output from the main screen into a text file, zip and attach to this thread. You can ignore the Smarty Debug popup window, that info isn't needed for this.
FAQ: How to set/use Gallery in debug mode?

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

 
grooveman

Joined: 2010-02-22
Posts: 43
Posted: Mon, 2010-04-05 12:53

I have not uploaded any movie files yet, but I wanted the option should I need to do so (I think that eventually, I will).

I have disabled ffmpeg, gd and NetPBM, as you suggested.

Archive upload passes the test.

ImageMagick still passes all tests.

The file upload still fails.

I put the server back into debug mode, and I'm attaching the output.
I still don't see anything weird in the output, but I'm not a php programmer either...

Thanks.

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Mon, 2010-04-05 15:14

I don't see anything weird either. I also don't see anything in there where it's even attempting to do the import.

How big is the zip file you're trying to import? Could you leave Gallery in Debug mode and PM me login details along with a link to the zip file in question?
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
grooveman

Joined: 2010-02-22
Posts: 43
Posted: Tue, 2010-04-06 14:15

I have tried zip files of all different sizes, including pathetically small files -- all of which are under (or well under) the maximum upload size.

Sure, I'll do that (pm you).

Thanks!

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Mon, 2010-04-12 18:23

grooveman,

Got your messages and took a deeper look. I'm getting this error when trying to delete or upload files:

Quote:
Notice: Undefined offset: 698490528 in /var/www/localhost/gallery2/modules/core/classes/GalleryLockSystem.class on line 239

Warning: Cannot modify header information - headers already sent by (output started at /var/www/localhost/gallery2/modules/core/classes/GalleryLockSystem.class:239) in /var/www/localhost/gallery2/modules/core/classes/GalleryPhpVm.class on line 142

I rezipped your zip and was able get a little further, but still got the same error. I then changed from file locking to database locking and everything works. I'd double and triple check the permissions on your g2data/locks directory and maybe manually clean it out if you want to use file locking, which on Linux is typically faster and a bit more stable.

This FAQ may or may not help:
FAQ: I suddenly got an "ERROR_LOCK_TIMEOUT" message, what do I do?
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
grooveman

Joined: 2010-02-22
Posts: 43
Posted: Tue, 2010-04-13 00:11

Okay, Thank you for that Niv, now we are getting somewhere. I switched back to file locking for more trouble-shooting.

The problem seems to be that the files that are used in the g2data/locks dir do not have the correct perms. Gallery creates these files on the fly, so there doesn't seem to be anything I can do about it. I set ~/g2data/locks to 777.

When I try to delete a picture from the gallery, it creates a couple files in ~/g2data/locks:

-rw-r--r-- 1 www-data www-data 0 Apr 12 20:07 434
-rw-r--r-- 1 www-data www-data 0 Apr 12 20:07 435

Gallery errors out, with the locking error that we have become so familiar with.

then, on the command line, I issue a chmod 666 * to the files:

-rw-rw-rw- 1 www-data www-data 0 Apr 12 20:07 434
-rw-rw-rw- 1 www-data www-data 0 Apr 12 20:07 435

Then in gallery, I go to delete the files, and they delete without complaint.

I try again, and the same problems occur. How do I force gallery to set the right perms on the lock files? Why does it need to be so permissive anyway? www-data is the owner and group for the files, so I would think gallery should have full rights... What user does gallery use, if not www-data?

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Tue, 2010-04-13 02:10

Those are the right permissions. 777 and then the user the webserver runs as (www-data in your case, ubuntu?, debian?) can create the files. Since www-data is the owner of the files it has the proper permissions 644 -- read/write (6-owner) read (4-group) read (4-everyone)

It should be able to read, write, delete those files without issue. You've got something else going on on your server that's preventing proper operation.

You can change the permissions G2 sets on files under Site Admin > General, but I really don't think that's going to fix this problem. The permissions are correct, but you've got something going on on the server that prevents the webserver from deleting files it owns and has permission to delete.

What happens when you upload just a single jpg or create an album? Are you able to delete them?
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
grooveman

Joined: 2010-02-22
Posts: 43
Posted: Tue, 2010-04-13 03:12

Yes, after some experimentation, I cannot replicate my results from a couple hours ago. I still can't delete anything. I think I'm barking up the wrong tree there...

I can upload a single jpg at a time with no problems... but deleting it causes the same problem (when I have file locking turned on), and I also cannot delete the album...

grr...

I'm getting these in my apache2 error log:

PHP Warning:  Invalid argument supplied for foreach() in /var/www/localhost/gallery2/modules/core/classes/FlockLockSystem.class on line 134, referer: https://www.myserver.com/gallery2/main.php?g2_view=core.ItemAdmin&g2_subView=core.ItemDelete&g2_itemId=7&g2_selectedId=598
 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Tue, 2010-04-13 04:19

I don't know. G2 works just fine on my totally stock Debian system. All software except for G2 has been installed via Debian's repros

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

 
grooveman

Joined: 2010-02-22
Posts: 43
Posted: Tue, 2010-04-13 15:04

My Debian is totally stock as well. It is a straight lenny system with nothing running on it except apache2... No foreign packages installed. All tests pass, and the only error output in my logs is the apache2 log, with what I posted above... I don't get it....

The only packages I installed on this system were strictly for the sake of gallery...

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Tue, 2010-04-13 18:05

odd. I'm running 32bit instead of 64bit (as I'm on a lower memory plan VPS) and I have a few other updates applied, but that's the only difference I can see in my system compared to what you posted above.

I'm not a hard-core linux geek and don't know how to troubleshoot this further.

Maybe try creating a php script that creates and deletes files itself and see if it can do it.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Tue, 2010-04-13 18:07

Oh and

aptitude update && aptitude safe-upgrade :) Get your system up to date, though you may already be there I don't know the differences between 64bit and 32bit for software versions.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
grooveman

Joined: 2010-02-22
Posts: 43
Posted: Sun, 2010-04-18 04:14

Yes, I am 100% up to date.

I am really thinking this must be a bug:

 Error (ERROR_LOCK_REQUIRED)in modules/core/classes/GalleryEntity.class at line 360 (GalleryCoreApi::error) 
in modules/core/classes/GalleryDerivative.class at line 197 (GalleryEntity::delete) 
in modules/core/classes/helpers/GalleryEntityHelper_medium.class at line 115 (GalleryDerivative::delete) 
in modules/core/classes/GalleryCoreApi.class at line 2377 (GalleryEntityHelper_medium::deleteEntityById) 
in modules/core/classes/GalleryItem.class at line 309 (GalleryCoreApi::deleteEntityById) 
in modules/core/classes/GalleryDataItem.class at line 236 (GalleryItem::delete) 
in modules/core/classes/helpers/GalleryEntityHelper_medium.class at line 115 (GalleryDataItem::delete) 
in modules/core/classes/GalleryCoreApi.class at line 2377 (GalleryEntityHelper_medium::deleteEntityById) 
in modules/core/ItemDelete.inc at line 83 (GalleryCoreApi::deleteEntityById) 
in main.php at line 250 (ItemDeleteController::handleRequest) 
in main.php at line 104
in main.php at line 88

Request variables: Array
(
    [return] => /gallery2/main.php?g2_itemId=598
    [formUrl] => /gallery2/main.php?g2_view=core.ItemAdmin&g2_subView=core.ItemDelete&g2_itemId=598&g2_anchorId=600
    [authToken] => df6b65d661c6
    [controller] => core.ItemDelete
    [form] => Array
        (
            [formName] => ItemDelete
            [formname] => DeleteItem
            [selectedIds] => Array
                (
                    [600] => on
                )

            [numPerPage] => 30
            [action] => Array
                (
                    [delete] => Delete
                )

        )

    [itemId] => 598
    [page] => 1
)

It looks to me as if an array has gotten out of step or something. The itemId is 598, and it looks like it is trying to delete 600, which doesn't exist. When I look at the files int the g2data/locks directory, I see the 598, and no 600. I have cleared all my cache, I have deleted my locks and set the perms to read/write on everything, and nothing works. My system is up to date, I pass all tests, and my phpinfo is in order. This must be a bug... I have everything set correctly, and if my guess is right, and it is an array issue, then there is nothing I should be able to do that would create that problem...

Another interesting fact: I can delete items from the very first gallery I created, but not in any subsequent galleries... If this were a filesystem issue, or a system issue at all, it seems that the problem would be across the board...

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Sun, 2010-04-18 15:30

I can only suggest that you use database locking on your system. G2 is unfortunately no longer under active development, if this where a security issue it would probably get addressed, but it's an odd case happening on a single server (that we know of). File locking is working just fine on literally 10,000s or even 100,000s of different servers for G2 users.

You don't happen to have your g2data directory mounted via NFS?

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

 
grooveman

Joined: 2010-02-22
Posts: 43
Posted: Sun, 2010-04-18 21:34

Yeah, I understand. I must have done something slightly different than everyone else somewhere... Might be a once in a million thing.

I guess I will switch to db locking, and look forward to g3.

No, I definitely do not have it shared via nfs, or any other protocol. This is strictly a web server hosting my website (strictly html + css) and this gallery.

I do appreciate your time Nivekiam.

G