Error on first step of Omeka2 import module


#1

After introducing the url in Omeka2 importer and clicking Next, Omeka shows the message: Omeka S encountered an error

I checked on the logs and it seems that the URL is not getting to the http call in the code.
Any ideas?
It is a clean installation of OmekaS version 1.2.0

2018-10-03T14:00:15+00:00 ERR (3): exception ‘ErrorException’ with message ‘stream_socket_client(): php_network_getaddresses: getaddrinfo failed: Name or service not known’ in /vendor/zendframework/zend-http/src/Client/Adapter/Socket.php:273
Stack trace:
#0 [internal function]: Zend\Stdlib\ErrorHandler::addError(2, ‘stream_socket_c…’, ‘…’, 273, Array)
#1 /vendor/zendframework/zend-http/src/Client/Adapter/Socket.php(273): stream_socket_client(’:80’, 0, ‘php_network_get…’, 30, 4, Resource id #668)
#2 /vendor/zendframework/zend-http/src/Client.php(1436): Zend\Http\Client\Adapter\Socket->connect(NULL, 80, false)
#3 /vendor/zendframework/zend-http/src/Client.php(936): Zend\Http\Client->doRequest(Object(Zend\Uri\Http), ‘GET’, false, Array, ‘’)
#4 /modules/Omeka2Importer/src/Service/Omeka2Client.php(172): Zend\Http\Client->send()
#5 [internal function]: Omeka2Importer\Service\Omeka2Client->get()
#6 /modules/Omeka2Importer/src/Service/Omeka2Client.php(85): call_user_func_array(Array, Array)
#7 /modules/Omeka2Importer/src/Controller/IndexController.php(96): Omeka2Importer\Service\Omeka2Client->__call(‘get’, Array)
#8 /modules/Omeka2Importer/src/Controller/IndexController.php(96): Omeka2Importer\Service\Omeka2Client->get()
#9 /vendor/zendframework/zend-mvc/src/Controller/AbstractActionController.php(78): Omeka2Importer\Controller\IndexController->mapElementsAction()
#10 /vendor/zendframework/zend-eventmanager/src/EventManager.php(322): Zend\Mvc\Controller\AbstractActionController->onDispatch(Object(Zend\Mvc\MvcEvent))
#11 /vendor/zendframework/zend-eventmanager/src/EventManager.php(179): Zend\EventManager\EventManager->triggerListeners(Object(Zend\Mvc\MvcEvent), Object(Closure))
#12 /vendor/zendframework/zend-mvc/src/Controller/AbstractController.php(106): Zend\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Zend\Mvc\MvcEvent))
#13 /vendor/zendframework/zend-mvc/src/DispatchListener.php(138): Zend\Mvc\Controller\AbstractController->dispatch(Object(Zend\Http\PhpEnvironment\Request), Object(Zend\Http\PhpEnvironment\Response))
#14 /vendor/zendframework/zend-eventmanager/src/EventManager.php(322): Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent))
#15 /vendor/zendframework/zend-eventmanager/src/EventManager.php(179): Zend\EventManager\EventManager->triggerListeners(Object(Zend\Mvc\MvcEvent), Object(Closure))
#16 /vendor/zendframework/zend-mvc/src/Application.php(332): Zend\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Zend\Mvc\MvcEvent))
#17 /index.php(21): Zend\Mvc\Application->run()
#18 {main}

Next exception ‘ErrorException’ with message ‘stream_socket_client(): unable to connect to :80 (php_network_getaddresses: getaddrinfo failed: Name or service not known)’ in /vendor/zendframework/zend-http/src/Client/Adapter/Socket.php:273
Stack trace:
#0 [internal function]: Zend\Stdlib\ErrorHandler::addError(2, ‘stream_socket_c…’, ‘…’, 273, Array)
#1 /vendor/zendframework/zend-http/src/Client/Adapter/Socket.php(273): stream_socket_client(’:80’, 0, ‘php_network_get…’, 30, 4, Resource id #668)
#2 /vendor/zendframework/zend-http/src/Client.php(1436): Zend\Http\Client\Adapter\Socket->connect(NULL, 80, false)
#3 /vendor/zendframework/zend-http/src/Client.php(936): Zend\Http\Client->doRequest(Object(Zend\Uri\Http), ‘GET’, false, Array, ‘’)
#4 /modules/Omeka2Importer/src/Service/Omeka2Client.php(172): Zend\Http\Client->send()
#5 [internal function]: Omeka2Importer\Service\Omeka2Client->get()
#6 /modules/Omeka2Importer/src/Service/Omeka2Client.php(85): call_user_func_array(Array, Array)
#7 /modules/Omeka2Importer/src/Controller/IndexController.php(96): Omeka2Importer\Service\Omeka2Client->__call(‘get’, Array)
#8 /modules/Omeka2Importer/src/Controller/IndexController.php(96): Omeka2Importer\Service\Omeka2Client->get()
#9 /vendor/zendframework/zend-mvc/src/Controller/AbstractActionController.php(78): Omeka2Importer\Controller\IndexController->mapElementsAction()
#10 /vendor/zendframework/zend-eventmanager/src/EventManager.php(322): Zend\Mvc\Controller\AbstractActionController->onDispatch(Object(Zend\Mvc\MvcEvent))
#11 /vendor/zendframework/zend-eventmanager/src/EventManager.php(179): Zend\EventManager\EventManager->triggerListeners(Object(Zend\Mvc\MvcEvent), Object(Closure))
#12 /vendor/zendframework/zend-mvc/src/Controller/AbstractController.php(106): Zend\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Zend\Mvc\MvcEvent))
#13 /vendor/zendframework/zend-mvc/src/DispatchListener.php(138): Zend\Mvc\Controller\AbstractController->dispatch(Object(Zend\Http\PhpEnvironment\Request), Object(Zend\Http\PhpEnvironment\Response))
#14 /vendor/zendframework/zend-eventmanager/src/EventManager.php(322): Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent))
#15 /vendor/zendframework/zend-eventmanager/src/EventManager.php(179): Zend\EventManager\EventManager->triggerListeners(Object(Zend\Mvc\MvcEvent), Object(Closure))
#16 /vendor/zendframework/zend-mvc/src/Application.php(332): Zend\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Zend\Mvc\MvcEvent))
#17 /index.php(21): Zend\Mvc\Application->run()
#18 {main}

Next exception ‘Zend\Http\Client\Adapter\Exception\RuntimeException’ with message ‘Unable to connect to :80 . Error #0: stream_socket_client(): unable to connect to :80 (php_network_getaddresses: getaddrinfo failed: Name or service not known)’ in /vendor/zendframework/zend-http/src/Client/Adapter/Socket.php:278
Stack trace:
#0 /vendor/zendframework/zend-http/src/Client.php(1436): Zend\Http\Client\Adapter\Socket->connect(NULL, 80, false)
#1 /vendor/zendframework/zend-http/src/Client.php(936): Zend\Http\Client->doRequest(Object(Zend\Uri\Http), ‘GET’, false, Array, ‘’)
#2 /modules/Omeka2Importer/src/Service/Omeka2Client.php(172): Zend\Http\Client->send()
#3 [internal function]: Omeka2Importer\Service\Omeka2Client->get()
#4 /modules/Omeka2Importer/src/Service/Omeka2Client.php(85): call_user_func_array(Array, Array)
#5 /modules/Omeka2Importer/src/Controller/IndexController.php(96): Omeka2Importer\Service\Omeka2Client->__call(‘get’, Array)
#6 /modules/Omeka2Importer/src/Controller/IndexController.php(96): Omeka2Importer\Service\Omeka2Client->get()
#7 /vendor/zendframework/zend-mvc/src/Controller/AbstractActionController.php(78): Omeka2Importer\Controller\IndexController->mapElementsAction()
#8 /vendor/zendframework/zend-eventmanager/src/EventManager.php(322): Zend\Mvc\Controller\AbstractActionController->onDispatch(Object(Zend\Mvc\MvcEvent))
#9 /vendor/zendframework/zend-eventmanager/src/EventManager.php(179): Zend\EventManager\EventManager->triggerListeners(Object(Zend\Mvc\MvcEvent), Object(Closure))
#10 /vendor/zendframework/zend-mvc/src/Controller/AbstractController.php(106): Zend\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Zend\Mvc\MvcEvent))
#11 /vendor/zendframework/zend-mvc/src/DispatchListener.php(138): Zend\Mvc\Controller\AbstractController->dispatch(Object(Zend\Http\PhpEnvironment\Request), Object(Zend\Http\PhpEnvironment\Response))
#12 /vendor/zendframework/zend-eventmanager/src/EventManager.php(322): Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent))
#13 /vendor/zendframework/zend-eventmanager/src/EventManager.php(179): Zend\EventManager\EventManager->triggerListeners(Object(Zend\Mvc\MvcEvent), Object(Closure))
#14 /vendor/zendframework/zend-mvc/src/Application.php(332): Zend\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Zend\Mvc\MvcEvent))
#15 /index.php(21): Zend\Mvc\Application->run()
#16 {main}
2018-10-03T14:38:13+00:00 ERR (3): exception ‘ErrorException’ with message ‘stream_socket_client(): php_network_getaddresses: getaddrinfo failed: Name or service not known’ in /vendor/zendframework/zend-http/src/Client/Adapter/Socket.php:273
Stack trace:
#0 [internal function]: Zend\Stdlib\ErrorHandler::addError(2, ‘stream_socket_c…’, ‘…’, 273, Array)
#1 /vendor/zendframework/zend-http/src/Client/Adapter/Socket.php(273): stream_socket_client(’:80’, 0, ‘php_network_get…’, 30, 4, Resource id #668)
#2 /vendor/zendframework/zend-http/src/Client.php(1436): Zend\Http\Client\Adapter\Socket->connect(NULL, 80, false)
#3 /vendor/zendframework/zend-http/src/Client.php(936): Zend\Http\Client->doRequest(Object(Zend\Uri\Http), ‘GET’, false, Array, ‘’)
#4 /modules/Omeka2Importer/src/Service/Omeka2Client.php(172): Zend\Http\Client->send()
#5 [internal function]: Omeka2Importer\Service\Omeka2Client->get()
#6 /modules/Omeka2Importer/src/Service/Omeka2Client.php(85): call_user_func_array(Array, Array)
#7 /modules/Omeka2Importer/src/Controller/IndexController.php(96): Omeka2Importer\Service\Omeka2Client->__call(‘get’, Array)
#8 /modules/Omeka2Importer/src/Controller/IndexController.php(96): Omeka2Importer\Service\Omeka2Client->get()
#9 /vendor/zendframework/zend-mvc/src/Controller/AbstractActionController.php(78): Omeka2Importer\Controller\IndexController->mapElementsAction()
#10 /vendor/zendframework/zend-eventmanager/src/EventManager.php(322): Zend\Mvc\Controller\AbstractActionController->onDispatch(Object(Zend\Mvc\MvcEvent))
#11 /vendor/zendframework/zend-eventmanager/src/EventManager.php(179): Zend\EventManager\EventManager->triggerListeners(Object(Zend\Mvc\MvcEvent), Object(Closure))
#12 /vendor/zendframework/zend-mvc/src/Controller/AbstractController.php(106): Zend\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Zend\Mvc\MvcEvent))
#13 /vendor/zendframework/zend-mvc/src/DispatchListener.php(138): Zend\Mvc\Controller\AbstractController->dispatch(Object(Zend\Http\PhpEnvironment\Request), Object(Zend\Http\PhpEnvironment\Response))
#14 /vendor/zendframework/zend-eventmanager/src/EventManager.php(322): Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent))
#15 /vendor/zendframework/zend-eventmanager/src/EventManager.php(179): Zend\EventManager\EventManager->triggerListeners(Object(Zend\Mvc\MvcEvent), Object(Closure))
#16 /vendor/zendframework/zend-mvc/src/Application.php(332): Zend\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Zend\Mvc\MvcEvent))
#17 /index.php(21): Zend\Mvc\Application->run()
#18 {main}


#2

What does the URL of the page you’re seeing this error on look like? (the “map-elements” page)


#3

Hi, I’m getting the same error, also trying to import a Classic (2) site in a clean install.
the error page reads http://[Omeka S site url] /admin/omeka2importer/map-elements?csrf=df143529c06383d514d376bc3ab5cd03-9fc7f86828c48f66f2318f2f2135152d&endpoint=http%3A%2F%2F [Omeka2 site url ]%2Fapi

With the same API endpoint we managed to get to the next page correctly in a Omeka S sandbox, but not outsie of it. Might it be server related?


#4

Hi jflatnes,

The urls is:
http://[SITE URL]/admin/omeka2importer/map-elements?csrf=9fb0970fa6bffd1780ef9daaaa712fa6-f2b88527a0e2ad9c369eded60d95a71c&endpoint=http%3A%2F%2[API SITE URL]%2Fapi


#5

Hmmm, it’s certainly possible it’s some server setting or issue or another… the URL that’s supposed to get used is in the endpoint parameter of the query string… since both of you have it there, it seems that it’s being discarded somewhere before it gets to Omeka…

Anything interesting in your Apache logs (distinct from your Omeka log)?


#6

This is what I get in apache logs:

[Sat Oct 06 12:49:42 2018] [error] [client ip] PHP Notice: Undefined index: endpoint in /[Omeka S]/modules/Omeka2Importer/src/Controller/IndexController.php on line 92, referer: [OmekaS]/admin/omeka2importer


#7

Hmmm, so that’s the source of the issue here… it seems anyway: the URL you’re describing on the browser has the correct URL, including the necessary GET parameter, but it’s not being passed along to Omeka S for some reason.

What does your .htaccess file look like? It’s possible there’s some issue there…


#8

I’m using the default .htaccess, see bellow:

SetEnv APPLICATION_ENV "production"

RewriteEngine On
# The following rule tells Apache that if the requested filename
# exists, simply serve it.
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [L]

# Strip any trailing slashes from incoming requests
RewriteCond %{REQUEST_URI} ^(.+)/+$
RewriteRule .* %1 [R=307,L]

# The following rewrites all other queries to index.php. The 
# condition ensures that if you are using Apache aliases to do
# mass virtual hosting, the base path will be prepended to 
# allow proper resolution of the index.php file; it will work
# in non-aliased environments as well, providing a safe, one-size 
# fits all solution.
RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
RewriteRule ^(.*) - [E=BASE:%1]
RewriteRule ^(.*)$ %{ENV:BASE}/index.php [L]

# Block access to all .ini files.
<FilesMatch "\.ini$">
    <IfModule mod_authz_core.c>
        Require all denied
    </IfModule>
    <IfModule !mod_authz_core.c>
        Order Allow,Deny
        Deny from all
    </IfModule>
</FilesMatch>

#9

OK that looks normal…

You don’t have trouble doing other things that use GET parameters, do you? This would be things like searches.


#10

No, searches works ok…