Upgrade von 4.10.7 -> 6.1 - OutOfMemory Exception

Hallo zusammen,

ich versuche seit ein paar Stunden auf einem 1&1 Webhosting Server die aktuelle Shop-Version zu installieren. Die alte Version ist 4.10.7. Da 1&1 zum Ende des Monats die (kostenfreie) PHP 5.6 Unterstützung einstellt und ich entsprechen auf 7.1 umstellen muss, versuche ich nun den Shop auf eine aktuelle Version upzugraden, da unter PHP 7.1 Fehlermeldungen im Shop entstehen. Nun habe ich mich seit Einführung des Composers lange um Updates gedrückt, nun muss ich ran… Ich konnte den Composer entsprechend installieren und verwenden wie hier geschrieben.

Anschließend habe ich wie in der Anleitung beschrieben den Composer zum Zusammenstellen des Updates verwendet. Allerdings laufe ich hierbei immer in eine OutOfMemory Exception. Wie in der obigen Anleitung von IONOS zu sehen, gibt es in diesem Paket keine Möglichkeit die Memory-Size zu erhöhen. Wie kann ich denn nun das Update installieren?

  • Installing oxid-esales/oxideshop-doctrine-migration-wrapper (v2.1.3): Loading from cache
  • Installing oxid-esales/oxideshop-demodata-installer (v1.1.2): Loading from cache
  • Installing oxid-esales/oxideshop-demodata-ce (v6.0.1): Downloading (connecting…)
    mmap() failed: [12] Cannot allocate memory

mmap() failed: [12] Cannot allocate memory

Fatal error: Out of memory (allocated 607129600) (tried to allocate 14680096 bytes) in phar:///homepages/5/d547360266/htdocs/composer.phar/src/Composer/Util/RemoteFilesystem.php on line 594

Danke für die Hilfe, viele Grüße

Mach so etwas am besten immer in der Entwicklungsumgebung. Ja, ich weiss: Noch mehr neuer Stoff…

Ja das wäre eine Möglichkeit. Hat mich ein wenig abgeschreckt wegen des Zeitaufwands… Muss ich den kompletten Shop lauffähig haben oder reicht es nur den Composer dort zu installieren und mir das Projekt “bauen” zu lassen?

Warum braucht das Skript überhaupt soviele Speicher? 600M sind ja nicht so wenig, vielleicht gäbe es hier für die Zukunft Optimierungspotential?

man könnte versuchen oxid-demodata-ce rauszunehmen, ich weiß sowieso nicht, warum man da Demodaten braucht.

aber vorher führe den Composer-Befehl mit --profile am Ende aus

Habe ich die Möglichkeit die Demodaten auszuschließen?

Hier ist die Ausgabe mit --profile

(uiserver):uXXX:~$ /usr/bin/php7.1-cli composer.phar create-project --no-dev oxid-esales/oxideshop-project my_oxid_eshop_project dev-b-6.1-ce --profile
[129.1MiB/0.90s] Installing oxid-esales/oxideshop-project (dev-b-6.1-ce 39ac38131b8ec38a927353cbd3ba2c93598a54b3)
[129.7MiB/0.91s]   - Installing oxid-esales/oxideshop-project (dev-b-6.1-ce 39ac381): [130.0MiB/0.92s] Cloning 39ac38131b
[130.0MiB/2.39s] Created project in my_oxid_eshop_project
[6.3MiB/6.53s] Loading composer repositories with package information
[6.5MiB/6.60s] Updating dependencies
[557.1MiB/12.48s] Package operations: 58 installs, 0 updates, 0 removals
[557.1MiB/12.49s]   - Installing ocramius/package-versions (1.2.0): [557.1MiB/12.49s] Loading from cache[557.1MiB/12.49s]
[557.1MiB/12.57s]   - Installing symfony/polyfill-ctype (v1.10.0): [557.1MiB/12.57s] Loading from cache[557.1MiB/12.57s]
[557.1MiB/12.63s]   - Installing webmozart/assert (1.4.0): [557.1MiB/12.63s] Loading from cache[557.1MiB/12.63s]
[557.1MiB/12.67s]   - Installing webmozart/path-util (2.3.0): [557.1MiB/12.68s] Loading from cache[557.1MiB/12.68s]
[557.1MiB/12.71s]   - Installing webmozart/glob (4.1.0): [557.1MiB/12.71s] Loading from cache[557.1MiB/12.71s]
[557.1MiB/12.76s]   - Installing symfony/process (v2.8.49): [557.1MiB/12.76s] Loading from cache[557.1MiB/12.76s]
[557.1MiB/12.81s]   - Installing symfony/polyfill-mbstring (v1.10.0): [557.1MiB/12.81s] Loading from cache[557.1MiB/12.81s]
[557.1MiB/12.85s]   - Installing symfony/finder (v2.8.49): [557.1MiB/12.85s] Loading from cache[557.1MiB/12.85s]
[557.1MiB/12.91s]   - Installing symfony/filesystem (v3.4.21): [557.1MiB/12.91s] Loading from cache[557.1MiB/12.91s]
[557.1MiB/12.95s]   - Installing psr/log (1.1.0): [557.1MiB/12.95s] Loading from cache[557.1MiB/12.95s]
[557.1MiB/13.01s]   - Installing symfony/debug (v3.0.9): [557.1MiB/13.01s] Loading from cache[557.1MiB/13.01s]
[557.1MiB/13.07s]   - Installing symfony/console (v2.8.49): [557.1MiB/13.07s] Loading from cache[557.1MiB/13.07s]
[557.1MiB/13.16s]   - Installing smarty/smarty (v2.6.31): [557.1MiB/13.16s] Loading from cache[557.1MiB/13.16s]
[557.1MiB/13.21s]   - Installing seld/phar-utils (1.0.1): [557.1MiB/13.21s] Loading from cache[557.1MiB/13.21s]
[557.1MiB/13.26s]   - Installing seld/jsonlint (1.7.1): [557.1MiB/13.26s] Loading from cache[557.1MiB/13.26s]
[557.1MiB/13.31s]   - Installing justinrainbow/json-schema (5.2.8): [557.1MiB/13.31s] Loading from cache[557.1MiB/13.31s]
[557.1MiB/13.38s]   - Installing composer/xdebug-handler (1.3.1): [557.1MiB/13.38s] Loading from cache[557.1MiB/13.38s]
[557.1MiB/13.44s]   - Installing composer/spdx-licenses (1.5.0): [557.2MiB/13.44s] Loading from cache[557.1MiB/13.44s]
[557.2MiB/13.50s]   - Installing composer/semver (1.4.2): [557.2MiB/13.50s] Loading from cache[557.2MiB/13.50s]
[557.2MiB/13.56s]   - Installing composer/ca-bundle (1.1.3): [557.2MiB/13.56s] Loading from cache[557.2MiB/13.56s]
[557.2MiB/13.61s]   - Installing composer/composer (1.8.0): [557.2MiB/13.61s] Loading from cache[557.2MiB/13.61s]
[557.2MiB/13.71s]   - Installing oxid-esales/oxideshop-facts (v2.3.1): [557.2MiB/13.71s] Loading from cache[557.2MiB/13.71s]
[557.2MiB/13.77s]   - Installing oxid-esales/oxideshop-unified-namespace-generator (v2.0.1): [557.2MiB/13.77s] Loading from cache[557.2MiB/13.77s]
[557.3MiB/13.84s]   - Installing oxid-esales/oxideshop-composer-plugin (v2.0.3): [557.3MiB/13.84s] Loading from cache[557.3MiB/13.84s]
[557.4MiB/13.88s]   - Installing zendframework/zend-eventmanager (3.2.1): [557.4MiB/13.88s] Loading from cache[557.4MiB/13.88s]
[557.4MiB/13.94s]   - Installing zendframework/zend-code (3.1.0): [557.4MiB/13.94s] Loading from cache[557.4MiB/13.94s]
[557.4MiB/14.01s]   - Installing rmccue/requests (v1.7.0): [557.4MiB/14.01s] Loading from cache[557.4MiB/14.01s]
[557.4MiB/14.08s]   - Installing topconcepts/oxid-klarna-6 (v4.2.1): [557.4MiB/14.09s] Loading from cache[557.4MiB/14.09s]
[557.4MiB/14.26s]   - Installing symfony/yaml (v2.8.49): [557.4MiB/14.27s] Loading from cache[557.4MiB/14.27s]
[557.4MiB/14.33s]   - Installing symfony/dependency-injection (v3.1.10): [557.4MiB/14.33s] Loading from cache[557.4MiB/14.33s]
[557.4MiB/14.41s]   - Installing symfony/config (v3.2.14): [557.4MiB/14.41s] Loading from cache[557.4MiB/14.41s]
[557.4MiB/14.48s]   - Installing psr/container (1.0.0): [557.4MiB/14.48s] Loading from cache[557.4MiB/14.48s]
[557.4MiB/14.54s]   - Installing phpmailer/phpmailer (v5.2.27): [557.4MiB/14.54s] Loading from cache[557.4MiB/14.54s]
[557.4MiB/14.61s]   - Installing payone-gmbh/oxid-6 (1.0.10): [557.4MiB/14.62s] Loading from cache[557.4MiB/14.62s]
[557.4MiB/14.76s]   - Installing oxid-esales/wave-theme (v1.0.1): [557.4MiB/14.77s] Loading from cache[557.4MiB/14.77s]
[557.4MiB/14.98s]   - Installing oxid-esales/paypal-module (v5.2.3): [557.4MiB/14.98s] Loading from cache[557.4MiB/14.98s]
[557.4MiB/15.13s]   - Installing oxid-esales/paymorrow-module (v2.0.1): [557.4MiB/15.13s] Loading from cache[557.4MiB/15.13s]
[557.4MiB/15.23s]   - Installing ocramius/proxy-manager (2.0.4): [557.4MiB/15.23s] Loading from cache[557.4MiB/15.23s]
[557.4MiB/15.34s]   - Installing doctrine/cache (v1.6.2): [557.4MiB/15.34s] Loading from cache[557.4MiB/15.34s]
[557.4MiB/15.43s]   - Installing doctrine/lexer (v1.0.1): [557.4MiB/15.43s] Loading from cache[557.4MiB/15.43s]
[557.4MiB/15.51s]   - Installing doctrine/annotations (v1.4.0): [557.4MiB/15.51s] Loading from cache[557.4MiB/15.51s]
[557.4MiB/15.58s]   - Installing doctrine/collections (v1.4.0): [557.4MiB/15.58s] Loading from cache[557.4MiB/15.58s]
[557.4MiB/15.67s]   - Installing doctrine/inflector (v1.2.0): [557.4MiB/15.67s] Loading from cache[557.4MiB/15.67s]
[557.4MiB/15.74s]   - Installing doctrine/common (v2.7.3): [557.4MiB/15.74s] Loading from cache[557.4MiB/15.74s]
[557.4MiB/15.81s]   - Installing doctrine/dbal (v2.5.13): [557.4MiB/15.81s] Loading from cache[557.4MiB/15.81s]
[557.4MiB/15.90s]   - Installing doctrine/migrations (v1.5.0): [557.4MiB/15.90s] Loading from cache[557.4MiB/15.90s]
[557.4MiB/15.96s]   - Installing oxid-esales/oxideshop-doctrine-migration-wrapper (v2.1.3): [557.4MiB/15.97s] Loading from cache[557.4MiB/15.97s]
[557.4MiB/16.03s]   - Installing oxid-esales/oxideshop-demodata-installer (v1.1.2): [557.4MiB/16.03s] Loading from cache[557.4MiB/16.03s]
[557.4MiB/16.09s]   - Installing oxid-esales/oxideshop-demodata-ce (v6.0.1): [557.4MiB/16.09s] Downloading (connecting...)
mmap() failed: [12] Cannot allocate memory

mmap() failed: [12] Cannot allocate memory

Fatal error: Out of memory (allocated 607129600) (tried to allocate 14680096 bytes) in phar:///homepages/5/xx/htdocs/composer.phar/src/Composer/Util/RemoteFilesystem.php on line 594

Auch die Version 4.10.xx ist nach ein paar kleinen Änderungen mit PHP 7.x lauffähig:

Danke @patchwork.de! Das hat geklappt. Ist natürlich keine Lösung für das Update-Problem, aber es nimmt mir wenigstens den Zeitdruck, um eine Lösung zu finden.

Trotzdem wäre es für die Zukunft schön, wenn der Composer auch mit weniger Speicher funktioniert. Ich verstehe nicht, warum er soviel Speicher auf einmal belegen sollte.

nun, das steht ja dort: “[557.1MiB] Package operations: 58 installs”
Alle 58 Bestandteile von OXID werden aus der Datei package.json ausgelesen und in den Speicher geladen. Daher würde es sehr wahrscheinlich helfen all die Bloatware rauszuwerfen.

teste mal das:

php72 -d memory_limit=4024M

Die package.json liegt aber auf dem Update-Server von Oxid, d.h. ich kann das nicht beeinflussen oder?

@Jb123: Danke für den Vorschlag. Ist aber leider nur ein Webhosting-Paket, d.h. das Memory-Limit ist fix. :\

hatte ich bei nem anderne kunden auch mit fixen limit, auf der console sind die limits allerdings dort nicht aktiv gewesen, es kann auch helfen den composer zu aktualisieren