LibraryOfCongress / api.congress.gov

congress.gov API
642 stars 39 forks source link

(committee list API): returns 500 "Reverse for 'committee_details' with keyword arguments not found" #162

Closed ryparker closed 8 months ago

ryparker commented 11 months ago

Requesting committee list returns a 500 error

Request

curl 'https://api.congress.gov/v3/committee?format=json&limit=250&api_key=<REPLACE_ME>'

Response

{
    "error": "Reverse for 'committee_details' with keyword arguments '{'systemCode': 'LOC18600316', 'chamber': 'house'}' not found. 2 pattern(s) tried: ['v3/committee/(?P<chamber>(house|senate|joint|House|Senate|Joint))/(?P<systemCode>([a-z0-9]+))(?P<file_ext>(\\\\.xml|\\\\.json|/))?$', 'v2/committee/(?P<chamber>(house|senate|joint|House|Senate|Joint))/(?P<systemCode>([a-z0-9]+))(?P<file_ext>(\\\\.xml|\\\\.json|/))?$'] (NoReverseMatch)",
    "request": {
        "contentType": "application/json",
        "format": "json"
    }
}
jonquandt commented 11 months ago

We're also seeing this issue on our end during our weekly checks. It affects at the /committee level, and at /committee/house or /committee/senate, but the individual committee information is returning. Affects both json and xml formatted responses.

Erroring:

https://api.congress.gov/v3/committee/?format=xml&api_key=DEMO_KEY https://api.congress.gov/v3/committee/house?format=xml&api_key=DEMO_KEY https://api.congress.gov/v3/committee/senate?format=xml&api_key=DEMO_KEY

example working individual committee: https://api.congress.gov/v3/committee/house/hhah00?format=xml&api_key=DEMO_KEY

jonquandt commented 10 months ago

Just an update that now we're seeing that the issue has changed. We're now seeing a list come back from the basic https://api.congress.gov/v3/committee?format=json&api_key=DEMO_KEY request, but the url elements appear to be using a systemCode identifier - e.g. https://api.congress.gov/v3/committee/senate/LOC18261226?format=json, which has an LOCXXXXXX identifier that leads to a different error:

{
    "error": "'NoneType' object has no attribute 'in_current_congress' (AttributeError)",
    "request": {
        "chamber": "senate",
        "contentType": "application/json",
        "format": "json",
        "systemCode": "loc18261226"
    }
}

I may have missed it, but I don't see anything in the changelog related to this endpoint and issue. Given the change of Congress session, we are anticipating that there may be a larger number of updates to committees in the next month or so.

@apreiter18 do you have any information on ETA for fixes for this issue (and #180)?

mqueen73 commented 10 months ago

Jon,

At the request of Stephen Kharfen (GPO), I have started to create historical committee authority records for terminated committees so that GPO can access them via the Congress.gov API. The historical committees predate the semi-standardized House and Senate-issued committee codes. The system codes we are piloting are the terminated committee’s start year (“1879”), month (“05”), and day (“16”) prefixed with “LOC.”

Sorry, we should have pre-coordinated with your team about these codes. Can they work for you?

As a short term fix, do you need us to remove them until you can program for them?

With the exception of the external committee code values (e.g. LOC18790516), each committee authority record is created in Congress.gov Admin Tools and formatted/organized in the same manner as current committee authority records.

Mike Queen (CRS)

jonquandt commented 9 months ago

Chatting with the team to see about the LOC system codes, but I don't anticipate an issue at this time as long as those remain stable.

apreiter18 commented 9 months ago

Just an update that now we're seeing that the issue has changed. We're now seeing a list come back from the basic https://api.congress.gov/v3/committee?format=json&api_key=DEMO_KEY request, but the url elements appear to be using a systemCode identifier - e.g. https://api.congress.gov/v3/committee/senate/LOC18261226?format=json, which has an LOCXXXXXX identifier that leads to a different error:

{
    "error": "'NoneType' object has no attribute 'in_current_congress' (AttributeError)",
    "request": {
        "chamber": "senate",
        "contentType": "application/json",
        "format": "json",
        "systemCode": "loc18261226"
    }
}

I may have missed it, but I don't see anything in the changelog related to this endpoint and issue. Given the change of Congress session, we are anticipating that there may be a larger number of updates to committees in the next month or so.

@apreiter18 do you have any information on ETA for fixes for this issue (and #180)?

@jonquandt - we are estimating that the fix will be available on February 5, 2024.