mjordan / islandora_workbench

A command-line tool for managing content in an Islandora 2 repository
MIT License
26 stars 38 forks source link

Max retries exceeded with url #249

Open DonRichards opened 3 years ago

DonRichards commented 3 years ago

When I run check, it looks right (with a warning) but when I try to running it without --check it fails.

Check results

$ ./workbench --config demoBDcreate_all_localhost.yml --check

OK, connection to Drupal at http://islandora.traefik.me verified.
OK, configuration file has all required values (did not check for optional values).
OK, CSV file i8demo_BD/i8_sample_objects_workbench_SMALLBATCH.csv found.
OK, all 16 rows in the CSV file have the same number of columns as there are headers (19).
OK, CSV column headers match Drupal field names.
OK, required Drupal fields are present in the CSV file.
OK, ETDF field values in the CSV file validate.
OK, term IDs/names in CSV file exist in their respective taxonomies.
Warning: Issues detected with validating taxonomy field values in the CSV file. See the log for more detail.
OK, term IDs/names used in typed relation fields in the CSV file exist in their respective taxonomies.
Warning: Issues detected with validating typed relation field values in the CSV file. See the log for more detail.
OK, files named in the CSV "file" column are all present; the "allow_missing_files" option is enabled and empty "file" values exist.
Configuration and input data appear to be valid.

Run results

$ ./workbench --config demoBDcreate_all_localhost.yml

OK, connection to Drupal at http://islandora.traefik.me verified.
Node for "New Collection Created by Workbench" (record 1) created at https://islandora.traefik.me/islandora/new-collection-created-workbench-5.
+No media for https://islandora.traefik.me/islandora/new-collection-created-workbench-5 created since its "file" field in the CSV is empty.
Node for "Amherst 1886" (record 5) created at https://islandora.traefik.me/islandora/amherst-1886-6.
Traceback (most recent call last):
  File "/home/don/github/bd-base-i8/islandora_workbench/env/lib/python3.8/site-packages/urllib3/connection.py", line 169, in _new_conn
    conn = connection.create_connection(
  File "/home/don/github/bd-base-i8/islandora_workbench/env/lib/python3.8/site-packages/urllib3/util/connection.py", line 73, in create_connection
    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
  File "/usr/lib/python3.8/socket.py", line 918, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/don/github/bd-base-i8/islandora_workbench/env/lib/python3.8/site-packages/urllib3/connectionpool.py", line 699, in urlopen
    httplib_response = self._make_request(
  File "/home/don/github/bd-base-i8/islandora_workbench/env/lib/python3.8/site-packages/urllib3/connectionpool.py", line 394, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/home/don/github/bd-base-i8/islandora_workbench/env/lib/python3.8/site-packages/urllib3/connection.py", line 234, in request
    super(HTTPConnection, self).request(method, url, body=body, headers=headers)
  File "/usr/lib/python3.8/http/client.py", line 1255, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib/python3.8/http/client.py", line 1301, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.8/http/client.py", line 1250, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.8/http/client.py", line 1010, in _send_output
    self.send(msg)
  File "/usr/lib/python3.8/http/client.py", line 950, in send
    self.connect()
  File "/home/don/github/bd-base-i8/islandora_workbench/env/lib/python3.8/site-packages/urllib3/connection.py", line 200, in connect
    conn = self._new_conn()
  File "/home/don/github/bd-base-i8/islandora_workbench/env/lib/python3.8/site-packages/urllib3/connection.py", line 181, in _new_conn
    raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f3068a9e940>: Failed to establish a new connection: [Errno -2] Name or service not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/don/github/bd-base-i8/islandora_workbench/env/lib/python3.8/site-packages/requests/adapters.py", line 439, in send
    resp = conn.urlopen(
  File "/home/don/github/bd-base-i8/islandora_workbench/env/lib/python3.8/site-packages/urllib3/connectionpool.py", line 755, in urlopen
    retries = retries.increment(
  File "/home/don/github/bd-base-i8/islandora_workbench/env/lib/python3.8/site-packages/urllib3/util/retry.py", line 574, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='islandora.traefik.mehttps', port=80): Max retries exceeded with url: //islandora.traefik.me/islandora/amherst-1886-6/media/image/5 (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f3068a9e940>: Failed to establish a new connection: [Errno -2] Name or service not known'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./workbench", line 963, in <module>
    create()
  File "./workbench", line 333, in create
    media_response_status_code = create_media(config, row['file'], node_uri, row_for_media)
  File "/home/don/github/bd-base-i8/islandora_workbench/workbench_utils.py", line 1352, in create_media
    media_response = issue_request(config, 'PUT', media_endpoint, media_headers, '', binary_data)
  File "/home/don/github/bd-base-i8/islandora_workbench/workbench_utils.py", line 271, in issue_request
    response = requests.put(
  File "/home/don/github/bd-base-i8/islandora_workbench/env/lib/python3.8/site-packages/requests/api.py", line 134, in put
    return request('put', url, data=data, **kwargs)
  File "/home/don/github/bd-base-i8/islandora_workbench/env/lib/python3.8/site-packages/requests/api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "/home/don/github/bd-base-i8/islandora_workbench/env/lib/python3.8/site-packages/requests/sessions.py", line 542, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/don/github/bd-base-i8/islandora_workbench/env/lib/python3.8/site-packages/requests/sessions.py", line 655, in send
    r = adapter.send(request, **kwargs)
  File "/home/don/github/bd-base-i8/islandora_workbench/env/lib/python3.8/site-packages/requests/adapters.py", line 516, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='islandora.traefik.mehttps', port=80): Max retries exceeded with url: //islandora.traefik.me/islandora/amherst-1886-6/media/image/5 (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f3068a9e940>: Failed to establish a new connection: [Errno -2] Name or service not known'))

Config

task: create
host: "http://islandora.traefik.me/"
username: admin
password: password
input_dir: i8demo_BD
input_csv: i8_sample_objects_workbench_SMALLBATCH.csv
allow_missing_files: true
allow_adding_terms: true
log_json: true

CSV

title,id,parent_id,field_weight,field_identifier,field_resource_type,field_genre,field_linked_agent,field_model,field_edtf_date_created,field_edtf_date_issued,field_place_published,field_description_long,field_rights,field_subject,field_member_of,field_language,field_display_hints,file
New Collection Created by Workbench,1,,,,collection,,,Collection,,,,,,,,,,
mjordan commented 3 years ago

issue_request() (https://github.com/mjordan/islandora_workbench/blob/main/workbench_utils.py#L220) should be wrapped in a try/except.

On a related topic, I can't test with Docker, I'm still unable to stand up isle-dc (related to #222).