Closed willdurand closed 6 years ago
An undefined
user agent name is a likely scenario, especially for scripted requests. The current error logging is trying to alert us to unmapped agents (which would be a bug):
However, it should probably only log a warning. There are too many scenarios where a user could trigger this error and spam Sentry.
However, it should probably only log a warning. There are too many scenarios where a user could trigger this error and spam Sentry.
Agreed!
Hey guys - I'd like to take this one up if that's ok!
@willdurand You mentioned that the error was found in production logs (which I assume regular contributors wouldn't have access to). Is there a way that we can reproduce this locally?
@SeanPrashad you can try to use a tool like HTTPie to send request without a user agent.
I was taking a look at what master
had since I couldn't find the log.error
section and it looks like it's been updated:
Using HTTPie allows me to specify a null user agent, but I'm not seeing the error message when I hit the localhost:3000/en-us/firefox/
endpoint with 2c5cfa470 checked out.
Should I look to reproduce this in a different manner?
Edit: Running http --verbose 127.0.0.1:3000/en-US/firefox/ 'User-Agent;'
produces:
Ok, so I guess this is a wontfix since we don't have the log entry anymore.
Describe the problem and steps to reproduce it:
I read the production logs.
What happened?
I saw:
What did you expect to happen?
I don't know. Maybe it is a false positive but we should investigate why the user agent OS value is
<undefined agentOsName>
.What to do?
We should change the log level of this message from
error
towarning
by updating this block: https://github.com/mozilla/addons-frontend/blob/adb2ad0132798af9f5fee9e5c98c542265ba5b40/src/amo/components/PermissionsCard/permissions.js#L73-L77Instead of calling
log.error
, we should calllog.warn