ethanresnick / json-api

Turn your node app into a JSON API server (http://jsonapi.org/)
GNU Lesser General Public License v3.0
268 stars 41 forks source link

Internal Server Error on Delete #147

Closed te-online closed 6 years ago

te-online commented 6 years ago

When deleting an object the deletion works flawlessly, but the server returns an Internal Server Error. Is this a configuration problem?

Response:

{
    "links": {
        "self": "http://localhost/api/users/5a5fd8bf00536fadbdc03819"
    },
    "errors": [
        {
            "status": "500",
            "title": "An unknown error occurred while trying to process this request."
        }
    ]
}

The user is gone after the request.

I take any hints on how to debug this problem :-)

Node version: 9.0.0 json-api version: 3.0.0-beta.1 Request is empty apart from a basic auth header.

ethanresnick commented 6 years ago

You can run the library with the environment variable DEBUG=json-api:* and that'll give you more detailed error messages. You may be able to figure out the issue then, or you can paste the log here and I'll try to help.

te-online commented 6 years ago

Oh, this is helpful, must have missed that option... Thank you, will try that!

ethanresnick commented 6 years ago

must have missed that option

Yeah, it's not documented anywhere, which is my bad. One thing v3 could use is more docs still...

te-online commented 6 years ago

Okay, there was a undefined variable in my transformedAPIRequest. Using the debug option it was easy to spot 😄