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

Wartungsmodus führt zu "Es ist ein Fehler aufgetreten" #176

Closed
srhinow opened this issue Nov 8, 2018 · 13 comments
Closed

Wartungsmodus führt zu "Es ist ein Fehler aufgetreten" #176

srhinow opened this issue Nov 8, 2018 · 13 comments
Labels
Milestone

Comments

@srhinow
Copy link

srhinow commented Nov 8, 2018

Ich habe das Problem von dem geschlossenen Issue contao/core-bundle#1307 auch in Contao 4.6:

Bei mir unter Contao 4.6.7, PHP7.2 tritt das Problem auch auf.
Der letzte Eintrag aus der log-Datei ist folgender:

[2018-11-08 21:13:32] request.CRITICAL: Uncaught PHP Exception RuntimeException: "Error when rendering "http://www.DOMAIN.de/_fragment?_hash=%2FqBeYf5LY3DkpKxI06SLYZn9I13vTAQeKy5ZMNA%2FvzQ%3D&_path=insertTag%3D%257B%257Bua%253A%253Aclass%257D%257D%26_format%3Dhtml%26_locale%3Dde%26_controller%3Dcontao.controller.insert_tags%253ArenderAction&clientCache=0&pageId=17&request=netzwerk-junge-wissenschaft.html" (Status code is 503)." at /var/www/xxx/hostingxxx/httpdocs/contao/vendor/symfony/http-kernel/HttpCache/AbstractSurrogate.php line 99 {"exception":"[object] (RuntimeException(code: 0): Error when rendering \"http://www.DOMAIN.de/_fragment?_hash=%2FqBeYf5LY3DkpKxI06SLYZn9I13vTAQeKy5ZMNA%2FvzQ%3D&_path=insertTag%3D%257B%257Bua%253A%253Aclass%257D%257D%26_format%3Dhtml%26_locale%3Dde%26_controller%3Dcontao.controller.insert_tags%253ArenderAction&clientCache=0&pageId=17&request=netzwerk-junge-wissenschaft.html\" (Status code is 503). at /var/www/xxx/hostingxxx/httpdocs/contao/vendor/symfony/http-kernel/HttpCache/AbstractSurrogate.php:99)"} []

Auch der Quelltext der 500-Fehlerseite sieht noch sehr komisch aus (er fängt in der Klasse an den Fehlercode-Template zu schreiben):

<body id="top" class="<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8" />
        <title>An Error Occurred: Internal Server Error</title>
    </head>
    <body>
        <h1>Oops! An Error Occurred</h1>
        <h2>The server returned a "500 Internal Server Error".</h2>

        <div>
            Something is broken. Please let us know what you were doing when this error occurred.
            We will fix it as soon as possible. Sorry for any inconvenience caused.
        </div>
    </body>
@srhinow
Copy link
Author

srhinow commented Nov 8, 2018

Ich habe gerade noch bemerkt das der 503er nur auftaucht, wenn ich mich im Backend angemeldet habe. Wenn ich nicht angemeldet bin kommt die Status-Seite "Dienst nicht verfügbar" was ja auch richtig ist.
Wenn ich angemeldet bin und der Wartungsmodus aktiv ist, müsste ich doch aber die Website normal sehen können und kein 503er oder nicht?

@fritzmg
Copy link
Contributor

fritzmg commented Nov 9, 2018

Ich habe das auch mal kurz getestet:

  • In allen Contao Versionen wird im Frontend wie erwartet die Maintenance Seite angezeigt, wenn man nicht im Backend eingelogged ist.
  • Contao 3.5.36: Frontend ist im Wartungsmodus erreichbar, wenn man im Backend eingelogged ist.
  • Contao 4.4.28: Frontend ist im Wartungsmodus erreichbar, wenn man im Backend eingelogged ist.
  • Contao 4.6.6: Frontend ist im Wartungsmodus erreichbar, wenn man im Backend eingelogged ist.
  • Contao 4.6.7: Frontend zeigt im Frontend "500 Internal Server Error", wenn man im Backend eingelogged ist. Bei einem Setup mit prepend_locale: true wird außerdem zuerst der Redirect auf den Sprachparameter gemacht, bevor der Fehler auftritt.

@leofeyer leofeyer added the bug label Nov 12, 2018
@leofeyer leofeyer added this to the 4.6.9 milestone Nov 12, 2018
@leofeyer
Copy link
Member

@fritzmg Tritt das Problem in Contao 4.6.8 ebenfalls noch auf?

@srhinow
Copy link
Author

srhinow commented Nov 12, 2018

@leofeyer hab es gerade unter contao 4.6.8 ausprobiert und ja der Fehler kommt dort immer noch.

@fritzmg
Copy link
Contributor

fritzmg commented Nov 12, 2018

Ja, das Problem besteht weiterhin in Contao 4.6.8. Ich kann auch bestätigen, dass es vermutlich in an den esi Sub-Requests liegt. Das HTML markup sieht so aus:

<!DOCTYPE html>
<html lang="en">
<head>

      <meta charset="utf-8">
    <title>Home - c46.local (en)</title>
    <base href="https://c46.local/">

          <meta name="robots" content="index,follow">
      <meta name="description" content="">
      <meta name="generator" content="Contao Open Source CMS">
    
                    <script src="assets/jquery/js/jquery.min.js?v=21bf4be1"></script><script>if (window.location.hash == '#_=_'){ history.replaceState ? history.replaceState(null, null, window.location.href.split('#')[0]) : window.location.hash = '';}</script><link rel="alternate" hreflang="en" href="https://c46.local/en/">
<link rel="alternate" hreflang="de" href="https://c46.local/de/">

          <!--[if lt IE 9]><script src="assets/html5shiv/js/html5shiv-printshiv.min.js?v=3.7.3"></script><![endif]-->
      
</head>
<body id="top" class="<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8" />
        <title>An Error Occurred: Internal Server Error</title>
    </head>
    <body>
        <h1>Oops! An Error Occurred</h1>
        <h2>The server returned a "500 Internal Server Error".</h2>

        <div>
            Something is broken. Please let us know what you were doing when this error occurred.
            We will fix it as soon as possible. Sorry for any inconvenience caused.
        </div>
    </body>
</html>

Der Fehler passiert wohl im {{ua::class}} Insert Tag, bzw. die Exception wird nicht mehr so wie erwartet abgefangen.

/cc @Toflar

@leofeyer
Copy link
Member

Das beschriebene Problem ist nicht dasselbe wie in contao/core-bundle#1307, sondern wie in contao/core-bundle#1370. @aschempp hatte damals einen PR nur für Contao 4.4 gemacht (siehe contao/core-bundle#1476), weil wir aus irgendeinem Grund davon ausgegangen sind, dass das Problem in der 4.5 nicht bestehe.

@contao/developers Haben wir uns da ggf. geirrt?

@aschempp
Copy link
Member

weil wir aus irgendeinem Grund davon ausgegangen sind, dass das Problem in der 4.5 nicht bestehe.

inwiefern? Müsste doch upstream gemergt werden?

@leofeyer
Copy link
Member

Nein, haben wir explizit nicht gemacht: contao/core-bundle#1482

@aschempp
Copy link
Member

Ah, I see. In welchem Scope laufen denn Fragments?

@leofeyer leofeyer modified the milestones: 4.6.9, 4.6.10 Nov 22, 2018
@leofeyer
Copy link
Member

@Toflar /cc

@Toflar
Copy link
Member

Toflar commented Nov 23, 2018

#199 this should fix it.

@leofeyer
Copy link
Member

It does. 👍

leofeyer pushed a commit that referenced this issue Nov 23, 2018
Description
-----------

Fix for #176

Commits
-------

4b87d07 Fixed missing scope on insert tags ESI requests
0deb722 Use a use statement instead of the FQCN
leofeyer pushed a commit to contao/core-bundle that referenced this issue Nov 23, 2018
Description
-----------

Fix for contao/contao#176

Commits
-------

4b87d076 Fixed missing scope on insert tags ESI requests
0deb7222 Use a use statement instead of the FQCN
@leofeyer leofeyer modified the milestones: 4.6.10, 4.6 May 14, 2019
@akroii
Copy link

akroii commented Apr 14, 2020

Ist dieser Fix auf für die Version 4.4.47?
Ich erhalte diese Fehlermeldung bei einer 4.4.47:

[2020-04-14 08:58:46] request.ERROR: Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException: "" at /homepages/12/xxxx/htdocs/contao4-17_10_18/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/EventListener/FragmentListener.php line 90 {"exception":"[object] (Symfony\\Component\\HttpKernel\\Exception\\AccessDeniedHttpException(code: 0):  at /homepages/12/xxx/htdocs/contao4-17_10_18/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/EventListener/FragmentListener.php:90)"} []
[2020-04-14 08:58:46] request.ERROR: Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException: "" at /homepages/12/xxx/htdocs/contao4-17_10_18/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/EventListener/FragmentListener.php line 90 {"exception":"[object] (Symfony\\Component\\HttpKernel\\Exception\\AccessDeniedHttpException(code: 0):  at /homepages/12/xxx/htdocs/contao4-17_10_18/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/EventListener/FragmentListener.php:90)"} []
[2020-04-14 08:58:46] request.CRITICAL: Uncaught PHP Exception RuntimeException: "Error when rendering "https://www.xxx.com/_fragment?_hash=XyvF%2FPB0vtqLiGWIgAHuKbgXdhOoa7dt2bvm8d%2B8VE8%3D&_path=insertTag%3D%257B%257Bua%253A%253Aclass%257D%257D%26_format%3Dhtml%26_locale%3Dde%26_controller%3Dcontao.controller.insert_tags%253ArenderAction&clientCache=86400&pageId=108&request=" (Status code is 403)." at /homepages/12/xxx/htdocs/contao4-17_10_18/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpCache/AbstractSurrogate.php line 99 {"exception":"[object] (RuntimeException(code: 0): Error when rendering \"https://www.xxx.com/_fragment?_hash=XyvF%2FPB0vtqLiGWIgAHuKbgXdhOoa7dt2bvm8d%2B8VE8%3D&_path=insertTag%3D%257B%257Bua%253A%253Aclass%257D%257D%26_format%3Dhtml%26_locale%3Dde%26_controller%3Dcontao.controller.insert_tags%253ArenderAction&clientCache=86400&pageId=108&request=\" (Status code is 403). at /homepages/12/xxx/htdocs/contao4-17_10_18/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpCache/AbstractSurrogate.php:99)"} []

Das Problem lag darin, dass ein unverändertes fe_page.html5 die Body-Klasse: {{ua::class}} beinhaltete. Ich habe das Template angelegt und den InsertTag entfernt. Anschließend funktionierte es. Die Seite war nicht im Wartungsmodus, sondern live.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

6 participants