Symfony 4.4 FOS 用户包 api/auth/login 在 null 上调用成员函数 findOneBy()

Symfony 4.4 FOS user-bundle api/auth/login Call to a member function findOneBy() on null

我通过 docker 使用 symfony 4.4 并在不久前安装了 FOS 用户包。一切正常,但最近在尝试登录时,我不断收到错误

Call to a member function findOneBy() on null。 完整的痕迹是这样的

{
    "meta": {
        "code": 0,
        "message": "Call to a member function findOneBy() on null",
        "file": "/var/www/symfony/vendor/friendsofsymfony/user-bundle/Doctrine/UserManager.php",
        "line": 76,
        "trace": [
            {
                "file": "/var/www/symfony/vendor/friendsofsymfony/user-bundle/Model/UserManager.php",
                "line": 58,
                "function": "findUserBy"
            },
            {
                "file": "/var/www/symfony/vendor/friendsofsymfony/user-bundle/Security/UserProvider.php",
                "line": 93,
                "function": "findUserByUsername"
            },
            {
                "file": "/var/www/symfony/vendor/friendsofsymfony/user-bundle/Security/UserProvider.php",
                "line": 43,
                "function": "findUser"
            },
            {
                "file": "/var/www/symfony/vendor/symfony/security-core/User/ChainUserProvider.php",
                "line": 56,
                "function": "loadUserByUsername"
            },
            {
                "file": "/var/www/symfony/vendor/symfony/security-core/Authentication/Provider/DaoAuthenticationProvider.php",
                "line": 85,
                "function": "loadUserByUsername"
            },
            {
                "file": "/var/www/symfony/vendor/symfony/security-core/Authentication/Provider/UserAuthenticationProvider.php",
                "line": 65,
                "function": "retrieveUser"
            },
            {
                "file": "/var/www/symfony/vendor/symfony/security-core/Authentication/AuthenticationProviderManager.php",
                "line": 85,
                "function": "authenticate"
            },
            {
                "file": "/var/www/symfony/vendor/symfony/security-http/Firewall/UsernamePasswordJsonAuthenticationListener.php",
                "line": 137,
                "function": "authenticate"
            },
            {
                "file": "/var/www/symfony/vendor/symfony/security-bundle/Debug/WrappedLazyListener.php",
                "line": 49,
                "function": "authenticate"
            },
            {
                "file": "/var/www/symfony/vendor/symfony/security-http/Firewall/AbstractListener.php",
                "line": 27,
                "function": "authenticate"
            },
            {
                "file": "/var/www/symfony/vendor/symfony/security-bundle/Debug/TraceableFirewallListener.php",
                "line": 62,
                "function": "__invoke"
            },
            {
                "file": "/var/www/symfony/vendor/symfony/security-http/Firewall.php",
                "line": 98,
                "function": "callListeners"
            },
            {
                "file": "/var/www/symfony/vendor/symfony/event-dispatcher/Debug/WrappedListener.php",
                "line": 126,
                "function": "onKernelRequest"
            },
            {
                "file": "/var/www/symfony/vendor/symfony/event-dispatcher/EventDispatcher.php",
                "line": 264,
                "function": "__invoke"
            },
            {
                "file": "/var/www/symfony/vendor/symfony/event-dispatcher/EventDispatcher.php",
                "line": 239,
                "function": "doDispatch"
            },
            {
                "file": "/var/www/symfony/vendor/symfony/event-dispatcher/EventDispatcher.php",
                "line": 73,
                "function": "callListeners"
            },
            {
                "file": "/var/www/symfony/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php",
                "line": 168,
                "function": "dispatch"
            },
            {
                "file": "/var/www/symfony/vendor/symfony/http-kernel/HttpKernel.php",
                "line": 134,
                "function": "dispatch"
            },
            {
                "file": "/var/www/symfony/vendor/symfony/http-kernel/HttpKernel.php",
                "line": 80,
                "function": "handleRaw"
            },
            {
                "file": "/var/www/symfony/vendor/symfony/http-kernel/Kernel.php",
                "line": 201,
                "function": "handle"
            },
            {
                "file": "/var/www/symfony/public/index.php",
                "line": 25,
                "function": "handle"
            }
        ]
    },
    "links": {
        "self": "/api/auth/login"
    },
    "errors": [
        {
            "status": "500",
            "code": "INTERNAL_SERVER_ERROR",
            "title": "Internal Server Error"
        }
    ]
}

注册端点在 url api/auth/register 和注册新用户方面工作得很好。

有什么想法吗?

最后我可以通过永久删除 vendor 文件夹并使用 composer install 重新安装所有软件包来解决问题。

作曲家更新根本没有帮助。

我仍然不确定问题出在哪里,但这个问题的解决方案就是这样。