LibraryOfCongress / api.congress.gov

congress.gov API
642 stars 39 forks source link

(committee bills API): responds 500 "Reverse for 'bill_details' with keyword arguments not found" #116

Closed ryparker closed 11 months ago

ryparker commented 1 year ago

When requesting https://api.congress.gov/v3/committee/House/hshf00/bills?api_key=<API_KEY>&format=json&limit=250&offset=11250.

I receive a 500:

{
    "error": "Reverse for 'bill_details' with keyword arguments '{'congress': 7, 'billType': 'cen_doc_h', 'billNumber': '54'}' not found. 2 pattern(s) tried: ['v3/bill/(?P<congress>(\\\\d+))/(?P<billType>(hr|hres|hconres|hjres|s|sres|sconres|sjres))/(?P<billNumber>(\\\\d+\\\\xbd?M{0,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})|M{0,4}(CM|C?D|D?C{1,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})|M{0,4}(CM|CD|D?C{0,3})(XC|X?L|L?X{1,3})(IX|IV|V?I{0,3})|M{0,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|I?V|V?I{1,3})?))(?P<file_ext>(\\\\.xml|\\\\.json|/))?$(?i)', 'v2/bill/(?P<congress>(\\\\d+))/(?P<billType>(hr|hres|hconres|hjres|s|sres|sconres|sjres))/(?P<billNumber>(\\\\d+))(?P<file_ext>(\\\\.xml|\\\\.json|/))?$(?i)'] (NoReverseMatch)",
    "request": {
        "chamber": "house",
        "committeeUrl": "https://api.congress.gov/v3/committee/house/hshf00?format=json",
        "contentType": "application/json",
        "format": "json",
        "systemCode": "hshf00"
    }
}

Response metadata:

{
  "response": {
    "status": 500,
    "statusText": "Internal Server Error",
    "headers": {
      "date": "Mon, 17 Jul 2023 09:04:32 GMT",
      "content-type": "application/json",
      "content-length": "973",
      "connection": "close",
      "access-control-allow-origin": "*",
      "age": "1",
      "cf-cache-status": "DYNAMIC",
      "cf-ray": "7e815162a9cec65c-SEA",
      "strict-transport-security": "max-age=31536000; preload",
      "vary": "Accept",
      "via": "http/1.1 api-umbrella (ApacheTrafficServer [cMsSf ])",
      "x-api-umbrella-request-id": "c9ccc1j9kjp41dh6mghg",
      "x-cache": "MISS",
      "x-ratelimit-limit": "1000",
      "x-ratelimit-remaining": "464",
      "x-vcap-request-id": "2cb1989d-2c66-4b07-5ffd-579fc2e9e7c0",
      "x-frame-options": "DENY",
      "x-content-type-options": "nosniff",
      "x-xss-protection": "1; mode=block"
    }
  }
}

Reproduce:

curl --location 'https://api.congress.gov/v3/committee/House/hshf00/bills?format=json&limit=250&offset=11250&api_key=<REPLACE_ME>' 
c4lliope commented 1 year ago

Also happened for me on /bill:

# program logs
.Error pulling bill[bills]; {:fromDateTime=>"2023-06-12T16:15:22Z"}

# api.congress.gov response
Reverse for 'bill_details' with keyword arguments
'{ 'congress': 6, 'billType': 'cen_doc_h', 'billNumber': '73'}'
not found. 2 pattern(s) tried: [
'v3/bill/(?P<congress>(\\d+))/(?P<billType>(hr|hres|hconres|hjres|s|sres|sconres|sjres))/(?P<billNumber>(\\d+\\xbd?M{0,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})|M{0,4}(CM|C?D|D?C{1,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})|M{0,4}(CM|CD|D?C{0,3})(XC|X?L|L?X{1,3})(IX|IV|V?I{0,3})|M{0,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|I?V|V?I{1,3})?))(?P<file_ext>(\\.xml|\\.json|/))?$(?i)',
'v2/bill/(?P<congress>(\\d+))/(?P<billType>(hr|hres|hconres|hjres|s|sres|sconres|sjres))/(?P<billNumber>(\\d+))(?P<file_ext>(\\.xml|\\.json|/))?$(?i)'
] (NoReverseMatch)
mnewatloc commented 1 year ago

Thank you for reporting this. We're working on a fix.