cayley icon indicating copy to clipboard operation
cayley copied to clipboard

HTTP v2 delete returns application error on success

Open steffansluis opened this issue 7 years ago • 2 comments
trafficstars

I'm doing the following:

  • Select 1000 subjects matching a particular predicate and object using g.V("object").In("<predicate>").Limit(1000).All()
  • Map the result to quads in JSON
  • POST the stringified JSON array and the correct content type as a body to /api/v2/delete on my Cayley host.

After 30 seconds, I get the following response (my Cayley instance is running on Heroku, hence the error page):

<!DOCTYPE html>
        <html>
          <head>
                <meta name="viewport" content="width=device-width, initial-scale=1">
                <meta charset="utf-8">
                <title>Application Error</title>
                <style media="screen">
                  html,body,iframe {
                        margin: 0;
                        padding: 0;
                  }
                  html,body {
                        height: 100%;
                        overflow: hidden;
                  }
                  iframe {
                        width: 100%;
                        height: 100%;
                        border: 0;
                  }
                </style>
          </head>
          <body>
                <iframe src="//www.herokucdn.com/error-pages/application-error.html"></iframe>
          </body>
        </html>

However, running g.Emit(g.V("object").In("<predicate>").Count()) confirms that indeed 1000 quads were deleted. I think what might be happening is that the request takes longer than 30 seconds (which is the Heroku timeout) causing it to be cut off by the Heroku router. However, Cayley continues processing the delete and as a result, the request has the intended effect but returns with a timeout error after 30 seconds. The request shouldn't take that long. I suspect something is not being closed properly causing every successful request to hang until the timeout.

steffansluis avatar Jun 18 '18 20:06 steffansluis

What backend are you using for this instance?

dennwc avatar Jun 21 '18 15:06 dennwc

Cayley version: 0.7.3 Git commit hash: 782194b030b5 DB: Postgres version 9.6.4

steffansluis avatar Jun 21 '18 16:06 steffansluis