DigitalState / Authentication

The DigitalState Authentication Microservice
MIT License
6 stars 4 forks source link

Registration of new users throws a `Service response is not valid` error #21

Open baddlan opened 6 years ago

baddlan commented 6 years ago

Note: I see this error in my local deployment but it's not happening in the demo server as of the reporting of this issue.

Url: {{authentication}}{{environment}}/registrations Request Token: Anonymous Request payload:

  "data": {
    "firstName": "Amarendra",
    "lastName": "Baahubali"
  },
  "version": 1,
  "username": "bahu",
  "password": "1",
  "identity": "Individual"
}

Response:

{
    "type": "https://tools.ietf.org/html/rfc2616#section-10",
    "title": "An error occurred",
    "detail": "Service response is not valid.",
    "trace": [
        {
            "namespace": "",
            "short_class": "",
            "class": "",
            "type": "",
            "function": "",
            "file": "/srv/api-platform/vendor/digitalstate/core/src/Ds/Component/Api/Service/AbstractService.php",
            "line": 223,
            "args": []
        },
        {
            "namespace": "Ds\\Component\\Api\\Service",
            "short_class": "AbstractService",
            "class": "Ds\\Component\\Api\\Service\\AbstractService",
            "type": "->",
            "function": "execute",
            "file": "/srv/api-platform/vendor/digitalstate/core/src/Ds/Component/Api/Service/IndividualService.php",
            "line": 90,
            "args": [
                [
                    "string",
                    "POST"
                ],
                [
                    "string",
                    "/individuals"
                ],
                [
                    "array",
                    {
                        "json": [
                            "array",
                            {
                                "id": [
                                    "null",
                                    null
                                ],
                                "uuid": [
                                    "null",
                                    null
                                ],
                                "createdAt": [
                                    "null",
                                    null
                                ],
                                "updatedAt": [
                                    "null",
                                    null
                                ],
                                "owner": [
                                    "string",
                                    "BusinessUnit"
                                ],
                                "ownerUuid": [
                                    "string",
                                    "b20a40d9-b95b-4462-b8f1-c7453b9b7067"
                                ],
                                "version": [
                                    "integer",
                                    1
                                ]
                            }
                        ],
                        "headers": [
                            "array",
                            {
                                "Content-Type": [
                                    "string",
                                    "application/json"
                                ],
                                "Accept": [
                                    "string",
                                    "application/json"
                                ],
                                "Authorization": [
                                    "string",
                                    "Bearer eyJhbGciOiJSUzI1NiJ9.eyJyb2xlcyI6WyJST0xFX1VTRVIiLCJST0xFX1NZU1RFTSJdLCJ1c2VybmFtZSI6InN5c3RlbUBkcyIsInV1aWQiOiI0YjAyMzdkMS0wOTE3LTRkOGItYWY2ZC0yYWE4OWJlMzM2ZGUiLCJpZGVudGl0eSI6IlN5c3RlbSIsImlkZW50aXR5VXVpZCI6ImZlMWI5NGVkLTc4M2EtNDhkNy04YmYyLTJmOWNlYTg5ZjExZSIsImlhdCI6MTUxNjI5MjM2NywiZXhwIjoxNTE2Mzc4NzY3fQ.nWgxMP1XZlqewF0sqcdMzgrRSuN5wg8Bs7bB4f_0P6C62solQhGBufP7yWe4GniSXiQLv5vd_MT0UAqmD8vJfkHJjGQka2dQaCGHXHJt76eq3HZKdPHLTF4fIbfaGbQo1eI4rmtRc-9X7AJL852kNdFUd7Wl5JjRlPpFsngFTCm9vqv7o_EbWdj4UpKiK-WUcmpMEIWapq4LkSgzA4vgDbpcUrbo9txWG-ThPSZe9IIfPpuNEElVEsbuXzWH0SciUvSSXJeMsu7fMxU4Pr7A2FDBF2fgd29hKMExmYQ6-iNw4u22tE7jgnqkSRK_CjuRmK8K0UTVSty8X6NRWNxV8OS1AS5riAp8sVENdxBnu9auTajkxBu7VZ7YG4DGGpjRXhBOshXALHhfU6L8r1drG9fBQttAL3XTI7WRG4U5pELab8lQUl1IP2H6SHRRe9s7r4lWrCWr_VgSK4yOEPlad1l14V_7SkZdO7-i7MBjnu9u68qHRpFljLZPV2NVEo7LGeF8IJsvUYqWaXM6uVs76s8xj_FVVboPr1sW2o6y4E2llgbx6OFYvDFk_xGid5tXiN_PvgnIClZfgTGHMgm2lWcZIfkr0JEbfLrARZeCWu0Jnml2WuuqSU1JOEIFTiHwQYenfqvucqQEotEFuhIF3nIAf32SZP7U9oWK1LzAWaw"
                                ]
                            }
                        ]
                    }
                ]
            ]
        },
        {
            "namespace": "Ds\\Component\\Api\\Service",
            "short_class": "IndividualService",
            "class": "Ds\\Component\\Api\\Service\\IndividualService",
            "type": "->",
            "function": "create",
            "file": "/srv/api-platform/src/AppBundle/Service/UserService.php",
            "line": 80,
            "args": [
                [
                    "object",
                    "Ds\\Component\\Api\\Model\\Individual"
                ]
            ]
        },
        {
            "namespace": "AppBundle\\Service",
            "short_class": "UserService",
            "class": "AppBundle\\Service\\UserService",
            "type": "->",
            "function": "createIdentity",
            "file": "/srv/api-platform/src/AppBundle/EventListener/User/IdentityListener.php",
            "line": 49,
            "args": [
                [
                    "object",
                    "AppBundle\\Entity\\User"
                ]
            ]
        },
        {
            "namespace": "AppBundle\\EventListener\\User",
            "short_class": "IdentityListener",
            "class": "AppBundle\\EventListener\\User\\IdentityListener",
            "type": "->",
            "function": "postPersist",
            "file": "/srv/api-platform/vendor/doctrine/orm/lib/Doctrine/ORM/Event/ListenersInvoker.php",
            "line": 112,
            "args": [
                [
                    "object",
                    "AppBundle\\Entity\\User"
                ],
                [
                    "object",
                    "Doctrine\\ORM\\Event\\LifecycleEventArgs"
                ]
            ]
        },
        {
            "namespace": "Doctrine\\ORM\\Event",
            "short_class": "ListenersInvoker",
            "class": "Doctrine\\ORM\\Event\\ListenersInvoker",
            "type": "->",
            "function": "invoke",
            "file": "/srv/api-platform/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php",
            "line": 1035,
            "args": [
                [
                    "object",
                    "Doctrine\\ORM\\Mapping\\ClassMetadata"
                ],
                [
                    "string",
                    "postPersist"
                ],
                [
                    "object",
                    "AppBundle\\Entity\\User"
                ],
                [
                    "object",
                    "Doctrine\\ORM\\Event\\LifecycleEventArgs"
                ],
                [
                    "integer",
                    1
                ]
            ]
        },
        {
            "namespace": "Doctrine\\ORM",
            "short_class": "UnitOfWork",
            "class": "Doctrine\\ORM\\UnitOfWork",
            "type": "->",
            "function": "executeInserts",
            "file": "/srv/api-platform/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php",
            "line": 378,
            "args": [
                [
                    "object",
                    "Doctrine\\ORM\\Mapping\\ClassMetadata"
                ]
            ]
        },
        {
            "namespace": "Doctrine\\ORM",
            "short_class": "UnitOfWork",
            "class": "Doctrine\\ORM\\UnitOfWork",
            "type": "->",
            "function": "commit",
            "file": "/srv/api-platform/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php",
            "line": 356,
            "args": [
                [
                    "null",
                    null
                ]
            ]
        },
        {
            "namespace": "Doctrine\\ORM",
            "short_class": "EntityManager",
            "class": "Doctrine\\ORM\\EntityManager",
            "type": "->",
            "function": "flush",
            "file": "/srv/api-platform/var/cache/dev/appDevDebugProjectContainer.php",
            "line": 7677,
            "args": [
                [
                    "null",
                    null
                ]
            ]
        },
        {
            "namespace": "",
            "short_class": "DoctrineORMEntityManager_0000000033a566e80000000053c65e751a2609432234ae2af8726a414f36e0b0",
            "class": "DoctrineORMEntityManager_0000000033a566e80000000053c65e751a2609432234ae2af8726a414f36e0b0",
            "type": "->",
            "function": "flush",
            "file": "/srv/api-platform/vendor/friendsofsymfony/user-bundle/Doctrine/UserManager.php",
            "line": 113,
            "args": []
        },
        {
            "namespace": "FOS\\UserBundle\\Doctrine",
            "short_class": "UserManager",
            "class": "FOS\\UserBundle\\Doctrine\\UserManager",
            "type": "->",
            "function": "updateUser",
            "file": "/srv/api-platform/src/AppBundle/Service/RegistrationService.php",
            "line": 69,
            "args": [
                [
                    "object",
                    "AppBundle\\Entity\\User"
                ]
            ]
        },
        {
            "namespace": "AppBundle\\Service",
            "short_class": "RegistrationService",
            "class": "AppBundle\\Service\\RegistrationService",
            "type": "->",
            "function": "createUser",
            "file": "/srv/api-platform/src/AppBundle/EventListener/Registration/UserListener.php",
            "line": 44,
            "args": [
                [
                    "object",
                    "AppBundle\\Entity\\Registration"
                ]
            ]
        },
        {
            "namespace": "AppBundle\\EventListener\\Registration",
            "short_class": "UserListener",
            "class": "AppBundle\\EventListener\\Registration\\UserListener",
            "type": "->",
            "function": "postPersist",
            "file": "/srv/api-platform/vendor/doctrine/orm/lib/Doctrine/ORM/Event/ListenersInvoker.php",
            "line": 112,
            "args": [
                [
                    "object",
                    "AppBundle\\Entity\\Registration"
                ],
                [
                    "object",
                    "Doctrine\\ORM\\Event\\LifecycleEventArgs"
                ]
            ]
        },
        {
            "namespace": "Doctrine\\ORM\\Event",
            "short_class": "ListenersInvoker",
            "class": "Doctrine\\ORM\\Event\\ListenersInvoker",
            "type": "->",
            "function": "invoke",
            "file": "/srv/api-platform/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php",
            "line": 1035,
            "args": [
                [
                    "object",
                    "Doctrine\\ORM\\Mapping\\ClassMetadata"
                ],
                [
                    "string",
                    "postPersist"
                ],
                [
                    "object",
                    "AppBundle\\Entity\\Registration"
                ],
                [
                    "object",
                    "Doctrine\\ORM\\Event\\LifecycleEventArgs"
                ],
                [
                    "integer",
                    1
                ]
            ]
        },
        {
            "namespace": "Doctrine\\ORM",
            "short_class": "UnitOfWork",
            "class": "Doctrine\\ORM\\UnitOfWork",
            "type": "->",
            "function": "executeInserts",
            "file": "/srv/api-platform/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php",
            "line": 378,
            "args": [
                [
                    "object",
                    "Doctrine\\ORM\\Mapping\\ClassMetadata"
                ]
            ]
        },
        {
            "namespace": "Doctrine\\ORM",
            "short_class": "UnitOfWork",
            "class": "Doctrine\\ORM\\UnitOfWork",
            "type": "->",
            "function": "commit",
            "file": "/srv/api-platform/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php",
            "line": 356,
            "args": [
                [
                    "null",
                    null
                ]
            ]
        },
        {
            "namespace": "Doctrine\\ORM",
            "short_class": "EntityManager",
            "class": "Doctrine\\ORM\\EntityManager",
            "type": "->",
            "function": "flush",
            "file": "/srv/api-platform/var/cache/dev/appDevDebugProjectContainer.php",
            "line": 7677,
            "args": [
                [
                    "null",
                    null
                ]
            ]
        },
        {
            "namespace": "",
            "short_class": "DoctrineORMEntityManager_0000000033a566e80000000053c65e751a2609432234ae2af8726a414f36e0b0",
            "class": "DoctrineORMEntityManager_0000000033a566e80000000053c65e751a2609432234ae2af8726a414f36e0b0",
            "type": "->",
            "function": "flush",
            "file": "/srv/api-platform/vendor/api-platform/core/src/Bridge/Doctrine/EventListener/WriteListener.php",
            "line": 69,
            "args": []
        },
        {
            "namespace": "ApiPlatform\\Core\\Bridge\\Doctrine\\EventListener",
            "short_class": "WriteListener",
            "class": "ApiPlatform\\Core\\Bridge\\Doctrine\\EventListener\\WriteListener",
            "type": "->",
            "function": "onKernelView",
            "file": null,
            "line": null,
            "args": [
                [
                    "object",
                    "Symfony\\Component\\HttpKernel\\Event\\GetResponseForControllerResultEvent"
                ],
                [
                    "string",
                    "kernel.view"
                ],
                [
                    "object",
                    "Symfony\\Component\\HttpKernel\\Debug\\TraceableEventDispatcher"
                ]
            ]
        },
        {
            "namespace": "",
            "short_class": "",
            "class": "",
            "type": "",
            "function": "call_user_func",
            "file": "/srv/api-platform/vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/Debug/WrappedListener.php",
            "line": 106,
            "args": [
                [
                    "array",
                    [
                        [
                            "object",
                            "ApiPlatform\\Core\\Bridge\\Doctrine\\EventListener\\WriteListener"
                        ],
                        [
                            "string",
                            "onKernelView"
                        ]
                    ]
                ],
                [
                    "object",
                    "Symfony\\Component\\HttpKernel\\Event\\GetResponseForControllerResultEvent"
                ],
                [
                    "string",
                    "kernel.view"
                ],
                [
                    "object",
                    "Symfony\\Component\\HttpKernel\\Debug\\TraceableEventDispatcher"
                ]
            ]
        },
        {
            "namespace": "Symfony\\Component\\EventDispatcher\\Debug",
            "short_class": "WrappedListener",
            "class": "Symfony\\Component\\EventDispatcher\\Debug\\WrappedListener",
            "type": "->",
            "function": "__invoke",
            "file": null,
            "line": null,
            "args": [
                [
                    "object",
                    "Symfony\\Component\\HttpKernel\\Event\\GetResponseForControllerResultEvent"
                ],
                [
                    "string",
                    "kernel.view"
                ],
                [
                    "object",
                    "Symfony\\Component\\EventDispatcher\\ContainerAwareEventDispatcher"
                ]
            ]
        },
        {
            "namespace": "",
            "short_class": "",
            "class": "",
            "type": "",
            "function": "call_user_func",
            "file": "/srv/api-platform/vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/EventDispatcher.php",
            "line": 174,
            "args": [
                [
                    "object",
                    "Symfony\\Component\\EventDispatcher\\Debug\\WrappedListener"
                ],
                [
                    "object",
                    "Symfony\\Component\\HttpKernel\\Event\\GetResponseForControllerResultEvent"
                ],
                [
                    "string",
                    "kernel.view"
                ],
                [
                    "object",
                    "Symfony\\Component\\EventDispatcher\\ContainerAwareEventDispatcher"
                ]
            ]
        },
        {
            "namespace": "Symfony\\Component\\EventDispatcher",
            "short_class": "EventDispatcher",
            "class": "Symfony\\Component\\EventDispatcher\\EventDispatcher",
            "type": "->",
            "function": "doDispatch",
            "file": "/srv/api-platform/vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/EventDispatcher.php",
            "line": 43,
            "args": [
                [
                    "array",
                    [
                        [
                            "object",
                            "Symfony\\Component\\EventDispatcher\\Debug\\WrappedListener"
                        ],
                        [
                            "object",
                            "Symfony\\Component\\EventDispatcher\\Debug\\WrappedListener"
                        ],
                        [
                            "object",
                            "Symfony\\Component\\EventDispatcher\\Debug\\WrappedListener"
                        ],
                        [
                            "object",
                            "Symfony\\Component\\EventDispatcher\\Debug\\WrappedListener"
                        ],
                        [
                            "object",
                            "Symfony\\Component\\EventDispatcher\\Debug\\WrappedListener"
                        ],
                        [
                            "object",
                            "Symfony\\Component\\EventDispatcher\\Debug\\WrappedListener"
                        ],
                        [
                            "object",
                            "Symfony\\Component\\EventDispatcher\\Debug\\WrappedListener"
                        ]
                    ]
                ],
                [
                    "string",
                    "kernel.view"
                ],
                [
                    "object",
                    "Symfony\\Component\\HttpKernel\\Event\\GetResponseForControllerResultEvent"
                ]
            ]
        },
        {
            "namespace": "Symfony\\Component\\EventDispatcher",
            "short_class": "EventDispatcher",
            "class": "Symfony\\Component\\EventDispatcher\\EventDispatcher",
            "type": "->",
            "function": "dispatch",
            "file": "/srv/api-platform/vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcher.php",
            "line": 146,
            "args": [
                [
                    "string",
                    "kernel.view"
                ],
                [
                    "object",
                    "Symfony\\Component\\HttpKernel\\Event\\GetResponseForControllerResultEvent"
                ]
            ]
        },
        {
            "namespace": "Symfony\\Component\\EventDispatcher\\Debug",
            "short_class": "TraceableEventDispatcher",
            "class": "Symfony\\Component\\EventDispatcher\\Debug\\TraceableEventDispatcher",
            "type": "->",
            "function": "dispatch",
            "file": "/srv/api-platform/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php",
            "line": 158,
            "args": [
                [
                    "string",
                    "kernel.view"
                ],
                [
                    "object",
                    "Symfony\\Component\\HttpKernel\\Event\\GetResponseForControllerResultEvent"
                ]
            ]
        },
        {
            "namespace": "Symfony\\Component\\HttpKernel",
            "short_class": "HttpKernel",
            "class": "Symfony\\Component\\HttpKernel\\HttpKernel",
            "type": "->",
            "function": "handleRaw",
            "file": "/srv/api-platform/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php",
            "line": 68,
            "args": [
                [
                    "object",
                    "Symfony\\Component\\HttpFoundation\\Request"
                ],
                [
                    "integer",
                    1
                ]
            ]
        },
        {
            "namespace": "Symfony\\Component\\HttpKernel",
            "short_class": "HttpKernel",
            "class": "Symfony\\Component\\HttpKernel\\HttpKernel",
            "type": "->",
            "function": "handle",
            "file": "/srv/api-platform/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php",
            "line": 168,
            "args": [
                [
                    "object",
                    "Symfony\\Component\\HttpFoundation\\Request"
                ],
                [
                    "integer",
                    1
                ],
                [
                    "boolean",
                    true
                ]
            ]
        },
        {
            "namespace": "Symfony\\Component\\HttpKernel",
            "short_class": "Kernel",
            "class": "Symfony\\Component\\HttpKernel\\Kernel",
            "type": "->",
            "function": "handle",
            "file": "/srv/api-platform/web/app_dev.php",
            "line": 28,
            "args": [
                [
                    "object",
                    "Symfony\\Component\\HttpFoundation\\Request"
                ]
            ]
        }
    ]
}
marioprudhomme commented 6 years ago

Are both authentication and identities up to date in code? Fresh migration? Containers are up? Currently unable to reproduce the error.