nucleos / NucleosUserBundle

👤 Lightweight user management for symfony.
https://docs.nucleos.rocks/projects/user-bundle/
MIT License
59 stars 18 forks source link

PW reset email error, $user must not be accessed before initialization #688

Closed leaderred closed 1 year ago

leaderred commented 1 year ago

Environment

Docker Compose Setup with PHP8, NGINX, MariaDB and Redis

Packages

Direct dependencies required in composer.json:
beberlei/doctrineextensions         v1.3.0    v1.3.0    A set of extensions to Doctrine 2 that add support for additional query funct...
doctrine/annotations                1.14.3    2.0.1     Docblock Annotations Parser
doctrine/doctrine-bundle            2.8.3     2.8.3     Symfony DoctrineBundle
doctrine/doctrine-migrations-bundle 3.2.2     3.2.2     Symfony DoctrineMigrationsBundle
doctrine/orm                        2.14.1    2.14.1    Object-Relational-Mapper for PHP
eluceo/ical                         2.11.0    2.11.0    The eluceo/iCal package offers an abstraction layer for creating iCalendars. ...
friendsofsymfony/jsrouting-bundle   3.2.1     3.2.1     A pretty nice way to expose your Symfony routing to client applications.
h4cc/wkhtmltoimage-amd64            0.12.4    0.12.4    Convert html to image using webkit (qtwebkit). Static linked linux binary for...
h4cc/wkhtmltopdf-amd64              0.12.4    0.12.4    Convert html to pdf using webkit (qtwebkit). Static linked linux binary for a...
knplabs/knp-paginator-bundle        v6.1.1    v6.1.1    Paginator bundle for Symfony to automate pagination and simplify sorting and ...
knplabs/knp-snappy-bundle           v1.9.0    v1.9.0    Easily create PDF and images in Symfony by converting Twig/HTML templates.
league/commonmark                   2.3.8     2.3.9     Highly-extensible PHP Markdown parser which fully supports the CommonMark spe...
mobiledetect/mobiledetectlib        3.74.0    3.74.0    Mobile_Detect is a lightweight PHP class for detecting mobile devices. It use...
norkunas/onesignal-php-api          v2.10.0   v2.10.0   OneSignal API for PHP
nucleos/user-bundle                 2.2.0     2.2.0     Lightweight user management for symfony
nyholm/psr7                         1.5.1     1.5.1     A fast PHP7 implementation of PSR-7
phpdocumentor/reflection-docblock   5.3.0     5.3.0     With this component, a library can provide support for annotations via DocBlo...
phpoffice/phpspreadsheet            1.27.1    1.27.1    PHPSpreadsheet - Read, Create and Write Spreadsheet documents in PHP - Spread...
phpstan/phpdoc-parser               1.16.1    1.16.1    PHPDoc parser with support for nullable, intersection and generic types
predis/predis                       v2.1.1    v2.1.1    A flexible and feature-complete Redis client for PHP.
snc/redis-bundle                    4.6.0     4.6.0     A Redis bundle for Symfony
symfony/asset                       v6.2.5    v6.2.5    Manages URL generation and versioning of web assets such as CSS stylesheets, ...
symfony/console                     v6.2.5    v6.2.5    Eases the creation of beautiful and testable command line interfaces
symfony/debug-bundle                v6.2.5    v6.2.5    Provides a tight integration of the Symfony VarDumper component and the Serve...
symfony/doctrine-messenger          v6.2.5    v6.2.5    Symfony Doctrine Messenger Bridge
symfony/dotenv                      v6.2.5    v6.2.5    Registers environment variables from a .env file
symfony/expression-language         v6.2.5    v6.2.5    Provides an engine that can compile and evaluate expressions
symfony/flex                        v2.2.4    v2.2.4    Composer plugin for Symfony
symfony/form                        v6.2.5    v6.2.5    Allows to easily create, process and reuse HTML forms
symfony/framework-bundle            v6.2.5    v6.2.5    Provides a tight integration between Symfony components and the Symfony full-...
symfony/http-client                 v6.2.6    v6.2.6    Provides powerful methods to fetch HTTP resources synchronously or asynchrono...
symfony/intl                        v6.2.5    v6.2.5    Provides a PHP replacement layer for the C intl extension that includes addit...
symfony/mailer                      v6.2.5    v6.2.5    Helps sending emails
symfony/maker-bundle                v1.48.0   v1.48.0   Symfony Maker helps you create empty commands, controllers, form classes, tes...
symfony/mime                        v6.2.5    v6.2.5    Allows manipulating MIME messages
symfony/monolog-bundle              v3.8.0    v3.8.0    Symfony MonologBundle
symfony/notifier                    v6.2.5    v6.2.5    Sends notifications via one or more channels (email, SMS, ...)
symfony/process                     v6.2.5    v6.2.5    Executes commands in sub-processes
symfony/property-access             v6.2.5    v6.2.5    Provides functions to read and write from/to an object or array using a simpl...
symfony/property-info               v6.2.5    v6.2.5    Extracts information about PHP class' properties using metadata of popular so...
symfony/proxy-manager-bridge        v6.2.5    v6.2.5    Provides integration for ProxyManager with various Symfony components
symfony/rate-limiter                v6.2.5    v6.2.5    Provides a Token Bucket implementation to rate limit input and output in your...
symfony/runtime                     v6.2.5    v6.2.5    Enables decoupling PHP applications from global state
symfony/security-bundle             v6.2.6    v6.2.6    Provides a tight integration of the Security component into the Symfony full-...
symfony/serializer                  v6.2.5    v6.2.5    Handles serializing and deserializing data structures, including object graph...
symfony/stopwatch                   v6.2.5    v6.2.5    Provides a way to profile code
symfony/string                      v6.2.5    v6.2.5    Provides an object-oriented API to strings and deals with bytes, UTF-8 code p...
symfony/translation                 v6.2.5    v6.2.5    Provides tools to internationalize your application
symfony/twig-bundle                 v6.2.5    v6.2.5    Provides a tight integration of Twig into the Symfony full-stack framework
symfony/validator                   v6.2.5    v6.2.5    Provides tools to validate values
symfony/web-link                    v6.2.5    v6.2.5    Manages links between resources
symfony/web-profiler-bundle         v6.2.5    v6.2.5    Provides a development tool that gives detailed information about the executi...
symfony/webapp-meta                 v1.0.0    v1.0.0    A meta package for the web app pack
symfony/webpack-encore-bundle       v1.16.1   v1.16.1   Integration with your Symfony app & Webpack Encore!
symfony/yaml                        v6.2.5    v6.2.5    Loads and dumps YAML files
twig/cssinliner-extra               v3.5.1    v3.5.1    A Twig extension to allow inlining CSS
twig/extra-bundle                   v3.5.1    v3.5.1    A Symfony bundle for extra Twig extensions
twig/markdown-extra                 v3.5.1    v3.5.1    A Twig extension for Markdown
twig/twig                           v3.5.1    v3.5.1    Twig, the flexible, fast, and secure template language for PHP

Transitive dependencies not required in composer.json:
dflydev/dot-access-data             v3.0.2    v3.0.2    Given a deep data structure, access data by dot notation.
doctrine/cache                      2.2.0     2.2.0     PHP Doctrine Cache library is a popular cache implementation that supports ma...
doctrine/collections                2.1.2     2.1.2     PHP Doctrine Collections library that adds additional functionality on top of...
doctrine/common                     3.4.3     3.4.3     PHP Doctrine Common project is a library that provides additional functionali...
doctrine/dbal                       3.6.0     3.6.0     Powerful PHP database abstraction layer (DBAL) with many features for databas...
doctrine/deprecations               v1.0.0    v1.0.0    A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging wit...
doctrine/event-manager              1.2.0     2.0.0     The Doctrine Event Manager is a simple PHP event system that was built to be ...
doctrine/inflector                  2.0.6     2.0.6     PHP Doctrine Inflector is a small library that can perform string manipulatio...
doctrine/instantiator               1.5.0     2.0.0     A small, lightweight utility to instantiate objects in PHP without invoking t...
doctrine/lexer                      2.1.0     3.0.0     PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Des...
doctrine/migrations                 3.5.5     3.6.0     PHP Doctrine Migrations project offer additional functionality on top of the ...
doctrine/persistence                3.1.4     3.1.4     The Doctrine Persistence project is a set of shared interfaces and functional...
doctrine/sql-formatter              1.1.3     1.1.3     a PHP SQL highlighting library
egulias/email-validator             4.0.1     4.0.1     A library for validating emails against several RFCs
ezyang/htmlpurifier                 v4.16.0   v4.16.0   Standards compliant HTML filter written in PHP
friendsofphp/proxy-manager-lts      v1.0.14   v1.0.14   Adding support for a wider range of PHP versions to ocramius/proxy-manager
knplabs/knp-components              v4.1.0    v4.1.0    Knplabs component library
knplabs/knp-snappy                  v1.4.1    v1.4.1    PHP library allowing thumbnail, snapshot or PDF generation from a url or a ht...
laminas/laminas-code                4.8.0     4.8.0     Extensions to the PHP Reflection API, static code scanning, and code generation
league/config                       v1.2.0    v1.2.0    Define configuration arrays with strict schemas and access values with dot no...
maennchen/zipstream-php             v2.4.0    v2.4.0    ZipStream is a library for dynamically streaming dynamic zip files from PHP w...
markbaker/complex                   3.0.2     3.0.2     PHP Class for working with complex numbers
markbaker/matrix                    3.0.1     3.0.1     PHP Class for working with matrices
monolog/monolog                     3.3.1     3.3.1     Sends your logs to files, sockets, inboxes, databases and various web services
myclabs/php-enum                    1.8.4     1.8.4     PHP Enum implementation
nette/schema                        v1.2.3    v1.2.3    📐 Nette Schema: validating data structures against a given Schema.
nette/utils                         v4.0.0    v4.0.0    🛠  Nette Utils: lightweight utilities for string & array manipulation, ima...
nikic/php-parser                    v4.15.3   v4.15.3   A PHP parser written in PHP
paragonie/random_compat             v9.99.100 v9.99.100 PHP 5.x polyfill for random_bytes() and random_int() from PHP 7
php-http/message-factory            v1.0.2    v1.0.2    Factory interfaces for PSR-7 HTTP Message
phpdocumentor/reflection-common     2.2.0     2.2.0     Common reflection classes used by phpdocumentor to reflect the code structure
phpdocumentor/type-resolver         1.6.2     1.6.2     A PSR-5 based resolver of Class names, Types and Structural Element Names
psr/cache                           3.0.0     3.0.0     Common interface for caching libraries
psr/container                       2.0.2     2.0.2     Common Container Interface (PHP FIG PSR-11)
psr/event-dispatcher                1.0.0     1.0.0     Standard interfaces for event handling.
psr/http-client                     1.0.1     1.0.1     Common interface for HTTP clients
psr/http-factory                    1.0.1     1.0.1     Common interfaces for PSR-7 HTTP message factories
psr/http-message                    1.0.1     1.0.1     Common interface for HTTP messages
psr/link                            2.0.1     2.0.1     Common interfaces for HTTP links
psr/log                             3.0.0     3.0.0     Common interface for logging libraries
psr/simple-cache                    3.0.0     3.0.0     Common interfaces for simple caching
symfony/cache                       v6.2.5    v6.2.5    Provides extended PSR-6, PSR-16 (and tags) implementations
symfony/cache-contracts             v3.2.0    v3.2.0    Generic abstractions related to caching
symfony/config                      v6.2.5    v6.2.5    Helps you find, load, combine, autofill and validate configuration values of ...
symfony/css-selector                v6.2.5    v6.2.5    Converts CSS selectors to XPath expressions
symfony/dependency-injection        v6.2.6    v6.2.6    Allows you to standardize and centralize the way objects are constructed in y...
symfony/deprecation-contracts       v3.2.0    v3.2.0    A generic function and convention to trigger deprecation notices
symfony/doctrine-bridge             v6.2.5    v6.2.5    Provides integration for Doctrine with various Symfony components
symfony/error-handler               v6.2.5    v6.2.5    Provides tools to manage errors and ease debugging PHP code
symfony/event-dispatcher            v6.2.5    v6.2.5    Provides tools that allow your application components to communicate with eac...
symfony/event-dispatcher-contracts  v3.2.0    v3.2.0    Generic abstractions related to dispatching event
symfony/filesystem                  v6.2.5    v6.2.5    Provides basic utilities for the filesystem
symfony/finder                      v6.2.5    v6.2.5    Finds files and directories via an intuitive fluent interface
symfony/http-client-contracts       v3.2.0    v3.2.0    Generic abstractions related to HTTP clients
symfony/http-foundation             v6.2.6    v6.2.6    Defines an object-oriented layer for the HTTP specification
symfony/http-kernel                 v6.2.6    v6.2.6    Provides a structured process for converting a Request into a Response
symfony/messenger                   v6.2.5    v6.2.5    Helps applications send and receive messages to/from other applications or vi...
symfony/monolog-bridge              v6.2.5    v6.2.5    Provides integration for Monolog with various Symfony components
symfony/options-resolver            v6.2.5    v6.2.5    Provides an improved replacement for the array_replace PHP function
symfony/password-hasher             v6.2.5    v6.2.5    Provides password hashing utilities
symfony/polyfill-intl-grapheme      v1.27.0   v1.27.0   Symfony polyfill for intl's grapheme_* functions
symfony/polyfill-intl-icu           v1.27.0   v1.27.0   Symfony polyfill for intl's ICU-related data and classes
symfony/polyfill-intl-idn           v1.27.0   v1.27.0   Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions
symfony/polyfill-intl-normalizer    v1.27.0   v1.27.0   Symfony polyfill for intl's Normalizer class and related functions
symfony/polyfill-mbstring           v1.27.0   v1.27.0   Symfony polyfill for the Mbstring extension
symfony/routing                     v6.2.5    v6.2.5    Maps an HTTP request to a set of configuration variables
symfony/security-core               v6.2.5    v6.2.5    Symfony Security Component - Core Library
symfony/security-csrf               v6.2.5    v6.2.5    Symfony Security Component - CSRF Library
symfony/security-http               v6.2.6    v6.2.6    Symfony Security Component - HTTP Integration
symfony/service-contracts           v3.2.0    v3.2.0    Generic abstractions related to writing services
symfony/translation-contracts       v3.2.0    v3.2.0    Generic abstractions related to translation
symfony/twig-bridge                 v6.2.5    v6.2.5    Provides integration for Twig with various Symfony components
symfony/var-dumper                  v6.2.5    v6.2.5    Provides mechanisms for walking through any arbitrary PHP variable
symfony/var-exporter                v6.2.5    v6.2.5    Allows exporting any serializable PHP data structure to plain PHP code
tijsverkoyen/css-to-inline-styles   2.2.6     2.2.6     CssToInlineStyles is a class that enables you to convert HTML-pages/files int...
webmozart/assert                    1.11.0    1.11.0    Assertions to validate method input/output with nice error messages.
willdurand/jsonp-callback-validator v2.0.0    v2.0.0    JSONP callback validator.

PHP version

PHP 8.2.3 (cli) (built: Feb 14 2023 20:54:19) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.3, Copyright (c) Zend Technologies
    with Zend OPcache v8.2.3, Copyright (c), by Zend Technologies

Subject

When I press reset Email Button on Login Screen, nothing happen. In log i can see following error:

18:49:00 WARNING [messenger] Error thrown while handling message Symfony\Component\Mailer\Messenger\SendEmailMessage. Sending for retry #1 using 1000 ms delay. Error: "Handling "Symfony\Component\Mailer\Messenger\SendEmailMessage" failed: Typed property Nucleos\UserBundle\Mailer\Mail\ResettingMail::$user must not be accessed before initialization" ["class" => "Symfony\Component\Mailer\Messenger\SendEmailMessage","retryCount" => 1,"delay" => 1000,"error" => "Handling "Symfony\Component\Mailer\Messenger\SendEmailMessage" failed: Typed property Nucleos\UserBundle\Mailer\Mail\ResettingMail::$user must not be accessed before initialization","exception" => Symfony\Component\Messenger\Exception\HandlerFailedException { …}]

In past versions of symfony and nucleosuserbundle, everything was working fine. Other Email could be send with use Symfony\Component\Mailer\MailerInterface.

Steps to reproduce

Reset password function

Expected results

Get password reset email

Actual results

Error in log, get no email

core23 commented 1 year ago

Can you provide a PR with a fix @leaderred ?

leaderred commented 1 year ago

I would like to, but I don't know what is causing this error or where to start, sorry.