+4 votes
in CMS Tips by (14.6k points)

When I try to upload many photos at once using the upload utility of the "Gallery project" application, it does not upload all of them. For some of them, it gives "UNABLE_TO_LOCK_EXCEPTION" error.

The log file has the following information which does not give any clue to fix the issue. How can I fix it?

2020-07-26 21:21:55 +00:00 --- error: @todo UNABLE_TO_LOCK_EXCEPTION

#0 public_html/modules/gallery/libraries/ORM_MPTT.php(50): ORM_MPTT_Core->lock()

#1 public_html/modules/gallery/models/item.php(396): ORM_MPTT_Core->save()

#2 public_html/modules/gallery/controllers/uploader.php(192): Item_Model_Core->save()

#3 public_html/modules/gallery/controllers/uploader.php(62): Uploader_Controller->_add_item('4000', '...', 'Meenaskshi-Sark...')

#4 [internal function]: Uploader_Controller->add_photo('4000')

#5 public_html/system/core/Kohana.php(331): ReflectionMethod->invokeArgs(Object(Uploader_Controller), Array)

#6 public_html/system/core/Event.php(208): Kohana_Core::instance(NULL)

#7 public_html/application/Bootstrap.php(67): Event_Core::run('system.execute')

#8 public_html/index.php(123): require('...')

#9 {main}

1 Answer

0 votes
by (48.8k points)
edited by

It seems that your server does not allow you to upload many files simultaneously. There may be some simultaneous upload limitations on the server.

The quick fix for this error is as follows:

  • Log in as Admin.
  • Click Admin -> Settings -> Advanced.
  • Under Advanced settings, change the gallery simultaneous_upload_limit  to 1 and save. This way gallery will not try to upload more than 1 file at a time.

simultaneous_upload_limit in gallery project

If you want to simultaneously upload 1+ photos, set "lock_timeout" under Admin -> Settings -> Advanced to a larger value. Currently, it is set to 1. By increasing it to 15, I am now able to upload 3 photos simultaneously.