api.webmaker.org icon indicating copy to clipboard operation
api.webmaker.org copied to clipboard

500 error when trying to create a new project

Open k88hudson opened this issue 10 years ago • 4 comments

I only saw this once, but when I tried to create a project with the following request:

POST /users/1/projects
{title: "My cool project"}

I got a 500 error as a response. This was the error that was logged

{
   "data":{
      "name":"error",
      "length":184,
      "severity":"ERROR",
      "code":"23505",
      "detail":"Key (id)=(1) already exists.",
      "schema":"public",
      "table":"projects",
      "constraint":"projects_id_pk",
      "file":"nbtinsert.c",
      "line":"406",
      "routine":"_bt_check_unique",
      "isBoom":true,
      "data":null,
      "output":{
         "statusCode":500,
         "payload":{
            "statusCode":500,
            "error":"Internal Server Error",
            "message":"An internal server error occurred"
         }
      }
}

Subsequent tries seemed to work fine.

k88hudson avatar May 20 '15 00:05 k88hudson

This concerns me... project.id is a bigserial type (auto incrementing bigint), which shouldn't ever try to create a row with a duped project id...

cadecairos avatar May 20 '15 16:05 cadecairos

I've yet to encounter this issue, can we backlog it?

cadecairos avatar May 27 '15 20:05 cadecairos

cc/ @thisandagain

cadecairos avatar May 27 '15 20:05 cadecairos

Yup. Let's do it.

thisandagain avatar May 27 '15 20:05 thisandagain