# Media Odner wächst / Console gibt Fehler aus

**URL:** <https://forum.shopware.com/t/media-odner-wachst-console-gibt-fehler-aus/57815>\
**Category:** Allgemein\
**Created:** [1. Februar 2019 um 09:04 UTC](https://forum.shopware.com/t/media-odner-wachst-console-gibt-fehler-aus/57815 "2019-02-01T09:04:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![grennwilli](https://avatars.discourse-cdn.com/v4/letter/g/ed8c4c/32.png) [@grennwilli](https://forum.shopware.com/u/grennwilli)\
**Post date:** [1. Februar 2019 um 09:04 UTC](https://forum.shopware.com/t/media-odner-wachst-console-gibt-fehler-aus/57815/1 "2019-02-01T09:04:03Z")

</div>

Mein Media Order wächst und wächst, 880000 Bilder, habe in der DB aber nur 73000 Einträge.

root@boldkiwi:/var/www/htdocs# php bin/console sw:media:cleanup

## Searching for unused media files.

PHP Warning:&nbsp; preg\_match() expects parameter 2 to be string, array given in /var/www/htdocs/engine/Shopware/Bundle/MediaBundle/Strategy/Md5Strategy.php on line 48  
PHP Notice:&nbsp; Array to string conversion in /var/www/htdocs/engine/Shopware/Bundle/MediaBundle/GarbageCollector.php on line 311  
PHP Notice:&nbsp; Array to string conversion in /var/www/htdocs/engine/Shopware/Bundle/MediaBundle/GarbageCollector.php on line 311  
PHP Notice:&nbsp; Array to string conversion in /var/www/htdocs/engine/Shopware/Bundle/MediaBundle/GarbageCollector.php on line 311  
PHP Notice:&nbsp; Array to string conversion in /var/www/htdocs/engine/Shopware/Bundle/MediaBundle/GarbageCollector.php on line 311  
PHP Notice:&nbsp; Array to string conversion in /var/www/htdocs/engine/Shopware/Bundle/MediaBundle/GarbageCollector.php on line 311  
PHP Notice:&nbsp; Array to string conversion in /var/www/htdocs/engine/Shopware/Bundle/MediaBundle/GarbageCollector.php on line 311  
PHP Notice:&nbsp; Array to string conversion in /var/www/htdocs/engine/Shopware/Bundle/MediaBundle/GarbageCollector.php on line 311  
PHP Notice:&nbsp; Array to string conversion in /var/www/htdocs/engine/Shopware/Bundle/MediaBundle/GarbageCollector.php on line 311  
PHP Notice:&nbsp; Array to string conversion in /var/www/htdocs/engine/Shopware/Bundle/MediaBundle/GarbageCollector.php on line 311  
PHP Notice:&nbsp; Array to string conversion in /var/www/htdocs/engine/Shopware/Bundle/MediaBundle/GarbageCollector.php on line 311  
PHP Notice:&nbsp; Array to string conversion in /var/www/htdocs/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php on line 1489  
&nbsp;21 unused item(s) found.

&nbsp;[OK] 21 item(s) in recycle bin.

&nbsp;

&nbsp;

&nbsp;

&nbsp;

htdocs/bin/console sw:thumbnail:cleanup

&nbsp;// Searching for all media files in your filesystem. This might take some time,  
&nbsp;// depending on the number of media files you have.

&nbsp;

&nbsp;Scanned: 880365 files  
&nbsp;Elapsed:&nbsp;&nbsp; 1 hr

&nbsp;[OK] No orphaned thumbnails found.

&nbsp;

&nbsp;

&nbsp;

&nbsp;php -ver  
PHP 7.0.30-0+deb9u1 (cli) (built: Jun 14 2018 13:50:25) ( NTS )  
Copyright © 1997-2017 The PHP Group  
Zend Engine v3.0.0, Copyright © 1998-2017 Zend Technologies  
&nbsp;&nbsp;&nbsp; with Zend OPcache v7.0.30-0+deb9u1, Copyright © 1999-2017, by Zend Technologies  
&nbsp;

&nbsp;

&nbsp;

Wie kann ich das verhindern, bzw cleanen?

&nbsp;

&nbsp;

---

<div class="post-metadata">

**Author:** ![AndreHerking](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/andreherking/32/7839_2.png) [@AndreHerking](https://forum.shopware.com/u/AndreHerking)\
**Post date:** [2. Februar 2019 um 16:55 UTC](https://forum.shopware.com/t/media-odner-wachst-console-gibt-fehler-aus/57815/2 "2019-02-02T16:55:35Z")

</div>

Da es Notices / Warnings seitens PHP sind, sehe ich hier erstmal keinen negativen Einfluss für dem Garbage Collector. Grundsätzlich gilt hier aber die Ursache für die Neuanlage der Bilder zu finden. Wird der Shop mittels Schnittstelle befüllt? Unter Umständen liegt diese die Bilder neu an. Wichtig ist, dass der Garbage Collector nur die Bilder löschen kann, die auch in der Datenbank (s\_media) angegeben sind. Bedenke auch, dass Shopware für jedes Bild Thumbnails anlegt (drei Größen im Standard, mal zwei sofern High-Res Thumbnails aktiviert sind).&nbsp;

LG Andre
