Skip to content

TypeError on components Mailer - MonologBridge - SwiftMailer #31906

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

Closed
michaljusiega opened this issue Jun 6, 2019 · 10 comments
Closed

TypeError on components Mailer - MonologBridge - SwiftMailer #31906

michaljusiega opened this issue Jun 6, 2019 · 10 comments

Comments

@michaljusiega
Copy link
Contributor

Symfony version(s) affected: 4.3.x

Description
I have a big project using almost all components by Symfony. I installed a new mailer component and 6 bridges to check if all everything working. In dev envinroment mode everyting is alright, but when I switch to production envinroment mode I get:

TypeError: Argument 1 passed to Symfony\Bridge\Monolog\Handler\SwiftMailerHandler::setTransport() must implement interface Swift_Transport, instance of Symfony\Component\Mailer\Transport\NullTransport given, called in E:\PROJEKTY\intranet\var\cache\prod\ContainerCxQZRCx\srcApp_KernelProdContainer.php on line 4905 in E:\PROJEKTY\intranet\vendor\symfony\monolog-bridge\Handler\SwiftMailerHandler.php on line 31

My require in composer.json:

    "require": {
        "php": "^7.2.0",
        "ext-PDO": "*",
        "ext-bcmath": "*",
        "ext-calendar": "*",
        "ext-dom": "*",
        "ext-iconv": "*",
        "ext-json": "*",
        "ext-ldap": "*",
        "ext-mbstring": "*",
        "ext-oci8": "*",
        "ext-soap": "*",
        "ext-sockets": "*",
        "ext-sodium": "*",
        "ext-sqlite3": "*",
        "ext-zend-opcache": "*",
        "ext-zip": "*",
        "ext-zmq": "*",
        "cboden/ratchet": "^0.4.1",
        "doctrine/doctrine-migrations-bundle": "^2.0",
        "egulias/email-validator": "^2.1",
        "friendsofsymfony/ckeditor-bundle": "^2.1",
        "friendsofsymfony/rest-bundle": "^2.5",
        "fzaninotto/faker": "^1.8",
        "gabrielelana/byte-units": "^0.5.0",
        "geoip2/geoip2": "^2.9",
        "guzzlehttp/guzzle": "^6.3",
        "html2text/html2text": "^4.2",
        "jms/serializer-bundle": "^3.2",
        "khill/php-duration": "^1.0",
        "knplabs/knp-paginator-bundle": "^3.0",
        "knplabs/knp-snappy-bundle": "^1.6",
        "kwn/number-to-words": "^1.6",
        "markrogoyski/math-php": "v0.51",
        "masterminds/html5": "^2.6",
        "mpdf/mpdf": "^8.0",
        "mrcnpdlk/teryt-api": "^0.3.3",
        "myclabs/php-enum": "^1.7",
        "neitanod/forceutf8": "^2.0",
        "nelmio/api-doc-bundle": "^3.4",
        "nelmio/cors-bundle": "^1.5",
        "nette/utils": "^3.0",
        "oro/doctrine-extensions": "^1.2",
        "php-imap/php-imap": "^3.0",
        "phpoffice/phppresentation": "^0.9.0",
        "phpoffice/phpspreadsheet": "^1.7",
        "phpoffice/phpword": "^0.16.0",
        "phpunit/php-token-stream": "^3.0",
        "piwik/device-detector": "^3.11",
        "react/socket": "^1.2",
        "react/zmq": "^0.4.0",
        "sabre/vobject": "^4.2",
        "sensio/framework-extra-bundle": "^5.3",
        "symfony/asset": "^4.3",
        "symfony/browser-kit": "^4.3",
        "symfony/cache": "^4.3",
        "symfony/config": "^4.3",
        "symfony/console": "^4.3",
        "symfony/service-contracts": "^1.1",
        "symfony/translation-contracts": "^1.1",
        "symfony/http-client-contracts": "^1.1",
        "symfony/event-dispatcher-contracts": "^1.1",
        "symfony/cache-contracts": "^1.1",
        "symfony/css-selector": "^4.3",
        "symfony/debug": "^4.3",
        "symfony/dependency-injection": "^4.3",
        "symfony/dom-crawler": "^4.3",
        "symfony/dotenv": "^4.3",
        "symfony/event-dispatcher": "^4.3",
        "symfony/expression-language": "^4.3",
        "symfony/filesystem": "^4.3",
        "symfony/finder": "^4.3",
        "symfony/flex": "^1.2",
        "symfony/form": "^4.3",
        "symfony/framework-bundle": "^4.3",
        "symfony/http-foundation": "^4.3",
        "symfony/http-kernel": "^4.3",
        "symfony/inflector": "^4.3",
        "symfony/intl": "^4.3",
        "symfony/lock": "^4.3",
        "symfony/ldap": "^4.3",
        "symfony/requirements-checker": "^1.1",
        "symfony/messenger": "^4.3",
        "symfony/monolog-bridge": "^4.3",
        "symfony/mime": "^4.3",
        "symfony/mailer": "^4.3",
        "symfony/mailchimp-mailer": "^4.3",
        "symfony/amazon-mailer": "^4.3",
        "symfony/google-mailer": "^4.3",
        "symfony/mailgun-mailer": "^4.3",
        "symfony/postmark-mailer": "^4.3",
        "symfony/sendgrid-mailer": "^4.3",
        "symfony/monolog-bundle": "^3.1",
        "symfony/options-resolver": "^4.3",
        "symfony/orm-pack": "^1.0",
        "symfony/phpunit-bridge": "^4.3",
        "symfony/doctrine-bridge": "^4.3",
        "symfony/polyfill": "^1.11",
        "symfony/psr-http-message-bridge": "^1.2",
        "symfony/process": "^4.3",
        "symfony/property-access": "^4.3",
        "symfony/web-profiler-bundle": "^4.3",
        "symfony/property-info": "^4.3",
        "symfony/routing": "^4.3",
        "symfony/security": "^4.3",
        "symfony/security-bundle": "^4.3",
        "symfony/debug-bundle": "^4.3",
        "symfony/http-client": "^4.3",
        "symfony/serializer": "^4.3",
        "symfony/stopwatch": "^4.3",
        "symfony/swiftmailer-bundle": "^3.2",
        "symfony/templating": "^4.3",
        "symfony/translation": "^4.3",
        "symfony/twig-bridge": "^4.3",
        "symfony/twig-bundle": "^4.3",
        "symfony/validator": "^4.3",
        "symfony/var-dumper": "^4.3",
        "symfony/var-exporter": "^4.3",
        "symfony/web-link": "^4.3",
        "symfony/workflow": "^4.3",
        "symfony/yaml": "^4.3",
        "szymach/c-pchart": "^3.0",
        "thiagoalessio/tesseract_ocr": "^2.7",
        "twig/extensions": "^1.5"
    },

How to reproduce

Create a new project, use above components and try ?

Possible Solution
I dont know.

Additional context
error

@xabbuh
Copy link
Member

xabbuh commented Jun 6, 2019

I cannot reproduce what you describe. Can you check out the application I created at https://github.com/xabbuh/issue-31906 and modify it so that we are able to reproduce it?

@michaljusiega
Copy link
Contributor Author

Okey, I will try.

@nicolas-grekas
Copy link
Member

Already fixed by #31854?

@michaljusiega
Copy link
Contributor Author

I updated to 4.3.1 and nothing.

@xabbuh
Copy link
Member

xabbuh commented Jun 6, 2019

Does it mean we can close here?

@michaljusiega
Copy link
Contributor Author

michaljusiega commented Jun 6, 2019

I reproduced a error. I uploaded to: https://github.com/bambucha4/issue-31906/tree/error. The handler swift in monolog_prod.yaml make this problem.

        swift:
            type:         swift_mailer
            from_email:   'example@test.pl'
            to_email:     'example@test.pl'
            subject:      'SUBJECT'
            level:        debug
            formatter:    monolog.formatter.html
            content_type: text/html

@michaljusiega
Copy link
Contributor Author

michaljusiega commented Jun 7, 2019

Can You confirm this issue ?

@xabbuh
Copy link
Member

xabbuh commented Jun 7, 2019

Thanks, I can reproduce it now.

@xabbuh
Copy link
Member

xabbuh commented Jun 7, 2019

see #31928

@michaljusiega
Copy link
Contributor Author

michaljusiega commented Jun 7, 2019

Thank you for the answer ;)

nicolas-grekas added a commit that referenced this issue Jun 7, 2019
…ler (xabbuh)

This PR was merged into the 4.3 branch.

Discussion
----------

[FrameworkBundle] avoid service id conflicts with Swiftmailer

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #31906
| License       | MIT
| Doc PR        |

Commits
-------

5ce0ede avoid service id conflicts with Swiftmailer
@xabbuh xabbuh closed this as completed Jun 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants