Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Pete McQuain 4 posts 24 karma points
    Sep 24, 2020 @ 18:21
    Pete McQuain
    0

    404 Not Found when selecting a stylesheet

    Umbraco v8.6.4

    Whenever I try to view a stylesheet from the backoffice, I get the following error message at the bottom of the screen:

    Request error: The URL returned a 404 (not found): /umbraco/backoffice/UmbracoApi/CodeFile/PostExtractStylesheetRules error message

    This only seems to happen on certain POSTs, but not all.

    network activity

    The strange thing is that I can create a new style sheet and save it and then view it... enter image description here enter image description here

    And of course, like most good errors, this only happens when I have deployed the site to one of my servers, it does not happen locally.

    Any thoughts? What additional information would be helpful?

    Thanks! Pete

  • Nik 1593 posts 7151 karma points MVP 6x c-trib
    Sep 24, 2020 @ 20:47
    Nik
    0

    Hey Pete,

    Just a thought, the style sheet you created locally, did you include it in your deployment? (Check the server to make sure it's there). The error could be legit, in that it's 404'ing because the file is missing.

    Assuming you are using a Visual Studio project and some sort of deployment pipeline/publish process (other than a manual copy and paste), if the file isn't included in the project it's unlikely to have been deployed.

    Cheers

    Nik

  • Pete McQuain 4 posts 24 karma points
    Sep 24, 2020 @ 20:50
    Pete McQuain
    0

    Yes, the files are physically there on the server.

  • Amir Khan 1282 posts 2739 karma points
    Sep 24, 2020 @ 21:02
    Amir Khan
    0

    I've had issues in the with viewing stylesheets in the past where the file permissions were wacky on a production server and had to reset them to make sure the app pool user had the correct permissions on the entire site.

  • Pete McQuain 4 posts 24 karma points
    Sep 25, 2020 @ 11:34
    Pete McQuain
    0

    I double-checked the permissions and inherited permissions and they are correct, good thought though.

    I can see through Chrome's dev tools that the XHR GET request returns the contents of the CSS file, then tries to POST them back to PostExtractStylesheetRules - that's what generates the 404, although based on some comments in the source code there might be a filter in place that's converting 500's to 404's

    If I go through the process of creating a new CSS via the Back Office, it does get created and I can view it, and I can see the POST to the same endpoint succeeding with a 200.

    Very strange :/

    edit: I just noticed in Chrome I get an additional error in the console after the 404 error:

    Possibly unhandled rejection: {"errorMsg":"Failed to extract style sheet rules","data":{"Log-Id":"174c50607db-1addd007","Request Time":"2020-09-25 11:29:00 GMT","Error":"The specified URL cannot be found "},"status":404}
    

    edit part 2: I was watching the IIS logs and the POST that returns a 404 doesn't show up in the log. When I create and save an empty one, that POST does show up. I am perplexed.

  • Pete McQuain 4 posts 24 karma points
    Sep 25, 2020 @ 15:41
    Pete McQuain
    0

    Fixed: Barracuda WAF rules limit JSON value size to very small values by default. Bypass WAF for edits, everything works fine.

Please Sign in or register to post replies

Write your reply to:

Draft