bibxml-service icon indicating copy to clipboard operation
bibxml-service copied to clipboard

ValueError: Invalid Datatracker ID: moss-named-ports-v.01

Open sentry-io[bot] opened this issue 3 years ago • 8 comments

Sentry Issue: BIBXML-SERVICE-M

ValueError: Invalid Datatracker ID: moss-named-ports-v.01
(7 additional frame(s) were not displayed)
...
  File "django/views/decorators/cache.py", line 56, in _wrapped_view_func
    response = view_func(request, *args, **kwargs)
  File "django/views/decorators/http.py", line 40, in inner
    return func(request, *args, **kwargs)
  File "xml2rfc_compat/views.py", line 211, in handle_xml2rfc_path
    adapter = adapter_cls(xml2rfc_subpath, normalized_dirname, anchor)
  File "bibxml/xml2rfc_adapters.py", line 155, in __init__
    unversioned, version = remove_version(self.bare_anchor)
  File "datatracker/internet_drafts.py", line 51, in remove_version
    raise ValueError("Invalid Datatracker ID: %s" % id)

sentry-io[bot] avatar Aug 11 '22 21:08 sentry-io[bot]

The ID is definitely invalid, it is likely to should have been moss-named-ports-01. @strogonoff what should we do with this?

ronaldtse avatar Aug 12 '22 03:08 ronaldtse

Another URL that is causing above error: http://bib.ietf.org/public/rfc/bibxml-ids/reference.i-d.draft-harkins-pkex-02.xml

kesara avatar Aug 14 '22 21:08 kesara

Sentry issue: BIBXML-SERVICE-Y

sentry-io[bot] avatar Aug 14 '22 21:08 sentry-io[bot]

This another unhandled error captured on Sentry, breaks at the same point: https://bib.ietf.org/get-one/export/?docid=draft-gont-tcpm-rfc1948bis%27%5B0%5D&doctype=Internet-Draft&format=relaton

kesara avatar Aug 14 '22 21:08 kesara

Another URL that is causing above error: http://bib.ietf.org/public/rfc/bibxml-ids/reference.i-d.draft-harkins-pkex-02.xml

This URL contains i-d in lowercase, the logic assumes I-D. This could be changed, of course🤔

strogonoff avatar Jan 08 '23 17:01 strogonoff

The ID is definitely invalid, it is likely to should have been moss-named-ports-01. @strogonoff what should we do with this?

It looks like the path was not given correctly. We could find out where this request came from, but generally this implementation follows a request not to try to interpret paths with fuzzy matching (which was the case with my initial implementation). There is a comment somewhere that requests xml2rfc paths for I-Ds to fail if a path does not match the expected structure, even if we can extract enough useful information from it, and not failing is to be treated as a bug.

  • However, that this path fails with 500 may be a regression. I suspect there should be an error handler that catches this and returns HTTP 404.
  • The path pasted by Kesara, depending on where it came from, may indicate a necessity of supporting lowercase i-d. prefix in addition to uppercase one—if that’s API users’ expectation—which would call for a corresponding change.

strogonoff avatar Jan 08 '23 17:01 strogonoff

As @strogonoff mentioned, during implementation @rjsparks has advised that any paths not matching the expected path pattern should return an error.

@rjsparks has this decision changed since, that fuzzy path matching is to be implemented?

ronaldtse avatar Jan 09 '23 01:01 ronaldtse

no - that has not changed, and .i-d. is not intended to work.

rjsparks avatar Jan 09 '23 15:01 rjsparks