amphtml icon indicating copy to clipboard operation
amphtml copied to clipboard

Error: Tried to add display:none element to FixedLayer AMP-USER-NOTIFICATION/AMP-CONSENT/AMP-STICKY-AD

Open dparikh opened this issue 8 years ago • 21 comments

Errors in Stackdriver console: https://pantheon.corp.google.com/errors/CKXHgKLOg4XlDg?service=default-cdn-1p-canary&time=PT6H&project=amp-error-reporting

Stack trace:

Error: Tried to add display:none element to FixedLayer AMP-CONSENT at Error (https://raw.githubusercontent.com/ampproject/amphtml/1527816702194/src/log.js:505) at apply (https://raw.githubusercontent.com/ampproject/amphtml/1527816702194/src/log.js:221) at apply (https://raw.githubusercontent.com/ampproject/amphtml/1527816702194/src/log.js:234) at Store (https://raw.githubusercontent.com/ampproject/amphtml/1527816702194/src/service/storage-impl.js:175) at win (https://raw.githubusercontent.com/ampproject/amphtml/1527816702194/src/service/viewport/viewport-binding-ios-embed-wrapper.js:236) at addToFixedLayer (https://raw.githubusercontent.com/ampproject/amphtml/1527816702194/extensions/amp-consent/0.1/amp-consent.js:603) at getScrollTop (https://raw.githubusercontent.com/ampproject/amphtml/1527816702194/src/service/viewport/viewport-impl.js:486) at measurePromise (https://raw.githubusercontent.com/ampproject/amphtml/1527816702194/src/service/viewport/viewport-impl.js:444) at (https://raw.githubusercontent.com/ampproject/amphtml/1527816702194/src/service/url-replacements-impl.js:712) at getElementServiceIfAvailable (https://raw.githubusercontent.com/ampproject/amphtml/1527816702194/src/element-service.js:62)

Sample example URLs: Referrer https://amp-elnuevoherald-com.cdn.ampproject.org/v/amp.elnuevoherald.com/vivir-mejor/salud/article98062447.html?amp_js_v=0.1&usqp=mq331AQECAEoAQ%3D%3D User agent Mozilla/5.0 (Linux; Android 7.0; LG-M210 Build/NRD90U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.158 Mobile Safari/537.36 Service default-cdn-1p-canary Version 001527816702194

dparikh avatar Jun 01 '18 20:06 dparikh

The errors have been there for a while. Downgrade to p1 instead.

zhouyx avatar Jun 01 '18 20:06 zhouyx

This is amp-user-notification not playing nice with being suppressed by CSS from amp-geo

Once #15648 makes it to prod I'll flip the config the converter is adding to use the new geo awareness in amp-user-notification and this error will go away.

Reducing priority to P2 because it's working even though it's throwing an error.

Assigning to myself

jpettitt avatar Jun 02 '18 00:06 jpettitt

Duplicate with https://github.com/ampproject/amphtml/issues/13327 ?

cathyxz avatar Jun 05 '18 21:06 cathyxz

The underlying issue may be duplicate however the specific instance withe amp-user-notification is due to one publisher as far as I'm aware..

jpettitt avatar Jun 06 '18 00:06 jpettitt

It's probably a duplicate. There were three attempts to fix the <amp-sticky-ad> issue, but didn't succeed. Now I am starting to think this is an issue on the fixed layer side.

zhouyx avatar Jun 07 '18 17:06 zhouyx

@jpettitt are you going for the config change before tmr's canary cut? Or we need wait for another release?

lannka avatar Jun 11 '18 20:06 lannka

I investigated the bug a bit more. I don't think it's an error as a publisher can put display:none on top of any component through media query or geo. That say I don't believe the bug fix should live within individual component, as it shouldn't be individual component's responsibility to check for computedStyle before adding component to fixed layer.

My question is: What's the drawback of adding display:none elements to fixed layer, compared to having individual component check of computedStyle.

If we believe adding display:none elements to fixed layer is too expensive, maybe we should have the FixedLayer do the check. Not throwing an error, as this can sometimes be expected, but simply don't add these elements to fixed layer. Then have addToFixedLayer return a boolean for success.

@jridgewell ideas?

zhouyx avatar Jun 15 '18 18:06 zhouyx

This is one of our top production errors, so it will be great to speed the process for fixing this. Thank you.

adelinamart avatar Jun 15 '18 20:06 adelinamart

The code that will let me fix it on the 31 of the converter sites just got to canary this week so when I'm back from vacation I'll fix those sites.

jpettitt avatar Jun 15 '18 21:06 jpettitt

@adelinamart I suggest we just mute these errors, or report them at 1%. As they are not real bugs to me, and we are not doing anything special when encountering these errors other than reporting. cc @jridgewell

zhouyx avatar Jun 15 '18 22:06 zhouyx

@choumx @jridgewell What's your ideas regard https://github.com/ampproject/amphtml/issues/15752#issuecomment-397707578

zhouyx avatar Jun 18 '18 20:06 zhouyx

@jridgewell Are we still seeing these errors ?

jpettitt avatar Jun 29 '18 01:06 jpettitt

@choumx @jridgewell Not sure what to do with this, I fixed the issue on the publisher side for the sites we convert. Who should own the more generic case?

jpettitt avatar Jun 29 '18 17:06 jpettitt

Chatted with Justin about this.

There are two types of errors that cause this: (A) dev error and (B) user error. We should keep the error in some form to reduce (A) and get metrics for (B) is to see how important it is to fix the generic case.

Since errors triggered from amp-consent are likely benign, we can change those (and other verifiably correct components) to be user errors instead. User errors are throttled to 10% by default.

dreamofabear avatar Jul 06 '18 21:07 dreamofabear

Tracking issue is https://github.com/ampproject/amphtml/issues/17475.

jridgewell avatar Aug 27 '18 22:08 jridgewell

These errors have spiked tremendously in 031809251804390. Possibly related to: #17988

dreamofabear avatar Sep 27 '18 14:09 dreamofabear

This is a high priority issue but it hasn't been updated in awhile. @jridgewell Do you have any updates?

ampprojectbot avatar Oct 16 '18 09:10 ampprojectbot

This is a high priority issue but it hasn't been updated in awhile. @jridgewell Do you have any updates?

ampprojectbot avatar Nov 08 '18 03:11 ampprojectbot

This is a high priority issue but it hasn't been updated in awhile. @jridgewell Do you have any updates?

ampprojectbot avatar Nov 28 '18 05:11 ampprojectbot

This is a high priority issue but it hasn't been updated in awhile. @jridgewell Do you have any updates?

ampprojectbot avatar Jan 09 '19 10:01 ampprojectbot