No thumnbails and original goes to browser after upgrade
Netter
Joined: 2007-03-26
Posts: 39 |
![]() |
I upgraded Gallery2 from 2.1.x to the latest 2.2.1. But it looks like the problem is with DownloadItem part of the core. It just does not pass thru data from .dat files to my browser. Also, when I try to do 'Maintenance -> Build all thumbnails/resizes' I just get empty not-found page (and the same empty page with 'Refresh capture dates'). So from that you can understand that NetPBM/GD is working and creating cache files every first time they are called by broeser, but data of these files is not sent to browser. I also tried to deactivate/uninstall URL rewrite. No effect at all. What can be the problem?
|
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
- no warnings in the system check of the upgrader? -------------- |
|
Netter
Joined: 2007-03-26
Posts: 39 |
![]() |
- no warnings, upgrade went fine |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
> - no warnings, upgrade went fine you can visit the upgrade wizard again. does is still show no warning? - please deactivate the url rewrite module this is an example url: maybe it works once the above features are disabled. -------------- |
|
Netter
Joined: 2007-03-26
Posts: 39 |
![]() |
deactivated now |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
still the same. please check your server's error log. there should be a lot of error entries. -------------- |
|
Netter
Joined: 2007-03-26
Posts: 39 |
![]() |
this may sound strange but there are no errors in error_log (server is on plesk) involved with gallery2. only like not found robots.txt, not found favicon.ico... btw, photo2 subdomain is a mirror for original photo. I copied all files exactly and exported/inported mysql dump and as a difference at least on photo2 previews are being recreated (I can see some when I go to different albums). On original there's no way any picture is shown. Very strange and makes me want to do the same thing to original website (remove mysql data, import form dump). |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
please enable "buffered" debug mode. -------------- |
|
Netter
Joined: 2007-03-26
Posts: 39 |
![]() |
on photo2 subdomain? it is set to buffered now. |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
still nada. please enable "immediate" debug mode. that will usually corrupt the transfer, but it could show some helpful stuff. -------------- |
|
Netter
Joined: 2007-03-26
Posts: 39 |
![]() |
I also sent you a private message. |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
arg, nothing. you say you cleared your caches already. all of them? maybe just delete g2data/cache/* . i'd like to ensure that the entity and its fast-download caches are gone as well. running out of ideas here... -------------- |
|
Netter
Joined: 2007-03-26
Posts: 39 |
![]() |
yes. I cleared cache many times. right now I removed cache directory completely |
|
Netter
Joined: 2007-03-26
Posts: 39 |
![]() |
um.. now it seems like working better (at least thumbs for albums are also being created) |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
if you get other blank pages, then error reporting / logging of your php is clearly not working. i suggest you ensure that errors are properly logged, then we can look further into it. e.g. intentioanlly trigger a fatal php error and check if it's logged to the webserver's error log. -------------- |
|
Netter
Joined: 2007-03-26
Posts: 39 |
![]() |
logging is working great. because when I type url that is not found it's in error_log after complete cache remove it works better (though not all albums pictures are being recreated once I load it but most of them yes) |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
> logging is working great. because when I type url that is not found it's in error_log that's an apache error. -------------- |
|
Netter
Joined: 2007-03-26
Posts: 39 |
![]() |
I set btw, from yesterday some things started to work (I guess after disabling gd and mod_rewrite. So now gallery2 creates thumbnail and middle-size previews. But with original size still no luck, the same empty page. |
|
Netter
Joined: 2007-03-26
Posts: 39 |
![]() |
btw, could it be like some kind of size limit in admin area set by default? So it looks like: But original sizes are not shown in any case. |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
@error logging: can you edit your php.ini file? once we see the errors in the log, it should be easier to diagnose your case. -------------- |
|
Netter
Joined: 2007-03-26
Posts: 39 |
![]() |
it's me again. I checked my php.ini settings. all error reporting/display is enabled and working. but gallery2 produces no errors in case of these previews or middle-size original pictures. I run some scripts with errors intentionally in the same dir and these errors were shown in browser and logged in apache log. I suggest another thing. This photo gallery is important and people are waiting for it to be back. I have this f**cked up database (as I believe). How about making a clear install and then: I believe the problem is somewhere in tables with plugins or g2 settings and it happened during the upgrade. Please tell me what only tables are important for user accounts, user albums and images in gallery so that I could try to export them now and import after clean install. |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
please change error_reporting to E_ALL in your php.ini. > I checked my php.ini settings. all error reporting/display is enabled and working. how did you check whether it's working? i suggest you put this into main.php of g2: after <?php calling_a_method_that_does_not_exist(); save the file. browse to your gallery. if you don't see an error in your webserver's error log, php error logging isn't working. -------------- |
|
Netter
Joined: 2007-03-26
Posts: 39 |
![]() |
error reporting is working. also there's a line in error_log so as I reported before the problem is not in php, but in corrupted databse. read my previous message and help me to migrate users/albums/pictures only to a new clean install. |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
good. > read my previous message and help me to migrate users/albums/pictures only to a new clean install. no pretty please? > Please tell me what only tables are important for user accounts, user albums and images in gallery so that I could try to export them now and import after clean install. that's very hard to do. g2's database schema has a lot of inter-dependencies. -------------- |
|
Netter
Joined: 2007-03-26
Posts: 39 |
![]() |
Quote:
no pretty please? I am really gratefull for your help. Quote:
that's very hard to do. g2's database schema has a lot of inter-dependencies. As I sent you in PM before, I can send you access to mysql and admin access to gallery so you can see it from the inside and maybe find a problem. I sure understand that it's not just copying 2-3 tables, but maybe all except a few that contain plugins/core settings. |
|
Netter
Joined: 2007-03-26
Posts: 39 |
![]() |
right now I am at the state where I managed to combine old data tables with new core/plugins tables and thimbnails and middle size pictures are being generated (removed cache completely) and shown, but with full size pictures the problem persists. |
|
Netter
Joined: 2007-03-26
Posts: 39 |
![]() |
ok. new update: main.php?g2_view=core.DownloadItem&g2_itemId=12831&g2_serialNumber=1 (files 12831.dat, 12831-meta.inc are not in cache) and does gallery2 also creates/copies original size files to cache or it just sends it to browser with fread() function from original location? |
|
Netter
Joined: 2007-03-26
Posts: 39 |
![]() |
ok. next step. After that I intentionally cleared cache and chaned original file name of one image in g2_FileSystemEntity from abc.jpg to errorabc.jpg and refreshed the page - all new thumbs and middle size images were recreted but for image abc.jpg I have logged php error (it failed to do copy() to recreate thumb and resized images). So? So now we know that the problem occures only when we try to see original size image. And php script doesn't even tried to fopen() or copy() the file for that. It just ends before that with no error (skips the statement?). No php errors and no page when I open full-size image (with good and bad filename in mysql) So I guess the problem should be in some statements of DownloadItem.inc file. Can you please give me advise what to change so to be sure? |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
please don't edit your older posts. this forum shows the edited posts out of order. edit: i was confused. seems to be all in order. -------------- |
|
Netter
Joined: 2007-03-26
Posts: 39 |
![]() |
valiant, do you still read this thread? I need your help. /* Rebuild derivative cache, if necessary */ $itemForPermission = $itemId; $derivativeType = null; if (GalleryUtilities::isA($item, 'GalleryDerivative')) { list ($ret, $item) = GalleryCoreApi::rebuildDerivativeCacheIfNotCurrent($itemId); if ($ret) { return $ret; } $itemForPermission = $item->getParentId(); $derivativeType = $item->getDerivativeType(); } $ret = $this->_sendFile(array('derivativePath' => $path, 'derivativeType' => $derivativeType, 'mimeType' => $item->getMimeType(), 'pseudoFileName' => $pseudoFileName, 'parentId' => $itemForPermission, 'id' => $itemId)); if ($ret) { return $ret; } for showing original file it does nothing after that. Especially I guess _sendFile ends the script or return($ret) does it. |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
you'll have to dug deeper there. FYI: your error_reporting value is still not set to E_ALL in php.ini (see phpinfo). -------------- |
|
Netter
Joined: 2007-03-26
Posts: 39 |
![]() |
the last code (sql queries and my point-tracks) with immediate debug show that script stops at line 62 of DownloadItem.inc: so GalleryCoreApi::loadEntitiesById($itemId) does something wrong when loading original file info. Right after that line no code execution. |
|
Netter
Joined: 2007-03-26
Posts: 39 |
![]() |
also, error_reporting is set to E_ALL & ~E_NOTICE (that's what code 2039 means) |
|
Netter
Joined: 2007-03-26
Posts: 39 |
![]() |
I changed it to E_ALL only (code 2047) and it's just the same. so I am changing it back. |
|
Netter
Joined: 2007-03-26
Posts: 39 |
![]() |
oh sh**t. I just tried to make a comlete clean installation an another subdomain and upload some big files to my album. Is it possible to get an old 2.1.2 from somewhere? I cannot find it here. |
|
Netter
Joined: 2007-03-26
Posts: 39 |
![]() |
found 2.1.2, installed. works fine. now I need to figure out how to manage to work upgraded mysql data to old 2.1.2 engine. damn I wish I didn't do this upgrade. |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
since you're so polite and curse about a year of work that went into g2.2, i'm very glad to help you. sure you can still get g2.1.2. -------------- |
|
Netter
Joined: 2007-03-26
Posts: 39 |
![]() |
man, I love gallery2, I really do and I use it wherever I can. I hope those bugs will be fixed soon and I will be able to upgrade it flawlessly. until then 2.1 rules for me. |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
> I hope those bugs will be fixed soon and I will be able to upgrade it flawlessly. until then 2.1 rules for me. we don't see any issues with it. -------------- |
|
kashent
Joined: 2007-03-31
Posts: 6 |
![]() |
I've found your bug. I was having this same problem and tracked it down, fortunately it's easy to sidestep, but I'm not sure what all the reprecussions are. Change line 123 of modules/core/DownloadItem.inc to read as follows: 123 /* FIXME - commented out by user - 124 if (function_exists('apache_setenv')) { 125 @apache_setenv('no-gzip', '1'); 126 } 127 */ For some reason this call forces the entire thread to prematurely exit. It may be specific to the apache version Netter and I are using. Can one of the more experienced gallery coders chime in and let us know if this is likely to break anything else? |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
kashent wow. nothing logged in your apache error log? do you see anything in the logs then? -------------- |
|
kashent
Joined: 2007-03-31
Posts: 6 |
![]() |
Sorry, I didn't think about including that in my last post- [Sat Mar 31 12:45:54 2007] [notice] child pid 11279 exit signal Segmentation fault (11) Removing the @ made absolutely no difference. |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
what's your php version and API (php-cgi or mod_php?)? -------------- |
|
Netter
Joined: 2007-03-26
Posts: 39 |
![]() |
looks like it fixed problem with images. I made a fresh installation. All pictures are generated and shown (including an original one). When you click any of these you get the same blank page with nothing. I suppose some other .inc files contain similar code. |
|
kashent
Joined: 2007-03-31
Posts: 6 |
![]() |
Php version is 4.3.3, API is 20020918 and fwiw: And related bits- Apache Environment: Http headers information: Environment: PHP Variables: Hopefully something in there is useful. I suppose for now I should be safe to run as long as I have mod_gzip turned off, right? |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
Netter > looks like it fixed problem with images. I made a fresh installation. All pictures are generated and shown (including an original one). are you referring to kashent suggestion? or are you using an unchanged g2.2.1 installation? -------------- |
|
kashent
Joined: 2007-03-31
Posts: 6 |
![]() |
Quote:
But there's some other things to fix. You were right, two other places to make this change as well: main.php: @apache_setenv('no-gzip', '1'); Making the change in main.php will allow you to do all those Maintenance things you couldn't do before. |
|
kashent
Joined: 2007-03-31
Posts: 6 |
![]() |
One more bit of information, setting no-gzip to '0' also fails in exactly the same way. It appears that just calling apache_setenv on no-gzip is not feasable for our installations. |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
Netter Please see my above message: -------------- |
|
Netter
Joined: 2007-03-26
Posts: 39 |
![]() |
yes. kashent was absolutely right about those apache_setenv lines. commented them and everything works like a charm. thank you, kashent. you have made my day! I wish there was some good export/import plugin that allows you to export user accounts/albums/items only because those internal dependences in mysql gave me a headache. btw, does anybody know how to put dynamic "last additions" link into left menu without editing files? |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
Bug filed: -------------- |
|