Omeka API Import - ERR (3)

I'm trying to use the API Import plugin on a site I have running locally, via Vagrant (https://github.com/michaelck/puppet-lamp-stack-for-omeka). It's getting stuck at the "Importing items" status, with the following errors in the log:

2015-02-24T15:03:24+00:00 ERR (3): exception 'Zend_Http_Client_Adapter_Exception' with message 'Read timed out after 10 seconds' in /vagrant/webroot/application/libraries/Zend/Http/Client/Adapter/Socket.php:511
Stack trace:
#0 /vagrant/webroot/application/libraries/Zend/Http/Client/Adapter/Socket.php(329): Zend_Http_Client_Adapter_Socket->_checkSocketReadTimeout()
#1 /vagrant/webroot/application/libraries/Zend/Http/Client.php(1077): Zend_Http_Client_Adapter_Socket->read()
#2 /vagrant/webroot/plugins/OmekaApiImport/libraries/ApiImport/Service/Omeka.php(183): Zend_Http_Client->request()
#3 [internal function]: ApiImport_Service_Omeka->get(NULL, Array)
#4 /vagrant/webroot/plugins/OmekaApiImport/libraries/ApiImport/Service/Omeka.php(106): call_user_func_array(Array, Array)
#5 /vagrant/webroot/plugins/OmekaApiImport/libraries/ApiImport/ImportJob/Omeka.php(82): ApiImport_Service_Omeka->__call('get', Array)
#6 /vagrant/webroot/plugins/OmekaApiImport/libraries/ApiImport/ImportJob/Omeka.php(82): ApiImport_Service_Omeka->get(NULL, Array)
#7 /vagrant/webroot/plugins/OmekaApiImport/libraries/ApiImport/ImportJob/Omeka.php(32): ApiImport_ImportJob_Omeka->importRecords('items', 'ApiImport_Respo...')
#8 /vagrant/webroot/application/libraries/Omeka/Job/Process/Wrapper.php(29): ApiImport_ImportJob_Omeka->perform()
#9 /vagrant/webroot/application/scripts/background.php(61): Omeka_Job_Process_Wrapper->run(Array)
#10 {main}

The connection is timing out...I'm not familiar enough with Vagrant to know whether it does something that affects external HTTP connections. It could also just be that the target is running slowly.

What's the API URL of the site you are trying to import from?

Hi

URL is http://omeka.okfn.org/api

Thanks. I got the same error, so it looks like it has nothing to do with Vagrant. Instead, it just looks like a lot of data being processed made the connection timeout.

As a test, I went into OmekaApiImport/libraries/ApiImport/Service/Omeka.php and adjusted the timeout limit with this change on line 131:

public function getHttpClient()
    {
        if (null === $this->httpClient) {
            $this->httpClient = new Zend_Http_Client;
        }
        $this->httpClient->setConfig(array('timeout' => 100));
        return $this->httpClient;
    }

The change just adds the timeout:

$this->httpClient->setConfig(array('timeout' => 100));

That removed that original timeout problem, but some other unexpected errors popped up. That might depend on how my Omeka installation is set up, so your mileage may vary. But at least that's a quick way around the first obstacle.