Scripto and Amazon S3 Migration

Greetings!

I’m seeking assistance with the Scripto plugin and its performance after a migration to Amazon S3 storage. After completing the migration, I’m able to access image files with no difficulty,. However, Scripto will no longer transcribe images or display old transcriptions. An error message is generated, and the following code is generated in the error log (w/ access key removed):

[edited to input correct code]

Zend_Http_Client_Exception: Unable to read response, or response is empty in /home/dhlbacne/public_html/application/libraries/Zend/Http/Client.php:1093
Stack trace:
#0 /home/dhlbacne/public_html/application/libraries/Omeka/Http/Client.php(36): Zend_Http_Client->request('POST')
#1 /home/dhlbacne/public_html/plugins/Scripto/libraries/Scripto/Service/MediaWiki.php(666): Omeka_Http_Client->request('POST')
#2 /home/dhlbacne/public_html/plugins/Scripto/libraries/Scripto/Service/MediaWiki.php(465): Scripto_Service_MediaWiki->_request('query', Array)
#3 /home/dhlbacne/public_html/plugins/Scripto/libraries/Scripto/Service/MediaWiki.php(160): Scripto_Service_MediaWiki->query(Array)
#4 /home/dhlbacne/public_html/plugins/Scripto/libraries/Scripto/Document.php(684): Scripto_Service_MediaWiki->getUserInfo('rights')
#5 /home/dhlbacne/public_html/plugins/Scripto/libraries/Scripto/Document.php(415): Scripto_Document->_canEdit(Array)
#6 /home/dhlbacne/public_html/plugins/Scripto/views/shared/index/transcribe.php(368): Scripto_Document->canEditTranscriptionPage()
#7 /home/dhlbacne/public_html/application/libraries/Omeka/View.php(114): include('/home/dhlbacne/...')
#8 /home/dhlbacne/public_html/application/libraries/Zend/View/Abstract.php(888): Omeka_View->_run('/home/dhlbacne/...')
#9 /home/dhlbacne/public_html/application/libraries/Zend/Controller/Action/Helper/ViewRenderer.php(912): Zend_View_Abstract->render(NULL)
#10 /home/dhlbacne/public_html/application/libraries/Zend/Controller/Action/Helper/ViewRenderer.php(933): Zend_Controller_Action_Helper_ViewRenderer->renderScript('index/transcrib...', NULL)
#11 /home/dhlbacne/public_html/application/libraries/Zend/Controller/Action/Helper/ViewRenderer.php(972): Zend_Controller_Action_Helper_ViewRenderer->render()
#12 /home/dhlbacne/public_html/application/libraries/Zend/Controller/Action/HelperBroker.php(277): Zend_Controller_Action_Helper_ViewRenderer->postDispatch()
#13 /home/dhlbacne/public_html/application/libraries/Zend/Controller/Action.php(527): Zend_Controller_Action_HelperBroker->notifyPostDispatch()
#14 /home/dhlbacne/public_html/application/libraries/Zend/Controller/Dispatcher/Standard.php(308): Zend_Controller_Action->dispatch('transcribeActio...')
#15 /home/dhlbacne/public_html/application/libraries/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#16 /home/dhlbacne/public_html/application/libraries/Zend/Application/Bootstrap/Bootstrap.php(105): Zend_Controller_Front->dispatch()
#17 /home/dhlbacne/public_html/application/libraries/Zend/Application.php(384): Zend_Application_Bootstrap_Bootstrap->run()
#18 /home/dhlbacne/public_html/application/libraries/Omeka/Application.php(73): Zend_Application->run()
#19 /home/dhlbacne/public_html/admin/index.php(28): Omeka_Application->run()
#20 {main}

Any suggestions on the difficulties?

Hey there - I am only just now checking out this application, and stumbled into the forums and across your question. As such, take this with a grain of salt.

First, I would try accessing the transcription from the link in the log (from https:// to .jpg). The error denotes that it received a 404 response, which would mean that the link actually points to nothing.

I would suspect AWS would return a different code than 404 if there were permissions issues but, if the resource does exist, I would subsequently check for permissions associated with that AWS Access Key. Ensure you have the appropriate read permissions associated with that particular bucket / resource.

Hopefully this can help steer you in the correct direction!

Side note: in most forums, you can use the code formatting tool to paste output like the above. It has the added benefit of allowing others to copy and paste the code / logs, rather than transcribing from image. For this forum, the functionality is the “</>” button.

this would be an example of how your log or code
would have looked if this functionality
was used
/end

Thanks for the assistance - I believe I input the wrong error code. Here’s the correct error code:

Zend_Http_Client_Exception: Unable to read response, or response is empty in /home/dhlbacne/public_html/application/libraries/Zend/Http/Client.php:1093
Stack trace:
#0 /home/dhlbacne/public_html/application/libraries/Omeka/Http/Client.php(36): Zend_Http_Client->request('POST')
#1 /home/dhlbacne/public_html/plugins/Scripto/libraries/Scripto/Service/MediaWiki.php(666): Omeka_Http_Client->request('POST')
#2 /home/dhlbacne/public_html/plugins/Scripto/libraries/Scripto/Service/MediaWiki.php(465): Scripto_Service_MediaWiki->_request('query', Array)
#3 /home/dhlbacne/public_html/plugins/Scripto/libraries/Scripto/Service/MediaWiki.php(160): Scripto_Service_MediaWiki->query(Array)
#4 /home/dhlbacne/public_html/plugins/Scripto/libraries/Scripto/Document.php(684): Scripto_Service_MediaWiki->getUserInfo('rights')
#5 /home/dhlbacne/public_html/plugins/Scripto/libraries/Scripto/Document.php(415): Scripto_Document->_canEdit(Array)
#6 /home/dhlbacne/public_html/plugins/Scripto/views/shared/index/transcribe.php(368): Scripto_Document->canEditTranscriptionPage()
#7 /home/dhlbacne/public_html/application/libraries/Omeka/View.php(114): include('/home/dhlbacne/...')
#8 /home/dhlbacne/public_html/application/libraries/Zend/View/Abstract.php(888): Omeka_View->_run('/home/dhlbacne/...')
#9 /home/dhlbacne/public_html/application/libraries/Zend/Controller/Action/Helper/ViewRenderer.php(912): Zend_View_Abstract->render(NULL)
#10 /home/dhlbacne/public_html/application/libraries/Zend/Controller/Action/Helper/ViewRenderer.php(933): Zend_Controller_Action_Helper_ViewRenderer->renderScript('index/transcrib...', NULL)
#11 /home/dhlbacne/public_html/application/libraries/Zend/Controller/Action/Helper/ViewRenderer.php(972): Zend_Controller_Action_Helper_ViewRenderer->render()
#12 /home/dhlbacne/public_html/application/libraries/Zend/Controller/Action/HelperBroker.php(277): Zend_Controller_Action_Helper_ViewRenderer->postDispatch()
#13 /home/dhlbacne/public_html/application/libraries/Zend/Controller/Action.php(527): Zend_Controller_Action_HelperBroker->notifyPostDispatch()
#14 /home/dhlbacne/public_html/application/libraries/Zend/Controller/Dispatcher/Standard.php(308): Zend_Controller_Action->dispatch('transcribeActio...')
#15 /home/dhlbacne/public_html/application/libraries/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#16 /home/dhlbacne/public_html/application/libraries/Zend/Application/Bootstrap/Bootstrap.php(105): Zend_Controller_Front->dispatch()
#17 /home/dhlbacne/public_html/application/libraries/Zend/Application.php(384): Zend_Application_Bootstrap_Bootstrap->run()
#18 /home/dhlbacne/public_html/application/libraries/Omeka/Application.php(73): Zend_Application->run()
#19 /home/dhlbacne/public_html/admin/index.php(28): Omeka_Application->run()
#20 {main}

I’m able to display the images and transcriptions after switching from OpenLayers to Omeka default in Scripto configuration settings. OpenLayers is the culprit? However, I’d like to continue to use OpenLayers if possible. Thoughts?

I’m a bit confused here. From your stack trace it appears that Scripto is not able to connect to your MediaWiki installation. But from your last comment, you mention that turning off OpenLayers fixes the problem. These should not be related.

You should double check your MediaWiki installation. Is it working? When configuring the Scripto plugin, is the “MediaWiki API URL” pointing to the correct URL?

We’ve never tested Scripto on S3, so it is possible that Scripto is having trouble fetching files on the client-side code. Still, are you sure everything works when you turn off OpenLayers?

Thanks very much for reaching out. I’m confused as well.

I double checked MediaWiki. The MediaWiki API URL is unchanged from before the migration, but I recopied it and all seems well. I’m able to log into MediaWiki and Scripto as normal and access content.

Upon some additional exploring, some of the images displayed using the Omeka default viewer, and others didn’t:

When are you seeing the above stack trace for Zend_Http_Client_Exception?

The stack trace only appears when I have OpenLayers activated.

I suspect that the “Unable to read response” error you posted is unrelated to OpenLayers not working. It emanates from Scripto_Document->canEditTranscriptionPage(), which is called after OpenLayers is called. You may be experiencing intermittent connectivity issues with MediaWiki that sometimes results in the error, but it shouldn’t be related to whether OpenLayers is active. Does this specific error appear every time you activate OpenLayers?

Yes, the same stack trace as above appears when I refresh a Scipto page after activating OpenLayers. The pages are accessible again after deactivating it.

I am truly stumped. I concede that Scripto may have trouble fetching a file from S3, but this error seems completely unrelated. At first I thought this has something to do with PHP’s getimagesize() not being able to get a remote file due to some configuration on the server that runs your Omeka installation. But the “Unable to read response” is throwing me for a loop. Can you actually edit transcriptions?

Yep, just transcribed a bit now, although the image isn’t loading on the screen. Transcription pulls up in MediaWiki with no issues.

Would you mind enabling OpenLayers so I can see the stack trace at http://dhl.bac.edu/scripto/transcribe/8/95#transcription

OpenLayers enabled - many thanks.

I’m even more confused now. Five minutes ago I saw this:

And now I see this:

In the short time OpenLayers was working I noticed it was drawing the image from your local server, not S3. Could you have done anything to account for this behavior, besides simply activating OpenLayers?

Sorry, that’s my bad. I rolled back the config file to pre-S3 migration to do some quick work on a transcription, and restored it after your message. Sorry about that.

Let’s regroup. The “Unable to read response” error only happens when a) you’re using S3, and b) OpenLayers is active. The only thing I can figure is the use of S3 somehow interferes with the server-side code that prepares OpenLayers, which, in turn, interferes with the call to your MediaWiki API.

Thing is, the code path makes this look impossible. Scripto first renders OpenLayers markup and then makes a call to MediaWiki. It’s the call to MediaWiki that causes the “Unable to read response” error, so it seems OpenLayers is working, or certainly not throwing an error.

I’m completely stumped here. It just so implausible that an interaction between S3 and OpenLayers would interfere with a call to MediaWiki.

Can confirm on the situation you outlined - the “unable to read response” only appears with S3 and OpenLayers active.

Any thoughts on next steps? I appreciate your feedback throughout the thread.

I’ve asked my colleagues for assistance, but for now I have no advice for next steps. I’ll post here once I have a better idea.

I should’ve asked this before, but what versions of Omeka and Scripto are you using?