A4A: Crypto operation unsuported
Getting some 250 errors an hour matching:
The requested operation is unsupported
These are being generated by Chrome's crypto library when some algorithm is unsupported. These should be handled, or at least marked as expected errors.
There's also never a stack trace, which made it a little hard to debug until I realized a "Error: cross-origin render mode header null" always happened afterwards.
I will modify extensions/amp-a4a/0.1/crypto-verifier.js#verifySignature so that crossCrypto.verify has a catch allowing for easily exposing the error message to logging. This should help identify where/when this is occurring.
@jridgewell I assume you were unable to reproduce the error? If you were, can you provide specifics? Thanks
Looking at the code, I believe we already handle this error (as indicated by the null header message indicating we are using xdomain rendering). I believe it could occur either during key import in which case the following logging occurs (all from within amp-a4a.js):
user().error(TAG, this.element.getAttribute('type'), 'error importing keys for service: ${jwkSet.serviceName}', err, this.element);
Or during verify:
user().error(TAG, this.element.getAttribute('type'), keyInfo.serviceName, err, this.element);
I was unable to locate instances of these in error logs (looked for "The requested operation is unsupported"). So it would appear that we are explicitly handling with the correct result although it would be good to know what causes this to occur.
@jridgewell Could I get some newbie-level instructions on how to reproduce this? i.e. does this occur during unit tests, or when viewing article.amp.max.html, or...? Thanks!
I remember getting the particular error was nearly impossible (I downloaded an old Chrome that didn't support pkcs). Essentially, anytime you call subtle.METHOD that returns a promise, you need to put a Promise#catch handler somewhere promise tree.
Ping. These errors are annoying.
I'm still seeing The requested operation is unsupported error in dev error log. I think it's possibly because of this,which should not be dev error. Also, dev().assert is striped from production code so I think it's better to use user().assert here and here
Sorry, got pulled onto other things, but picking this back up this afternoon.
Ping. This is still coming up.
I did some initial investigation. Our StackDriver logs indicate that the errors are coming from Chrome 37. Caniuse.com and MDN indicate that this was the first version of Chrome to support Web Crypto, but I downloaded an old binary and checked, and it doesn't seem to. I have no idea what's going on there, but I wouldn't be surprised if it was related to the problem. At any rate, with my current Chrome binary (37.0.1986.0; the errors were coming from 37.0.0.0 but I couldn't find a binary for that version) I can't reproduce the error because the Web Crypto feature detection fails and so it won't try to use Fast Fetch. Anyone have any bright ideas about where to go from here?
We just need to put catch blocks in the promise tree. When it hits, it fails A4A and goes through the normal 3p path.
@keithwrightbos can this be prioritized? We'd want to get to solving any P1s within a week.
I think PR #9040 is going to fix this.
Looks like #9040 did indeed fix this. Can we close?
#9040 has been abandoned, but if one of the PRs that it's been replaced with fixed the problem then we can close.
I checked stackdriver and see 1 occurrence of the error in the past 2 days. Given that it used to be hundreds per hour, I'm willing to chalk it up to being fixed but one person had a stale version in cache or something. Justin?
On Mon, Jul 17, 2017 at 12:32 PM, Taymon A. Beal [email protected] wrote:
#9040 https://github.com/ampproject/amphtml/pull/9040 has been abandoned, but if one of the PRs that it's been replaced with fixed the problem then we can close.
— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/ampproject/amphtml/issues/6676#issuecomment-315803587, or mute the thread https://github.com/notifications/unsubscribe-auth/ACV2BxZStIhotPOMsCRwtW_QVNz5wvtdks5sO4yugaJpZM4LNa_v .
There are 62k logged reports for latest prod (it's our top error).
This is a high priority issue but it hasn't been updated in awhile. @keithwrightbos Do you have any updates?
Seems to have been fixed.
In our first success for POST error reports, this was unmasked. The GET requests chopped the stack from the report because of too many experiments hogging up the URL.