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

[9.0] Failed to read the 'rules' property from 'CSSStyleSheet': #22517

Closed
thomas15v opened this issue Jan 25, 2018 · 59 comments
Closed

[9.0] Failed to read the 'rules' property from 'CSSStyleSheet': #22517

thomas15v opened this issue Jan 25, 2018 · 59 comments
Labels
9.0 Confirmed the bug was confirmed by testers Need information the reports lacks of information

Comments

@thomas15v
Copy link
Contributor

thomas15v commented Jan 25, 2018

Impacted versions:

  • 9.0
  • Other odoo versions also act weird if you right click on a menu (tested community).

Steps to reproduce:

  • In google chrome try to open your user preferences. Firefox does not seem to be impacted.
  • Trying to edit any model
  • Sometimes happens with wizards

Video/Screenshot link (optional):
image
Screenshot from Gyazo

@Yenthe666 Yenthe666 added Need information the reports lacks of information 9.0 labels Jan 25, 2018
@Yenthe666
Copy link
Collaborator

Hi @thomas15v,

Thanks a lot for your report.
I've just tried this on the latest Odoo 9 (community) on Chrome and Firefox and it seems to work fine.
Can you reproduce it on an official test instance (runbot.odoo.com)
Do you have custom plugins added that modify CSS?
Is your Odoo on the latest source code?
Which version of Chrome are you using?

Regards,
Yenthe

@thomas15v
Copy link
Contributor Author

thomas15v commented Jan 25, 2018

Forgot to mention that you need Chrome 64.0.3282.119 akka the latest version. Updated rolled in yesterday. Screenshot is from runbot.

@Yenthe666
Copy link
Collaborator

Seems to work fine at my end. CC @ged-odoo as it is JS related.

@thomas15v
Copy link
Contributor Author

Just tried with a fresh google chrome without any addons, same problem. I actually knew about this bug a while longer since I use chrome beta, but I didn't thought it would make it to the stable version.

Also we have this error on every odoo version, when right clicking a link (menuitem in community).
Screenshot from Gyazo.
I am not sure if they are related, but since it is happening with the same chrome version I think it might.

@cmarrero
Copy link

I can confirm the error with chrome 64

@jakubhruby
Copy link
Contributor

#metoo
on ArchLinux
Firefox has not this problem

@Yenthe666 Yenthe666 added the Confirmed the bug was confirmed by testers label Jan 26, 2018
@Yenthe666
Copy link
Collaborator

Yep, got it too now:
image

@ged-odoo
Copy link
Contributor

this is interesting. Yesterday, I had the crash (the one with the addeventlistener), in chrome 63. I thought we broke odoo, i tested on different versions. Then, I thought it could be related to extensions, so I disabled all my chrome extensions (just 4 or 5, not a big user of extensions), and restarted chrome. The problem disappeared.

@ged-odoo
Copy link
Contributor

difficult to say, but my first guess is that the addeventlistener crash is related to chrome, not odoo's code. However, I don't know for the other crash with cssstylesheet.

@ged-odoo
Copy link
Contributor

does it happen for version 10/11?

@thomas15v
Copy link
Contributor Author

  • cssstylesheet: Only odoo 9
  • Eventlister: On all versions (but I can't make it happen again since today, probably the extension that caused it is updated)

@traviswaelbro
Copy link
Contributor

Also having this problem on version 9. Confirmed to happen when trying to "Send by Email" on Invoices with Chrome v64.0.3282.119.

@aek
Copy link

aek commented Jan 28, 2018

Seems that basically, the issue is related to an empty CSS stylesheet introduced dynamically here:
https://github.com/odoo/odoo/blob/9.0/addons/mail/static/src/js/announcement.js#L16
in the format of:

_ab_location: function(dbuuid) {
    return _.str.sprintf('https://services.openerp.com/openerp-enterprise/ab/css/%s.css', dbuuid);
},

That js file does not introduce any useful feature for clients and it's returning an empty response - at least for non-enterprise database uuid - it's causing this issue with the chrome 64. That js file or the code it contains was removed for new versions of Odoo. Mostly that's the reason that you couldn't reproduce it in new versions

Still could be helpful to better catch the error here:
https://github.com/odoo/odoo/blob/9.0/addons/web_editor/static/src/js/transcoder.js#L16
to avoid this situation in the future

The most simple solution could be that Odoo S.A fix the CSS response of that file to at least one CSS Rule for that Ghost file
Another one could be simple extend (or manually find) the view record for mail assets to remove the line:
<script type="text/javascript" src="/mail/static/src/js/announcement.js"/>
Like this:

<template id="mail_assets_backend" name="mail assets" inherit_id="mail.assets_backend">
    <xpath expr="//script[@src='/mail/static/src/js/announcement.js']" position="replace"/>
</template>

I have tested that template extension to remove the inclusion of the announcement.js file and it seems like solving the issue at least in the detected scenario of the empty CSS file.

Talking about the solution for web_editor/static/src/js/transcoder.js you will need to remove the load of the original file and replace it with your fixed version. But I think that it won't be necessary if the previous patch fix completely the situation

Best Regards

@KottmannM
Copy link

I have the same problem with odoo 9 enterprise.

@wim-a
Copy link

wim-a commented Jan 29, 2018

We also have the same problem with Odoo 9 Enterprise.

@jithinkr12345
Copy link

jithinkr12345 commented Jan 29, 2018

Do we got any fix for this issue??? @Yenthe666

@MouTio
Copy link
Contributor

MouTio commented Jan 29, 2018

It appears that the property "rules" is missing in the CSS resource and in Firefox is treated as a warning, but in Chrome is treated as an exception.

If you show the console of both browsers, you will see the messages.
Try to enter to "Preferences" or to edit a random user.

This is the error shown by Firefox console in runbot:
Can't read the css rules of: https://services.openerp.com/openerp-enterprise/ab/css/ddf53f40-028e-11e8-ab9c-a4bf011da6d8.css

@MouTio
Copy link
Contributor

MouTio commented Jan 29, 2018

Okay, the solution is to change the code of transcoder.js located in web_editor/static/src/js:

The property "rules" is not well checked.

This line is wrong (around line number 16):
if (sheets[i].rules) {

It has to be changed to this:
if (sheets[i].hasOwnProperty('rules')) {

and the code will work fine in Chrome browser too.

I have created a PR.

Please, verify it, @Yenthe666 @ged-odoo

@wim-a
Copy link

wim-a commented Jan 29, 2018

I installed this fix. Works fine. Thanks a lot.

@ThomasBinsfeld
Copy link
Contributor

Same issue. @MouTio fix seems to work fine 👍

@Yenthe666
Copy link
Collaborator

My co-worker created an official ticket for this with the number 813371

@MouTio
Copy link
Contributor

MouTio commented Jan 29, 2018

@Yenthe666 What is an 'official ticket'?
Is it the same as PR?
I created my first PR to fix this bug:

#22603

@Yenthe666
Copy link
Collaborator

@MouTio an official bug report is one reported through odoo.com/help with your enterprise license key. It means that the issue moves up the list and gets a high(er) rating.

@remi-filament
Copy link
Contributor

I have the same issue on Odoo CE v10 - I have created PR #22679 to address this issue on v10

@treviser
Copy link

treviser commented Feb 3, 2018

I have the same issue on Odoo CE v11

leemannd pushed a commit to camptocamp/odoo that referenced this issue Apr 26, 2018
@gmarcon
Copy link
Contributor

gmarcon commented May 16, 2018

Same issue with Odoo CE 10.0-20171227 and Chrome 66.0.3359.181 (Official Build) (64-bit)

Manually applying https://github.com/odoo/odoo/pull/22679/files fixes the issue

@determin1st
Copy link

determin1st commented May 16, 2018

You can also put it in try...catch block to suppress browser warning and check that .rules property

@Yenthe666
Copy link
Collaborator

@gmarcon that is quite a long while without updating an Odoo too though 😉

@determin1st
Copy link

i dont even know what odoo is! just stucked in this notification. how to get out) backend is over, forget it! the future is for browser side

leemannd pushed a commit to camptocamp/odoo that referenced this issue Jun 12, 2018
ghost pushed a commit to camptocamp/odoo that referenced this issue Jun 12, 2018
ghost pushed a commit to camptocamp/odoo that referenced this issue Jun 13, 2018
@jpaulin
Copy link

jpaulin commented Jul 3, 2018

@ged-odoo I had similar error in Chrome with Odoo 10. Came down to removing a extension called Loom (video record / screen cap extension). When Loom was removed, Odoo no longer crashed.

ghost pushed a commit to camptocamp/odoo that referenced this issue Aug 6, 2018
ghost pushed a commit to camptocamp/odoo that referenced this issue Aug 6, 2018
ghost pushed a commit to camptocamp/odoo that referenced this issue Aug 6, 2018
ghost pushed a commit to camptocamp/odoo that referenced this issue Aug 6, 2018
ghost pushed a commit to camptocamp/odoo that referenced this issue Aug 6, 2018
@easternwawoman
Copy link

easternwawoman commented Aug 15, 2018

In case a noob arrives here, I fixed this prob in latest ver. Chrome by: (1) uninstalling and reinstalling LiveStyle ext in Chrome and then (2) disabling all extensions excet for LiveStyle. The reinstall had no effect, based on usage. Disabling extensions did create the change. I have not turned all ext. back on so I have not pinpointed the conflict. I did turn Google Voice on; no problem. The other extensions were: Full page Screen Capture, CaptureCast; Checker5 Plus; Cryptonite MetaCert, Onetab and the WavesLiteApp. Will update if I pinpoint the extension that created the conflict. And BTW, while I'm not a noob, I'm only dreaming of becoming a developer. :-)

@cierek
Copy link

cierek commented Aug 16, 2018

Are you sure you are running the latest release? I have customers running on Odoo 9 and 11 without any error since the update

@easternwawoman
Copy link

As I said in my post, I uninstalled and then reinstalled -- that reinstall was the download of latest version. I also have the latest ver. of Chrome. While it's now syncing fine betwn Ch. browser and my IDE, it is still throwing the css files not found error: " Failed to read the 'cssRules' property from 'CSSStyleSheet': Cannot access rules. " I have turned back on extensions G. Voice, Checker Plus for GMail, and CSS Peeper with no impact. Do need to turn on MetaCert and will test later on.

@pedrobaeza
Copy link
Collaborator

Better to start from a fresh DB.

@easternwawoman
Copy link

easternwawoman commented Aug 16, 2018 via email

@pedrobaeza
Copy link
Collaborator

Well, I'm suggesting a method to try to debug the problem. First, to see if in a fresh DB, there's no problem. If so, then the problem is in the data inside the DB, and you get a way to work on.

@traviswaelbro
Copy link
Contributor

Alternatively, if this is only an issue on your local setup, you should be able to just use Firefox and not have any issue. At least in my experience with this issue, the problem only happens in Chrome.

@easternwawoman
Copy link

easternwawoman commented Aug 16, 2018 via email

@easternwawoman
Copy link

easternwawoman commented Aug 16, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
9.0 Confirmed the bug was confirmed by testers Need information the reports lacks of information
Projects
None yet
Development

No branches or pull requests