api.webmaker.org
api.webmaker.org copied to clipboard
500 error when trying to create a new project
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.
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...
I've yet to encounter this issue, can we backlog it?
cc/ @thisandagain
Yup. Let's do it.