Völlig ratlos: Kein Logo mehr bei Rechnungen nach Migration -Image not found or type unknown

Hallo an Alle,
ich probiere jetzt sicher schon 6-8 Stunden daran rum das Logo im Rechnungskopf zu integrieren. Wir haben einen Shopware 5 Shop migriert und auf der Subdomain lief noch alles bestens - das Logo war da.

Dann sind wir live gegangen und haben den 6er Migrationsshop auf die Hauptdomain geswitcht. Seitdem wird keine Rechnung mehr mit Logo erstellt. Es erscheint nur ein Kästchen oben links mit:

Image not found or type unknown

Was ich schon probiert habe:

  • Anderes Dateiformat der Logos
  • .htaccess Schutz überprüft
  • allow_url_fopen ist aktiviert
  • Ich habe in die logo.html.twig schon mal den absoluten Pfad gesetzt - ohne Erfolg
  • in der etc/hosts den Localhost eingetragen

Das sind eigentlich alle Lösungsvorschläge aus dem Forum. Ich bin mit meinem Latein am Ende und verstehe die Welt nicht mehr. Hat jemand noch einen TIpp?

kweb

Hallo, ggf. ist der Bildpfad falsch. Oder du guckst mal in den Einstellungen der Dokumente und weist das Logo dort einmal neu zu.

Hi, das habe ich natürlich auch schon gemacht - ohne Erfolg.

Hattest Du in den Einstellungen „Kopfzeile anzeigen“ angehakt?

Ja, Kopfzeile ist aktiv.

Immer beachten, dass die PDF Lib in SW5 eine anderen als in SW6 ist (5 = mPDF, 6 = dompdf).
Welches Format hat denn das Logo ? Unter 6 funktioniert am besten PNG oder JPEG.

Wenn das Logo als URL eingebunden ist, gibt es evtl. SW6 einen neuen Pfad als früher, oder die Dateisystem-Rechte passen nicht.

Ich würde erstmal in der .env auf „dev“ schalten, normalerweise landen diese Probleme in der der Log Datei.

LG

Beim Logo habe ich alle möglichen Formate verwendet von JPG, bis JPEG, bis PNG. Man darf auch nicht vergessen, dass es ja in der Migrationsumgebung funktioniert hat. Ich habe mal auf dev gesetzt, PDF erstellt und direkt nochmal die Log ausgelesen. Ich kann da jetzt nichts themenrelevantes finden. Vielleicht sieht jemand was?

[2023-09-25T06:47:28.241432+00:00] request.INFO: Matched route "api.notification.message". {"route":"api.notification.message","route_parameters":{"_route":"api.notification.message","_routeScope":["api"],"_controller":"Shopware\\Administration\\Controller\\NotificationController::fetchNotification"},"request_uri":"https://www.xxxxxx.de/api/notification/message?latestTimestamp=2023-09-20%2010%3A04%3A11.973&limit=5","method":"GET"} []
[2023-09-25T06:47:31.063279+00:00] request.INFO: Matched route "api.notification.message". {"route":"api.notification.message","route_parameters":{"_route":"api.notification.message","_routeScope":["api"],"_controller":"Shopware\\Administration\\Controller\\NotificationController::fetchNotification"},"request_uri":"https://www.xxxxxx.de/api/notification/message?latestTimestamp=2023-09-20%2010%3A04%3A11.973&limit=5","method":"GET"} []
[2023-09-25T06:47:33.232811+00:00] request.INFO: Matched route "api.notification.message". {"route":"api.notification.message","route_parameters":{"_route":"api.notification.message","_routeScope":["api"],"_controller":"Shopware\\Administration\\Controller\\NotificationController::fetchNotification"},"request_uri":"https://www.xxxxxx.de/api/notification/message?latestTimestamp=2023-09-20%2010%3A04%3A11.973&limit=5","method":"GET"} []
[2023-09-25T06:47:33.502858+00:00] request.INFO: Matched route "frontend.detail.page". {"route":"frontend.detail.page","route_parameters":{"_route":"frontend.detail.page","_routeScope":["storefront"],"_httpCache":true,"_controller":"Shopware\\Storefront\\Controller\\ProductController::index","productId":"01899239242c70868dde02c87a621371"},"request_uri":"https://www.xxxxxx.de/detail/01899239242c70868dde02c87a621371","method":"GET"} []
[2023-09-25T06:47:33.586959+00:00] app.INFO: #1 Rule detection: Cart >= 0 (Payment) with priority 100 (id: 018991f534c272c1a6d940e45c1044cf) [] []
[2023-09-25T06:47:33.587025+00:00] app.INFO: #2 Rule detection: Cart >= 0 with priority 100 (id: 018991f534c97342970523bb6825cfb1) [] []
[2023-09-25T06:47:33.587043+00:00] app.INFO: #3 Rule detection: Always valid (Default) with priority 100 (id: 018991f5624e7353a159f10da6d26752) [] []
[2023-09-25T06:47:33.587057+00:00] app.INFO: #4 Rule detection: GLS Express with priority 100 (id: 0189923a52b670ab899ffbe52b1c4cdc) [] []
[2023-09-25T06:47:33.587069+00:00] app.INFO: #5 Rule detection: Deutschland with priority 1 (id: 075908f37e104233bf1f97fa282054d9) [] []
[2023-09-25T06:47:33.587080+00:00] app.INFO: #6 Rule detection: Alle Kunden with priority 1 (id: 2b41ca82ecef4564bd304f8921039c5e) [] []
[2023-09-25T06:47:33.587092+00:00] app.INFO: #7 Rule detection: Kunden Deutschland with priority 1 (id: 5842aa2648ff4f538918cb0045d328b5) [] []
[2023-09-25T06:47:33.587103+00:00] app.INFO: #8 Rule detection: AmazonPayAvailabilityRule with priority 1 (id: e44e6782c64247b796b891cf25ae38f7) [] []
[2023-09-25T06:47:33.587115+00:00] app.INFO: #9 Rule detection: Shopkunden with priority 0 (id: 018992390b8973a18d61775b9a423be7) [] []
[2023-09-25T06:47:33.587126+00:00] app.INFO: #10 Rule detection: Sales channel: schäfer sport with priority 0 (id: 0189923a52b27089896851daa5ef3f77) [] []
[2023-09-25T06:47:33.587137+00:00] app.INFO: #11 Rule detection: Promotion customer rule: Floorball Basics with priority 0 (id: 0189923cc049736484e4a9051ec2d342) [] []
[2023-09-25T06:47:33.587149+00:00] app.INFO: #12 Rule detection: Promotion customer rule: 5 Euro Gutschein with priority 0 (id: 0189923cc06770d7ba1ae8576ecb8299) [] []
[2023-09-25T06:47:33.587160+00:00] app.INFO: #13 Rule detection: Promotion customer rule: Floorball Basics  with priority 0 (id: 0189923cc1537294890a1bc1fbf4857a) [] []
[2023-09-25T06:47:36.076526+00:00] request.INFO: Matched route "api.notification.message". {"route":"api.notification.message","route_parameters":{"_route":"api.notification.message","_routeScope":["api"],"_controller":"Shopware\\Administration\\Controller\\NotificationController::fetchNotification"},"request_uri":"https://www.xxxxxx.de/api/notification/message?latestTimestamp=2023-09-20%2010%3A04%3A11.973&limit=5","method":"GET"} []
[2023-09-25T06:47:37.198414+00:00] request.INFO: Matched route "api.document.search-ids". {"route":"api.document.search-ids","route_parameters":{"_route":"api.document.search-ids","_controller":"Shopware\\Core\\Framework\\Api\\Controller\\ApiController::searchIds","entityName":"document","_routeScope":["api"],"path":""},"request_uri":"https://www.xxxxxx.de/api/search-ids/document","method":"POST"} []
[2023-09-25T06:47:37.391133+00:00] request.INFO: Matched route "api.document_type.search". {"route":"api.document_type.search","route_parameters":{"_route":"api.document_type.search","_controller":"Shopware\\Core\\Framework\\Api\\Controller\\ApiController::search","entityName":"document-type","_routeScope":["api"],"path":""},"request_uri":"https://www.xxxxxx.de/api/search/document-type","method":"POST"} []
[2023-09-25T06:47:38.192333+00:00] request.INFO: Matched route "api.notification.message". {"route":"api.notification.message","route_parameters":{"_route":"api.notification.message","_routeScope":["api"],"_controller":"Shopware\\Administration\\Controller\\NotificationController::fetchNotification"},"request_uri":"https://www.xxxxxx.de/api/notification/message?latestTimestamp=2023-09-20%2010%3A04%3A11.973&limit=5","method":"GET"} []
[2023-09-25T06:47:38.653728+00:00] request.INFO: Matched route "api.action.message-queue.consume". {"route":"api.action.message-queue.consume","route_parameters":{"_route":"api.action.message-queue.consume","_routeScope":["api"],"_controller":"Shopware\\Core\\Framework\\MessageQueue\\Api\\ConsumeMessagesController::consumeMessages"},"request_uri":"https://www.xxxxxx.de/api/_action/message-queue/consume","method":"POST"} []
[2023-09-25T06:47:38.665383+00:00] lock.DEBUG: Successfully acquired the "message_queue_consume_async" lock. {"resource":{"Symfony\\Component\\Lock\\Key":"message_queue_consume_async"}} []
[2023-09-25T06:47:38.665477+00:00] lock.DEBUG: Expiration defined for "message_queue_consume_async" lock for "300" seconds. {"resource":{"Symfony\\Component\\Lock\\Key":"message_queue_consume_async"},"ttl":300.0} []
[2023-09-25T06:47:38.676187+00:00] lock.DEBUG: Successfully released the "message_queue_consume_async" lock. {"resource":{"Symfony\\Component\\Lock\\Key":"message_queue_consume_async"}} []
[2023-09-25T06:47:39.554492+00:00] request.INFO: Matched route "api.action.number-range.reserve". {"route":"api.action.number-range.reserve","route_parameters":{"_route":"api.action.number-range.reserve","saleschannel":"01899239047272b19ec2e09622211138","_routeScope":["api"],"_controller":"Shopware\\Core\\System\\NumberRange\\Api\\NumberRangeController::reserve","type":"document_invoice"},"request_uri":"https://www.xxxxxx.de/api/_action/number-range/reserve/document_invoice/01899239047272b19ec2e09622211138?preview=true","method":"GET"} []
[2023-09-25T06:47:39.575438+00:00] request.INFO: Matched route "api.action.number-range.reserve". {"route":"api.action.number-range.reserve","route_parameters":{"_route":"api.action.number-range.reserve","saleschannel":"01899239047272b19ec2e09622211138","_routeScope":["api"],"_controller":"Shopware\\Core\\System\\NumberRange\\Api\\NumberRangeController::reserve","type":"document_invoice"},"request_uri":"https://www.xxxxxx.de/api/_action/number-range/reserve/document_invoice/01899239047272b19ec2e09622211138?preview=true","method":"GET"} []
[2023-09-25T06:47:40.889686+00:00] request.INFO: Matched route "api.action.number-range.reserve". {"route":"api.action.number-range.reserve","route_parameters":{"_route":"api.action.number-range.reserve","saleschannel":"01899239047272b19ec2e09622211138","_routeScope":["api"],"_controller":"Shopware\\Core\\System\\NumberRange\\Api\\NumberRangeController::reserve","type":"document_invoice"},"request_uri":"https://www.xxxxxx.de/api/_action/number-range/reserve/document_invoice/01899239047272b19ec2e09622211138?preview=false","method":"GET"} []
[2023-09-25T06:47:41.151198+00:00] request.INFO: Matched route "api.action.document.bulk.create". {"route":"api.action.document.bulk.create","route_parameters":{"_route":"api.action.document.bulk.create","_routeScope":["api"],"_acl":["document:create"],"_controller":"Shopware\\Core\\Checkout\\Document\\DocumentGeneratorController::createDocuments","documentTypeName":"invoice"},"request_uri":"https://www.xxxxxx.de/api/_action/order/document/invoice/create","method":"POST"} []
[2023-09-25T06:47:41.160969+00:00] request.INFO: Matched route "api.notification.message". {"route":"api.notification.message","route_parameters":{"_route":"api.notification.message","_routeScope":["api"],"_controller":"Shopware\\Administration\\Controller\\NotificationController::fetchNotification"},"request_uri":"https://www.xxxxxx.de/api/notification/message?latestTimestamp=2023-09-20%2010%3A04%3A11.973&limit=5","method":"GET"} []
[2023-09-25T06:47:41.317654+00:00] php.INFO: User Deprecated: The "Shopware\Core\Framework\Webhook\Hookable\HookableEntityWrittenEvent::getWebhookPayload()" method will require a new "AppEntity|null $app" argument in the next major version of its interface "Shopware\Core\Framework\Webhook\Hookable", not defining it is deprecated. {"exception":"[object] (ErrorException(code: 0): User Deprecated: The \"Shopware\\Core\\Framework\\Webhook\\Hookable\\HookableEntityWrittenEvent::getWebhookPayload()\" method will require a new \"AppEntity|null $app\" argument in the next major version of its interface \"Shopware\\Core\\Framework\\Webhook\\Hookable\", not defining it is deprecated. at /www/htdocs/w0173bfc/xxxxxxshop.de/sw6/vendor/symfony/error-handler/DebugClassLoader.php:337)"} []
[2023-09-25T06:47:41.493556+00:00] request.INFO: Matched route "api.info.queue". {"route":"api.info.queue","route_parameters":{"_route":"api.info.queue","_routeScope":["api"],"_controller":"Shopware\\Core\\Framework\\Api\\Controller\\InfoController::queue"},"request_uri":"https://www.xxxxxx.de/api/_info/queue.json","method":"GET"} []
[2023-09-25T06:47:41.783528+00:00] messenger.INFO: Sending message Shopware\Core\Content\Media\Message\GenerateThumbnailsMessage with async sender using Symfony\Component\Messenger\Bridge\Doctrine\Transport\DoctrineTransport {"class":"Shopware\\Core\\Content\\Media\\Message\\GenerateThumbnailsMessage","alias":"async","sender":"Symfony\\Component\\Messenger\\Bridge\\Doctrine\\Transport\\DoctrineTransport"} []
[2023-09-25T06:47:42.033457+00:00] request.INFO: Matched route "api.document.search". {"route":"api.document.search","route_parameters":{"_route":"api.document.search","_controller":"Shopware\\Core\\Framework\\Api\\Controller\\ApiController::search","entityName":"document","_routeScope":["api"],"path":""},"request_uri":"https://www.xxxxxx.de/api/search/document","method":"POST"} []
[2023-09-25T06:47:42.327070+00:00] request.INFO: Matched route "api.order.search". {"route":"api.order.search","route_parameters":{"_route":"api.order.search","_controller":"Shopware\\Core\\Framework\\Api\\Controller\\ApiController::search","entityName":"order","_routeScope":["api"],"path":""},"request_uri":"https://www.xxxxxx.de/api/search/order","method":"POST"} []
[2023-09-25T06:47:43.154249+00:00] request.INFO: Matched route "api.notification.message". {"route":"api.notification.message","route_parameters":{"_route":"api.notification.message","_routeScope":["api"],"_controller":"Shopware\\Administration\\Controller\\NotificationController::fetchNotification"},"request_uri":"https://www.xxxxxx.de/api/notification/message?latestTimestamp=2023-09-20%2010%3A04%3A11.973&limit=5","method":"GET"} []
[2023-09-25T06:47:45.193047+00:00] request.INFO: Matched route "api.action.scheduled-task.run". {"route":"api.action.scheduled-task.run","route_parameters":{"_route":"api.action.scheduled-task.run","_routeScope":["api"],"_controller":"Shopware\\Core\\Framework\\MessageQueue\\Api\\ScheduledTaskController::runScheduledTasks"},"request_uri":"https://www.xxxxxx.de/api/_action/scheduled-task/run","method":"POST"} []
[2023-09-25T06:47:45.307512+00:00] messenger.INFO: Sending message Shopware\Core\Content\ProductExport\ScheduledTask\ProductExportGenerateTask with async sender using Symfony\Component\Messenger\Bridge\Doctrine\Transport\DoctrineTransport {"class":"Shopware\\Core\\Content\\ProductExport\\ScheduledTask\\ProductExportGenerateTask","alias":"async","sender":"Symfony\\Component\\Messenger\\Bridge\\Doctrine\\Transport\\DoctrineTransport"} []
[2023-09-25T06:47:45.377869+00:00] request.INFO: Matched route "api.action.message-queue.consume". {"route":"api.action.message-queue.consume","route_parameters":{"_route":"api.action.message-queue.consume","_routeScope":["api"],"_controller":"Shopware\\Core\\Framework\\MessageQueue\\Api\\ConsumeMessagesController::consumeMessages"},"request_uri":"https://www.xxxxxx.de/api/_action/message-queue/consume","method":"POST"} []
[2023-09-25T06:47:45.390229+00:00] lock.DEBUG: Successfully acquired the "message_queue_consume_async" lock. {"resource":{"Symfony\\Component\\Lock\\Key":"message_queue_consume_async"}} []
[2023-09-25T06:47:45.390324+00:00] lock.DEBUG: Expiration defined for "message_queue_consume_async" lock for "300" seconds. {"resource":{"Symfony\\Component\\Lock\\Key":"message_queue_consume_async"},"ttl":300.0} []
[2023-09-25T06:47:45.403770+00:00] messenger.INFO: Received message Shopware\Core\Content\Media\Message\GenerateThumbnailsMessage {"class":"Shopware\\Core\\Content\\Media\\Message\\GenerateThumbnailsMessage"} []
[2023-09-25T06:47:45.414366+00:00] messenger.INFO: Message Shopware\Core\Content\Media\Message\GenerateThumbnailsMessage handled by Shopware\Core\Content\Media\Message\GenerateThumbnailsHandler::__invoke {"class":"Shopware\\Core\\Content\\Media\\Message\\GenerateThumbnailsMessage","handler":"Shopware\\Core\\Content\\Media\\Message\\GenerateThumbnailsHandler::__invoke"} []
[2023-09-25T06:47:45.417247+00:00] messenger.INFO: Received message Shopware\Core\Content\ProductExport\ScheduledTask\ProductExportGenerateTask {"class":"Shopware\\Core\\Content\\ProductExport\\ScheduledTask\\ProductExportGenerateTask"} []
[2023-09-25T06:47:45.502073+00:00] messenger.INFO: Message Shopware\Core\Content\ProductExport\ScheduledTask\ProductExportGenerateTask handled by Shopware\Core\Content\ProductExport\ScheduledTask\ProductExportGenerateTaskHandler::__invoke {"class":"Shopware\\Core\\Content\\ProductExport\\ScheduledTask\\ProductExportGenerateTask","handler":"Shopware\\Core\\Content\\ProductExport\\ScheduledTask\\ProductExportGenerateTaskHandler::__invoke"} []
[2023-09-25T06:47:46.146164+00:00] request.INFO: Matched route "api.notification.message". {"route":"api.notification.message","route_parameters":{"_route":"api.notification.message","_routeScope":["api"],"_controller":"Shopware\\Administration\\Controller\\NotificationController::fetchNotification"},"request_uri":"https://www.xxxxxx.de/api/notification/message?latestTimestamp=2023-09-20%2010%3A04%3A11.973&limit=5","method":"GET"} []
[2023-09-25T06:47:48.209465+00:00] request.INFO: Matched route "api.notification.message". {"route":"api.notification.message","route_parameters":{"_route":"api.notification.message","_routeScope":["api"],"_controller":"Shopware\\Administration\\Controller\\NotificationController::fetchNotification"},"request_uri":"https://www.xxxxxx.de/api/notification/message?latestTimestamp=2023-09-20%2010%3A04%3A11.973&limit=5","method":"GET"} []

Probier doch mal ein Image einfach als data:uri im HTML einzubetten. Wenn das dann funktioniert, liegt es evtl. an irgendeinem Berechtigungsproblem oder dem genutzten Pfad. Man mus hier immer aufpassen, dass die Pfade auf Bilder, Logos, etc. immer absolut sein müssen. Der PDF Renderer nutzt ja zunächst HTML und wandelt das dann in PDF um - das ist quasi ein externer Browser.
Wenn ich so etwas debugge schreiben ich hier zuerst mal den Preview (also das HTML) weg. Hier sollten dann Problem direkt ersichtlich sein …

Hi, ich habe in der logo.html.twig mal folgendes gesetzt.

{% block logo %}
    {# To include a header or footer on every site, these elements have to be defined before the content #}
    {% if config.displayHeader %}
        <header>
            {% block document_header %}
                {% if config.logo %}
                    <img src="<?php echo data_uri('https://www.xxxxxxx.de/images/logo_neu_s.png','image/png'); ?>" alt="Logo" />
                {% endif %}
            {% endblock %}
        </header>
    {% endif %}
{% endblock %}

Resultiert leider weiterhin in

Dann habe ich mal folgendes ausprobiert:

{% block logo %}
    {# To include a header or footer on every site, these elements have to be defined before the content #}
    {% if config.displayHeader %}
        <header>
            {% block document_header %}
                {% if config.logo %}
                    <img src="https://www.xxxxxxx.de/images/logo_neu_s.png" alt="Logo" />
                {% endif %}
            {% endblock %}
        </header>
    {% endif %}

Funktioniert auch nicht.

Dann habe ich aber mal folgendes probiert:

{% block logo %}
    {# To include a header or footer on every site, these elements have to be defined before the content #}
    {% if config.displayHeader %}
        <header>
            {% block document_header %}
                {% if config.logo %}
                    <img src="https://www.ANDERE-DOMAIN.de/logo.png" alt="Logo" />
                {% endif %}
            {% endblock %}
        </header>
    {% endif %}

Und das funktioniert tatsächlich!

Heisst, wenn ich eine andere Domain angebe wird das Logo geladen. Also doch Berechtigungen? Wie gehe ich jetzt am besten vor? Den CHMOD des Medianpfads wo das Logo liegt habe ich überprüft - alles 755 - sollte passen.

Die logo.html.twig liegt ja im /included Ordner. Wie kann ich diese updatesicher verändern?

wie gesagt ich würde das als data:uri einhängen. ich glaube was nicht geht in eine file-url sondern die muss immer via http gehen.

Das Konstrukt mit echo data_uri kenne ich so nicht, vermutlich das sowas wie „{{ image_data|data_uri}}“ ? aber da gib es ein 1000 Konverter, dass muss ja nur einmal passieren und bleibt dann statisch im Template.