OregonDigital / OD2

Next generation of Oregon Digital ( https://oregondigital.org ) digital collections platform, built on Samvera Hyrax ( https://github.com/samvera/hyrax/ )
19 stars 1 forks source link

label fetch for itis fails #2128

Closed lsat12357 closed 2 years ago

lsat12357 commented 2 years ago

Descriptive summary

When fetching label for itis uri fails, it does not do so gracefully; in the example below, the hyrax actor stack stopped.

Expected behavior

  1. Label should be successfully fetched
  2. If the label cannot be fetched, it should not blow up.

traceback: I, [2021-12-30T09:18:46.496810 #1360] INFO -- : Fetching https://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=99208 from the authorative source. (this is slow) E, [2021-12-30T09:18:46.582521 #1360] ERROR -- : end of file reached Traceback (most recent call last): 16: from (irb):119:in process_pids' 15: from (irb):119:ineach' 14: from (irb):124:in block in process_pids' 13: from (irb):57:infix_visibility' 12: from app/actors/oregon_digital/actors/create_with_oembed_url_actor.rb:19:in update' 11: from app/indexers/image_indexer.rb:6:ingenerate_solr_document' 10: from app/indexers/generic_indexer.rb:15:in generate_solr_document' 9: from app/indexers/concerns/oregon_digital/indexing_dates_behavior.rb:9:ingenerate_solr_document' 8: from app/indexers/oregon_digital/deep_indexing_service.rb:19:in fetch_external' 7: from app/indexers/oregon_digital/deep_indexing_service.rb:19:ineach' 6: from app/indexers/oregon_digital/deep_indexing_service.rb:20:in block in fetch_external' 5: from app/indexers/oregon_digital/deep_indexing_service.rb:27:inblock (2 levels) in fetch_external' 4: from lib/oregon_digital/controlled_vocabularies/scientific.rb:22:in fetch' 3: from lib/oregon_digital/controlled_vocabularies/vocabularies/itis.rb:21:infetch' 2: from app/services/oregon_digital/json_parse_service.rb:7:in json' 1: from app/services/oregon_digital/json_parse_service.rb:11:inquery_json' Faraday::ConnectionFailed (end of file reached)

lsat12357 commented 2 years ago

another traceback 2021-12-28T23:01:23.560Z pid=40 tid=mnx8 WARN: Faraday::TimeoutError: Net::ReadTimeout with #<TCPSocket:(closed)> 2021-12-28T23:01:23.560Z pid=40 tid=mnx8 WARN: /usr/local/lib/ruby/2.7.0/net/protocol.rb:217:in rbuf_fill' /usr/local/lib/ruby/2.7.0/net/protocol.rb:191:inreaduntil' /usr/local/lib/ruby/2.7.0/net/protocol.rb:201:in readline' /usr/local/lib/ruby/2.7.0/net/http/response.rb:42:inread_status_line' /usr/local/lib/ruby/2.7.0/net/http/response.rb:31:in read_new' /usr/local/lib/ruby/2.7.0/net/http.rb:1528:inblock in transport_request' /usr/local/lib/ruby/2.7.0/net/http.rb:1519:in catch' /usr/local/lib/ruby/2.7.0/net/http.rb:1519:intransport_request' /usr/local/lib/ruby/2.7.0/net/http.rb:1492:in request' /usr/local/lib/ruby/2.7.0/net/http.rb:1485:inblock in request' /usr/local/lib/ruby/2.7.0/net/http.rb:933:in start' /usr/local/lib/ruby/2.7.0/net/http.rb:1483:inrequest' /usr/local/lib/ruby/2.7.0/net/http.rb:1241:in get' /usr/local/bundle/gems/faraday-0.17.4/lib/faraday/adapter/net_http.rb:86:inperform_request' /usr/local/bundle/gems/faraday-0.17.4/lib/faraday/adapter/net_http.rb:44:in block in call' /usr/local/bundle/gems/faraday-0.17.4/lib/faraday/adapter/net_http.rb:93:inwith_net_http_connection' /usr/local/bundle/gems/faraday-0.17.4/lib/faraday/adapter/net_http.rb:39:in call' /usr/local/bundle/gems/honeycomb-beeline-2.4.0/lib/honeycomb/integrations/faraday.rb:29:inblock in call' /usr/local/bundle/gems/honeycomb-beeline-2.4.0/lib/honeycomb/client.rb:70:in start_span' /usr/local/bundle/gems/honeycomb-beeline-2.4.0/lib/honeycomb/integrations/faraday.rb:16:incall' /usr/local/bundle/gems/faraday-0.17.4/lib/faraday/request/url_encoded.rb:15:in call' /usr/local/bundle/gems/faraday-0.17.4/lib/faraday/rack_builder.rb:143:inbuild_response' /usr/local/bundle/gems/faraday-0.17.4/lib/faraday/connection.rb:387:in run_request' /usr/local/bundle/gems/faraday-0.17.4/lib/faraday/connection.rb:138:inget' /usr/local/bundle/gems/faraday-0.17.4/lib/faraday.rb:102:in method_missing' /data/app/services/oregon_digital/json_parse_service.rb:11:inquery_json' /data/app/services/oregon_digital/json_parse_service.rb:7:in json' /data/lib/oregon_digital/controlled_vocabularies/vocabularies/itis.rb:21:infetch'

lsat12357 commented 2 years ago

UGH namespace error

wickr commented 2 years ago

QA on #2153 should cover this too. Errors are being handled for timeouts, we'll also add code to handle empty responses when the service is up but the URI is bad.