uvdesk / core-framework

UVDesk Community Helpdesk Core Framework Bundle providing the core essential functionalities and integration tools to easily integrate any other community helpdesk packages.
https://www.uvdesk.com
MIT License
60 stars 50 forks source link

Mailbox not found in PROD environment #200

Closed vaishaliwebkul closed 4 years ago

vaishaliwebkul commented 4 years ago

Framework Version 1.0

to get the tickets list we need to run the CRON job every time and keep the APP_ENV=dev in .env file. If we run the CRON job after changing the mode to PROD, it fails saying the mailbox not found.

Also the same happens when unable to clear project's cache

prod_issue

ghost commented 4 years ago

This issue has been solved. Please check out the issue below for details isssue #198

maquowicz commented 4 years ago

Looks like current dev stability has this issue still unresolved. Reproduce:

  1. composer create-project uvdesk/community-skeleton helpdesk-project --stability dev
  2. switch .env to prod
  3. bin/console c:c throws: You have requested a non-existent service "swiftmailer.mailer".

Workaround:

  1. create config/packages/prod/swiftmailer.yaml with some default settings: swiftmailer: disable_delivery: false
ghost commented 4 years ago

@maquowicz Could not reproduce. Could you post the content of swiftmailer.yaml

maquowicz commented 4 years ago

Without config/packages/prod/swiftmailer.yaml issue persists. Once created at this location it loads mailer component properly. Content is generic, prob also just swiftmailer: would do. Mine looks like that:

swiftmailer:
    disable_delivery: false

Not sure if its relative but my env is Ubuntu 18, php7.2, nginx, Composer version 1.8.4

ghost commented 4 years ago

@maquowicz

I tried removing all swiftmailer.yaml files from config directory including prod, dev, and test, but did not find any errors. It seems that if your swiftmailer.yaml file contains invalid configuration parameters the swiftmailer.mailer alias won't get registered with the container, which in turn spit the service not found error.

When you executed composer create-project command what was exactly the content of your swiftmailer.yaml file (all env dev/prod/test)? Your symfony swiftmailer-bundle version? Also, could you post a snapshot or contents of the error message?

maquowicz commented 4 years ago

Originally created project with this: composer create-project uvdesk/community-skeleton helpdesk-project --stability dev

Now moved HEAD back to 'initialise repo with project files'. ./config/packages/prod/swiftmailer.yaml is now gone

swiftmailer version v6.2.1

Error message was: You have requested a non-existent service "swiftmailer.mailer".

got APP_ENV=dev in PROJECT_ROOT/.env Screenshot from 2019-11-05 11-44-33

switched APP_ENV=dev to APP_ENV=prod in PROJECT_ROOT/.env Screenshot from 2019-11-05 11-51-52 Also unable to reproduce now. It works in both envs even on my newest commit and without ./config/packages/prod/swiftmailer.yaml

Might was just a glitch, sorry for the trouble. Will report if spotted again.

ghost commented 4 years ago

It was probably related to symfony/swiftmailer-bundle, as it parses the configuration in swiftmailer.yaml and registers the default_mailer as swiftmailer.mailer only if default_mailer = =swifmailer.mailer.some_mailer where some_mailer refers to a mailer from mailers property in swiftmailer.yaml. To put it simply, If default_mailer doesn't match any mailers, SwiftmailerExtension won't alias swiftmailer.mailer which in turn spit that error