Contao-Camp 2024
Ergebnis 1 bis 15 von 15

Thema: Fehler nach Cache Neuerstellung

  1. #1
    Contao-Nutzer
    Registriert seit
    23.05.2018.
    Beiträge
    88

    Standard Fehler nach Cache Neuerstellung

    Hallo zusammen,

    wenn ich den Anwendungscache über den CM neu erstelle, erhalte ich bei vendor/bin/contao-console cache:warmup folgende Fehlermeldung:

    In MemoryTokenStorage.php line 104:
    MemoryTokenStorage must not be accessed before it was initialized.

    Jetzt funktioniert die Website leider nicht mehr.
    Was kann ich machen, dass das ich den Cache neu erstellen kann?
    Danke...

  2. #2
    Community-Moderator
    Wandelndes Contao-Lexikon
    Avatar von Spooky
    Registriert seit
    12.04.2012.
    Ort
    Scotland
    Beiträge
    33.883
    Partner-ID
    10107

    Standard

    Jemand im Slack hatte den selben Fehler, weil im Konstruktor eines Services schon das Contao Legacy Framework initialisiert wurde. Hast du so etwas evt. selbst auch programmiert - oder evt. eine Extension installiert, die das macht?
    » sponsor me via GitHub or PayPal or Revolut

  3. #3
    Contao-Nutzer
    Registriert seit
    23.05.2018.
    Beiträge
    88

    Standard

    Danke für die rasche Rückmeldung.
    Ich habe nichts zusätzliches programmiert und das System nochmal komplett neu aufgesetzt.
    Domaintechnik ist der Hoster, da ist unter Software Contao als Auswahl zur Installation möglich.
    Allerdings habe ich das System manuell per CM installiert.

  4. #4
    Contao-Nutzer
    Registriert seit
    23.05.2018.
    Beiträge
    88

    Standard

    Habe jetzt einfach einzeln folgendes geleert:
    Cache der Produktionssumgebung leeren
    Cache der Entwicklungsumgebung leeren

    So funktoniert es.

    Passt das so? Oder was ist der Unterschied zu Prod.-Cache erneuern?

  5. #5
    Community-Moderator
    Wandelndes Contao-Lexikon
    Avatar von Spooky
    Registriert seit
    12.04.2012.
    Ort
    Scotland
    Beiträge
    33.883
    Partner-ID
    10107

    Standard

    Wenn du den Produktions Cache jetzt nur geleert hast, solltest du ihn unbedingt auch wieder neu aufbauen lassen, andernfalls hast du reduzierte Performance, da der interne Contao Cache dann nicht vorhanden ist.
    » sponsor me via GitHub or PayPal or Revolut

  6. #6
    Contao-Nutzer
    Registriert seit
    23.05.2018.
    Beiträge
    88

    Standard

    Wenn ich "Cache der Produktionssumgebung leeren" im CM klicke, steht im Fenster das sich öffnet:
    Contao-Cache neu erstellen

    rm -rf var/cache/prod
    vendor/bin/contao-console cache:clear --no-warmup


    Reicht das?

  7. #7
    Community-Moderator
    Wandelndes Contao-Lexikon
    Avatar von Spooky
    Registriert seit
    12.04.2012.
    Ort
    Scotland
    Beiträge
    33.883
    Partner-ID
    10107

    Standard

    Nein, insgeamt muss folgendes ausgeführt werden:

    Code:
    vendor/bin/contao-console cache:clear --no-warmup
    vendor/bin/contao-console cache:warmup
    » sponsor me via GitHub or PayPal or Revolut

  8. #8
    Contao-Nutzer
    Registriert seit
    23.05.2018.
    Beiträge
    88

    Standard

    Bei
    vendor/bin/contao-console cache:warmup

    kommt aber leider folgende Fehlermeldung:

    In MemoryTokenStorage.php line 104:
    MemoryTokenStorage must not be accessed before it was initialized.


    Was soll ich machen?

  9. #9
    Community-Moderator
    Wandelndes Contao-Lexikon
    Avatar von Spooky
    Registriert seit
    12.04.2012.
    Ort
    Scotland
    Beiträge
    33.883
    Partner-ID
    10107

    Standard

    Hast du SSH Zugriff?
    » sponsor me via GitHub or PayPal or Revolut

  10. #10
    Contao-Nutzer
    Registriert seit
    30.12.2010.
    Ort
    Hainfeld
    Beiträge
    46
    Partner-ID
    8829

    Standard

    Hallo zusammen,

    ich muss das Thema leider noch einmal aufwärmen.

    Leeren beider (Produktionssumgebung und Entwicklungsumgebung) Caches hat leider nicht geholfen.

    Ich habe nichts zusätzlich installiert, ist eine leere Grundinstallation von Contao. Ich kann auch keine Pakete installieren.


    Contao Manager 1.4.8
    Contao Version 4.9.21
    SSL für Domain ist aktiv


    Code:
    In ScriptHandler.php line 89:
                                                                                   
      An error occurred while executing the "cache:warmup" command: 11:12:05 CRITICAL  [console] Error thrown while running command "cache:warmup --env=prod  
      ". Message: "MemoryTokenStorage must not be accessed before it was initialized." ["exception" => LogicException { …},"command" => "cache:warmup --env=  
      prod","message" => "MemoryTokenStorage must not be accessed before it was initialized."]                                                                
                                                                                   
      In MemoryTokenStorage.php line 104:                                          
        MemoryTokenStorage must not be accessed before it was initialized.

    die gesamte Konsolenausgabe im Anhang

    Code:
    > Resolving dependencies using Composer Cloud v3.2.0
    !!! Current server is sponsored by: Contao Association !!!
    
    
    [6.7MiB/0.18s] Loading composer repositories with package information
    [55.5MiB/1.85s] Updating dependencies
    [127.8MiB/50.72s] Nothing to modify in lock file
    [77.0MiB/50.77s] Package patchwork/utf8 is abandoned, you should avoid using it. Use symfony/polyfill-mbstring or symfony/string instead.
    [77.0MiB/50.77s] Package phpunit/php-token-stream is abandoned, you should avoid using it. No replacement was suggested.
    [77.5MiB/50.77s] Memory usage: 77.47MB (peak: 1442.03MB), time: 50.78s.
    [77.5MiB/50.78s] Finished Composer Cloud resolving.
    
    
    # Job ID 1JnsQLqRWrU5vcMrMBSklvhsVJYnvPisxf5wMhAVkjxgaPZXEh62CANz1u0OFKD7wPxorRNQgntKfrTRp1hKHxVNikYYcjeOngBzA5 completed in 62 seconds
    # Memory usage: 77.47MB (peak: 1442.03MB), time: 50.78s.
    
    $ /bin/php80 -q -dmax_execution_time=0 -dmemory_limit=-1 -dallow_url_fopen=1 -ddisable_functions= -ddate.timezone=Europe/Vienna /var/home/haginvelt-golf_at/www/c4golf/web/contao-manager.phar.php composer install --prefer-dist --no-dev --no-progress --no-ansi --no-interaction --optimize-autoloader
    
    Installing dependencies from lock file
    Verifying lock file contents can be installed on current platform.
    Nothing to install, update or remove
    Package patchwork/utf8 is abandoned, you should avoid using it. Use symfony/polyfill-mbstring or symfony/string instead.
    Package phpunit/php-token-stream is abandoned, you should avoid using it. No replacement was suggested.
    Generating optimized autoload files
    composer/package-versions-deprecated: Generating version class...
    composer/package-versions-deprecated: ...done generating version class
    87 packages you are using are looking for funding.
    Use the `composer fund` command to find out more!
    contao/manager-plugin: Generating plugin class...
    contao/manager-plugin: ...done generating plugin class
    > Contao\ManagerBundle\Composer\ScriptHandler::initializeApplication
    Added the web/app.php file.
    Added the web/preview.php file.
    Added the web/index.php file.
    X-Powered-By: PHP/8.0.12
    Content-type: text/html; charset=UTF-8
    
    
     // Clearing the cache for the prod environment with debug                      
     // false                                                                       
    
     [OK] Cache for the "prod" environment (debug=false) was successfully cleared.  
    
    X-Powered-By: PHP/8.0.12
    Content-type: text/html; charset=UTF-8
    
    
     // Clearing the cache for the dev environment with debug                       
     // true                                                                        
    
     [OK] Cache for the "dev" environment (debug=true) was successfully cleared.    
    
    2021-10-20T11:12:01+02:00 [info] User Deprecated: The "Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand" class is deprecated since Symfony 4.2, use "Symfony\Component\Console\Command\Command" with dependency injection instead.
    X-Powered-By: PHP/8.0.12
    Content-type: text/html; charset=UTF-8
    
    
     // Warming up the cache for the prod environment with debug                    
     // false                                                                       
    
    11:12:05 CRITICAL  [console] Error thrown while running command "cache:warmup --env=prod". Message: "MemoryTokenStorage must not be accessed before it was initialized." ["exception" => LogicException { …},"command" => "cache:warmup --env=prod","message" => "MemoryTokenStorage must not be accessed before it was initialized."]
    
    In MemoryTokenStorage.php line 104:
                                                                          
      MemoryTokenStorage must not be accessed before it was initialized.  
                                                                          
    
    cache:warmup [--no-optional-warmers] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--] 
    
    X-Powered-By: PHP/8.0.12
    Content-type: text/html; charset=UTF-8
    
    Script Contao\ManagerBundle\Composer\ScriptHandler::initializeApplication handling the post-install-cmd event terminated with an exception
    
    In ScriptHandler.php line 89:
                                                                                   
      An error occurred while executing the "cache:warmup" command: 11:12:05 CRIT  
      ICAL  [console] Error thrown while running command "cache:warmup --env=prod  
      ". Message: "MemoryTokenStorage must not be accessed before it was initiali  
      zed." ["exception" => LogicException { …},"command" => "cache:warmup --env=  
      prod","message" => "MemoryTokenStorage must not be accessed before it was i  
      nitialized."]                                                                
                                                                                   
      In MemoryTokenStorage.php line 104:                                          
                                                                                   
        MemoryTokenStorage must not be accessed before it was initialized.         
                                                                                   
                                                                                   
      cache:warmup [--no-optional-warmers] [-h|--help] [-q|--quiet] [-v|vv|vvv|--  
      verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--en  
      v ENV] [--]                                                         
                                                                                   
    
    install [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--dry-run] [--dev] [--no-suggest] [--no-dev] [--no-autoloader] [--no-scripts] [--no-progress] [--no-install] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--] [...]
    
    
    # Process terminated with exit code 1
    # Result: General error

  11. #11
    Community-Moderator
    Wandelndes Contao-Lexikon
    Avatar von Spooky
    Registriert seit
    12.04.2012.
    Ort
    Scotland
    Beiträge
    33.883
    Partner-ID
    10107

    Standard

    Poste mal die composer.json
    » sponsor me via GitHub or PayPal or Revolut

  12. #12
    Contao-Nutzer
    Registriert seit
    30.12.2010.
    Ort
    Hainfeld
    Beiträge
    46
    Partner-ID
    8829

    Standard

    hier meine composer.json

    Code:
    {
        "type": "project",
        "require": {
            "contao/conflicts": "*@dev",
            "contao/manager-bundle": "4.9.*",
            "contao/calendar-bundle": "4.9.*",
            "contao/comments-bundle": "4.9.*",
            "contao/faq-bundle": "4.9.*",
            "contao/listing-bundle": "4.9.*",
            "contao/news-bundle": "4.9.*",
            "contao/newsletter-bundle": "4.9.*"
        },
        "extra": {
            "contao-component-dir": "assets"
        },
        "scripts": {
            "post-install-cmd": [
                "Contao\\ManagerBundle\\Composer\\ScriptHandler::initializeApplication"
            ],
            "post-update-cmd": [
                "Contao\\ManagerBundle\\Composer\\ScriptHandler::initializeApplication"
            ]
        }
    }

  13. #13
    Contao-Nutzer
    Registriert seit
    30.12.2010.
    Ort
    Hainfeld
    Beiträge
    46
    Partner-ID
    8829

    Standard

    Hallo zusammen,

    einen weiteren Tag der Fehlersuche...
    sieht mir sehr verdächtig nach dem hier aus: https://github.com/contao/contao/pull/3576
    einzig, das ist nur in 4.12 gefixt und nicht in 4.9.

    Bin ich der Einzige mit diesem Fehler?

    Update:
    habe mir nun bei uberspace einen space erstellt und dort eine V 4.9.22 installiert und siehe da, es läuft.
    zurück bei meinem eigentlichen Hoster (domaintechnik) leere V 4.9.22 geht nicht, langsam macht es echt keinen Spaß mehr...


    lg
    Andreas
    Geändert von arillus.at (21.10.2021 um 18:22 Uhr)

  14. #14
    Community-Moderator
    Wandelndes Contao-Lexikon
    Avatar von Spooky
    Registriert seit
    12.04.2012.
    Ort
    Scotland
    Beiträge
    33.883
    Partner-ID
    10107

    Standard

    Hast du SSH Zugriff?
    » sponsor me via GitHub or PayPal or Revolut

  15. #15
    Contao-Nutzer
    Registriert seit
    30.12.2010.
    Ort
    Hainfeld
    Beiträge
    46
    Partner-ID
    8829

    Standard

    leider nein, hab aber die Möglichkeit, dem Hoster bescheid zu geben.
    Gibt es eine Möglichkeit, den Fehler irgendwie einzugrenzen?

    UPDATE: 21.10.21. 21:05
    Ich glaube den Fehler gefunden zu haben, ich habe vom Hoster den Hinweis bekommen, PHP 8.0 für CLI Anwendungen zu verwenden.
    nachdem ich den Pfad dahingehend geändert habe, hat das update und die Installation eines Paketes problemlos funktioniert.

    lg
    Andreas
    Geändert von arillus.at (21.10.2021 um 21:05 Uhr)

Aktive Benutzer

Aktive Benutzer

Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1)

Lesezeichen

Lesezeichen

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
  •