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

Invalid CSS causes memory leak and CP becomes inaccessible #12

Closed
chasegiunta opened this issue Apr 11, 2020 · 5 comments
Closed

Invalid CSS causes memory leak and CP becomes inaccessible #12

chasegiunta opened this issue Apr 11, 2020 · 5 comments
Labels

Comments

@chasegiunta
Copy link

So, for funsies, go ahead and place this within the "additional CSS" field...

#details-container {
  flex: 0 0 200px;
  width: 200px;

Doing so will cause the control panel to become completely inaccessible you'll hit your max memory limit pretty fast. Why? I have no idea. The settings are saved in the project config, so some weird parse or escaping issue could be the cause. I'm unsure, but it may be worth doing some sort of syntax checker before save.

To get the control to be unbroken you'll need to go into your projectconfig table in your database, find the row with the plugins.cp-css.settings.additionalCss path, and clear it out to "". Then, you can run the ./craft clear-caches/all.

@lindseydiloreto
Copy link
Collaborator

What the actual... ? That is utterly peculiar. 🤔

Though honestly... isn't that really a Craft bug? CP CSS is just saving a normal setting, it's Craft that's jamming it into the project config.

We might want to run this by someone at P&T before we dig too much further.

@chasegiunta
Copy link
Author

@lindseydiloreto Maybe, but I'm unsure if it's actually the project config that's causing the issue, displaying of the css, or something in between.

You'd think if it was a project config issue, even the frontend wouldn't load, but the frontend loads just fine. It's only the Control Panel where the memory leak happens. That could be because it's only the control panel where that setting is being read...? I'll raise it in an issue within the cms repo.

@lindseydiloreto
Copy link
Collaborator

Allowed memory size of 2147483648 bytes exhausted (tried to allocate 167772176 bytes)

Something is definitely getting caught in a loop.

@lindseydiloreto
Copy link
Collaborator

It looks like this can be traced back to a minification plugin that Craft is using. We can consolidate this into the related Craft CMS thread, since the issue is more likely to be on that side.

@lindseydiloreto
Copy link
Collaborator

lindseydiloreto commented Apr 14, 2020

Per Brandon Kelly, this is fixed for the next release of Craft...

craftcms/cms#5912 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants