Hello,
I would like to install DownloadLink plugin on my running gallery2 system.
30 seconds after clicking on "Install" in Site-Administration of gallery webinterface I get this error message:
Fatal error: Maximum execution time of 30 seconds exceeded in GalleryDataCache.class on line 127
I guessed that this time out occurs because of the very large cache directory where I deleted some directories afterwards. These are the current sizes now - but my next try to install the plugin was unsuccessful too:
13G derivative
212M entity
25M module
1.5M repository
124K theme
Could the large number of rows (155015) in table GalleryAccessSubscriberMap be the reason why it is not possible to install the plugin?
Gallery-Version = 2.3 Kern 1.3.0
API = Core 7.54, Modul 3.9, Motiv 2.6, Eingebettet 1.5
PHP-Version = 5.2.6-1+lenny3 cgi-fcgi
Webserver = lighttpd/1.4.19
Datenbank = mysqli 5.0.51a-24+lenny2-log, lock.system=database
Werkzeuge = Exif, LinkItemToolkit, Thumbnail, Gd, SquareThumb, ImageMagick
Beschleunigung = none, none
Betriebssystem = Linux 2.6.26-1-amd64 #1 SMP Fri Mar 13 17:46:45 UTC 2009 x86_64
Standard-Motiv = matrix
gettext = Aktiviert
Sprache = de_DE
Browser = Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6 (.NET CLR 3.5.30729)
Zeilen in der GalleryAccessMap Tabelle = 45282
Zeilen in der GalleryAccessSubscriberMap Tabelle = 155015
Zeilen in der GalleryUser Tabelle = 243
Zeilen in der GalleryItem Tabelle = 154994
Zeilen in der GalleryAlbumItem Tabelle = 8296
Zeilen in der GalleryCacheMap Tabelle = 0
Regards,
Roland
Posts: 7
SOLVED
AddGroupPermission caused the timeout..
try to add $gallery->guaranteeTimeLimit(300); before addGroupPermission will be called.
(this code below comes from /gallery2/modules/downloadlink/module.inc)
:
:
...
/* Give everybody download permissions by default */
$gallery->guaranteeTimeLimit(300); //if AccessSubscriberMap table is large, it can takes up to 3minutes to install the plugin!
$ret = GalleryCoreApi::addGroupPermission($coreParams['id.rootAlbum'], $coreParams['id.everybodyGroup'],'downloadlink.original', true);
...
:
:
Posts: 4342
I have to say this is not something I can really recommend. Although I'm glad it worked for you.
I don't think that's the case generally, and could be indicative of a borked MySQL installation. Adding a single permission to the table should no way take three minutes.
EDIT: OK, I see the potential problem. It may be that the applyToChildren parameter should be set to false, not true - setting it to true would make it a much bigger operation. Let me check on that.
Posts: 7
Hi Alecmyers,
I found the line $gallery->guranteeTimeLimit in this post: http://gallery.menalto.com/node/36399. This method is used in the following modules too: Shutterly (line 69, 84), Sitemap (in this case before GalleryCoreApi::fetchAccessListIds on line 83), Rating (on line 200), PhotoAccess (line 69, 84), eCard (line 95), Photokasten (line 82) and so on.
After adding the new line I installed it and it takes 3 minutes to install the download link plugin (but it gallery2 was not in maintenance mode during the installation).
Is there a problem if I leave my installation as is and will not remove line $gallery->guranteeTimeLimit and set applyToChildren parameter to false and install it again?
Posts: 4342
I did some investigation, and applyToChildren needs to be true, which mean that the permission assignment may indeed take a long time if you have a large gallery and a slow host.
The reason I'm not in favour of the guaranteeTimeLimit call is that I don't think that module installation is something one would expect to take a long time, and long operations should show a progress bar. However, since as you point out (thanks, I hadn't realised) it's used in other, core, modules, it's obviously passed the approval of the core dev team, so who am I to gainsay. The alternatives are to take the permission assigment out of the installation procedure and force the user to do it manually - where at least they might realise why it's taking a long time - or leave the guaranteeTimeLimit in.
Thanks for posting about this.