Comments (7)
I disabled the http_client
integration for now to work around this problem.
from sentry-symfony.
Could you please share the Monolog configuration you're using to reproduce the issue?
from sentry-symfony.
packages/monolog.yaml:
monolog:
channels:
- app
- import
- translation
handlers:
backoffice:
type: symfony_mailer
from_email: '[email protected]'
to_email:
- '[email protected]'
subject: '[XXXXX] %%message%%'
level: warning
formatter: monolog.formatter.html
content_type: text/html
channels:
- ratedownload
developers:
type: symfony_mailer
from_email: '[email protected]'
to_email:
- '[email protected]'
subject: '[XXXXXX] %%message%%'
level: warning
formatter: monolog.formatter.html
content_type: text/html
channels:
- app
monolog/prod/monolog.yaml:
monolog:
handlers:
main:
type: fingers_crossed
action_level: error
handler: main_split
excluded_http_codes: [ 404, 405 ]
buffer_size: 50 # How many messages should be saved? Prevent memory leaks
channels: [ "!ratedownload" ]
main_split:
type: group
members: [ main_file, developers ]
main_file:
type: rotating_file
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: info
max_files: 10
console:
type: console
process_psr_3_messages: false
channels: [ "!event", "!doctrine", "!ratedownload" ]
console_formatter_options:
multiline: true
# deprecation:
# type: rotating_file
# path: "%kernel.logs_dir%/%kernel.environment%.deprecations.log"
# max_files: 10
# deprecation_filter:
# type: filter
# handler: deprecation
# max_level: info
# channels: ["php"]
import:
type: rotating_file
path: "%kernel.logs_dir%/import.log"
level: info
channels: [ "import" ]
max_files: 10
translation:
type: rotating_file
path: "%kernel.logs_dir%/translation.log"
level: info
channels: [ "translation" ]
max_files: 10
sentry:
type: sentry
level: !php/const Monolog\Logger::ERROR
hub_id: Sentry\State\HubInterface
bubble: true
fill_extra_context: true
from sentry-symfony.
I tried using your configuration and I cannot reproduce the issue. I didn't set the MAILER_DSN
environment variable, so it's using the NullTransport
of the Mailer
. Likely I'm missing something, but I don't know what. Could you prepare a little repo reproducing the problem?
from sentry-symfony.
I tried to reproduce it in an empty project. In this project, the getMailer_TransportFactory_NullService
method of the container looks like this:
protected function getMailer_TransportFactory_NullService()
{
$a = ($this->privates['monolog.logger.mailer'] ?? $this->getMonolog_Logger_MailerService());
if (isset($this->privates['mailer.transport_factory.null'])) {
return $this->privates['mailer.transport_factory.null'];
}
$b = ($this->services['event_dispatcher'] ?? $this->getEventDispatcherService());
if (isset($this->privates['mailer.transport_factory.null'])) {
return $this->privates['mailer.transport_factory.null'];
}
$c = ($this->privates['.debug.http_client'] ?? $this->get_Debug_HttpClientService());
if (isset($this->privates['mailer.transport_factory.null'])) {
return $this->privates['mailer.transport_factory.null'];
}
return $this->privates['mailer.transport_factory.null'] = new \Symfony\Component\Mailer\Transport\NullTransportFactory($b, $c, $a);
}
In the 'broken' project, it looks like this:
/**
* Gets the private 'mailer.transport_factory.null' shared service.
*
* @return \Symfony\Component\Mailer\Transport\NullTransportFactory
*/
protected function getMailer_TransportFactory_NullService()
{
include_once \dirname(__DIR__, 4).''.\DIRECTORY_SEPARATOR.'vendor'.\DIRECTORY_SEPARATOR.'symfony'.\DIRECTORY_SEPARATOR.'mailer'.\DIRECTORY_SEPARATOR.'Transport'.\DIRECTORY_SEPARATOR.'TransportFactoryInterface.php';
include_once \dirname(__DIR__, 4).''.\DIRECTORY_SEPARATOR.'vendor'.\DIRECTORY_SEPARATOR.'symfony'.\DIRECTORY_SEPARATOR.'mailer'.\DIRECTORY_SEPARATOR.'Transport'.\DIRECTORY_SEPARATOR.'AbstractTransportFactory.php';
include_once \dirname(__DIR__, 4).''.\DIRECTORY_SEPARATOR.'vendor'.\DIRECTORY_SEPARATOR.'symfony'.\DIRECTORY_SEPARATOR.'mailer'.\DIRECTORY_SEPARATOR.'Transport'.\DIRECTORY_SEPARATOR.'NullTransportFactory.php';
$a = ($this->services['event_dispatcher'] ?? $this->getEventDispatcherService());
if (isset($this->privates['mailer.transport_factory.null'])) {
return $this->privates['mailer.transport_factory.null'];
}
return $this->privates['mailer.transport_factory.null'] = new \Symfony\Component\Mailer\Transport\NullTransportFactory($a, ($this->privates['.debug.http_client'] ?? $this->get_Debug_HttpClientService()), ($this->privates['monolog.logger.mailer'] ?? $this->getMonolog_Logger_MailerService()));
}
The isset
calls break the loop. I have no idea why my project doesn't have them.
The repository with the example that works is at https://github.com/jorrit/sentry-symfony-bug-demo.
from sentry-symfony.
I tried cloning your repository and running the bin/console
script and it works fine, no issues during the compilation of the container. I'm sorry, I don't know how to help without a project that clearly shows the error.
from sentry-symfony.
I know, the repository works fine. I have yet to figure out why that repository works and my private project doesn't. It has something to do with the difference in how the DI container is generated. I'll close this issue because at this moment it doesn't seem to involve sentry directly. I will reopen when there might be something that can be improved here.
Thank you for your time.
from sentry-symfony.
Related Issues (20)
- Support for sentry php 4.x HOT 3
- Add support for sentry/sentry v4 HOT 3
- Bump (or allow) sentry libraries to version 4 HOT 5
- Symfony SDK 5.0.0 HOT 33
- Support Symfony 7 HOT 2
- Update documentation for current versions of Symfony HOT 5
- Upgrading package from 4.12.0 to 4.13.0 HOT 1
- Add conflicting package symfony/http-client v6 HOT 7
- Upgrade to sentry/sentry:^4.0 HOT 1
- Documentation error about "ignore_exceptions" HOT 2
- Symfony 7.0 got new deprecation HOT 1
- DbalTracingPass is overridden by DoctrineBundle's own MiddlewaresPass HOT 4
- Fatal error with `doctrine/dbal` 4.x HOT 18
- Cannot upgrade to sentry/sdk 4.0.0, since sentry/sentry-symfony 4.13.2 locked to sentry/sdk[3.6.0] HOT 1
- RequestFetcher doesn't return request
- Release reported as "1.0.0+no-version-set@{no ref" HOT 5
- Performance issue in aliases.php when not using all components that can be traced HOT 2
- Compatibility Issue with Sentry Integration: Declaration Error in Http\Message\Encoding\FilteredStream HOT 11
- PHP Fatal error: Declaration of Sentry\SentryBundle\Tracing\HttpClient\TraceableResponseForV4::getInfo(?string $type = null) must be compatible with Symfony\Contracts\HttpClient\ResponseInterface::getInfo(?string $type = null): HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sentry-symfony.