CSV import: digital object URLs cannot be imported, produce a "could not resolve host" message in the console
|Assignee:||Sara Allain||% Done:|
|Target version:||Release 2.4.0|
|Google Code Legacy ID:||Tested version:||2.4|
Using the latest 2.4.x code, try importing the attached CSV (isad_0000000001.csv). It includes 3 top-level descriptions, each with with external digitalObjectURI values. I have tested that the URIs can all be resolved in a browser. Importing an XML version of these files (which include the same digital objects as <dao> elements) also works.
On import, the digital objects are skipped, with the following warning printed in the console:
vagrant$ php symfony csv:import --index /vagrant/isad_0000000001.csv WARNING: If you're importing multiple CSV files as part of the same import it's advisable to use the source-name CLI option to specify a source name (otherwise the filename will be used as a source name). Could not resolve host: .Could not resolve host: .Could not resolve host: .>> propel Build nested set for information_object... >> propel Build nested set for actor... >> propel Build nested set for term... >> propel Done! [~/atom] (qa/2.4.x)
2 things of note here. First is that this is a blocking issue for #9995, and seems to result from work done on this ticket.
Specifically, it relates to the following commit: https://github.com/artefactual/atom/commit/5637a5bfa027f32561e7b6b8c08aca0080aaf645
Mike Gale will provide a bit more technical follow-up on what he found when checking this out.
Second, the error message is pretty useless. It would be better if it actually provided the URI that could not be resolved( e.g. "Could not resolve host: http://www.example.com/my-image.jpg"), or said something like "Could not resolve external URI for information object [information object legacyID from CSV]"
#3 Updated by Mike Gale about 4 years ago
I did a `git bisect` and it pointed to the commit Dan mentions. I'm not entirely sure why this error is getting triggered, but I think it's possibly coming from the curl library.
You might want to do additional logging to tell for sure it's here, but I suspect the error is trickling up here: https://github.com/artefactual/atom/blob/qa/2.4.x/lib/task/import/csvImportTask.class.php#L1032-L1041
From here: https://github.com/artefactual/atom/blob/qa/2.4.x/lib/model/QubitDigitalObject.php#L1393
Again, this is just my several minute investigation / suspicions based on working in that code before, I could be off base.