Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore case when parsing probe_asn field #318

Open
hellais opened this issue Feb 4, 2020 · 2 comments · May be fixed by #864
Open

Ignore case when parsing probe_asn field #318

hellais opened this issue Feb 4, 2020 · 2 comments · May be fixed by #864
Assignees
Labels
bug Something isn't working good first issue Good for newcomers ooni/api Issues related to https://github.com/ooni/api priority/low

Comments

@hellais
Copy link
Member

hellais commented Feb 4, 2020

Currently we strip the leading AS from the probe_asn field, but only if it's uppercase, see: https://github.com/ooni/api/blob/9349825b05b8006a476e8dbaf37e1d9aabf4fc69/measurements/api/measurements.py#L63.

In sentry we found the following stacktrace exception:


File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1838, in full_dispatch_request     rv = self.dispatch_request()   File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1824, in dispatch_request     return self.view_functions[rule.endpoint](**req.view_args)   File "/usr/local/lib/python3.7/site-packages/connexion/decorators/decorator.py", line 73, in wrapper     response = function(request)   File "/usr/local/lib/python3.7/site-packages/connexion/decorators/uri_parsing.py", line 117, in wrapper     response = function(request)   File "/usr/local/lib/python3.7/site-packages/connexion/decorators/validation.py", line 336, in wrapper     return function(request)   File "/usr/local/lib/python3.7/site-packages/connexion/decorators/decorator.py", line 44, in wrapper     response = function(request)   File "/usr/local/lib/python3.7/site-packages/connexion/decorators/parameter.py", line 207, in wrapper     return function(**kwargs)   File "/app/measurements/api/measurements.py", line 357, in list_measurements     probe_asn = int(probe_asn)

We should rather be stripping the leading as in a case-insensitive way or tighten the rule for matching to avoid triggering an exception.

@hellais hellais added bug Something isn't working ooni/api Issues related to https://github.com/ooni/api good first issue Good for newcomers labels Feb 4, 2020
@sentry-io
Copy link

sentry-io bot commented Feb 4, 2020

Sentry issue: API-1ZT

@sentry-io
Copy link

sentry-io bot commented Feb 4, 2020

Sentry issue: API-25A

@hellais hellais self-assigned this May 25, 2020
FedericoCeratto pushed a commit that referenced this issue Mar 16, 2023
FP 0.29: S3 cache trim, sshfeeder fixes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers ooni/api Issues related to https://github.com/ooni/api priority/low
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant