Unique ID errors #3

Closed
opened 2025-08-23 07:35:50 +02:00 by jriou · 0 comments
Owner

Description

When the sequence of ID in the database is nearly full, collerd doesn't retry to find a new ID but returns this error instead:

msg="could not create note" error="UNIQUE constraint failed: notes.id"

How to reproduce

Reduce the ID length to quickly reproduce the issue:

collerd.json:

{
  "listen_port": 8082,
  "id_length": 1
}

Start the server:

collerd -config collerd.json

In another terminal, create notes in a loop:

$ for i in $(seq 1 10) ; do ./bin/coller -no-password -url http://localhost:8082; done;
time=2025-08-23T07:31:05.596+02:00 level=ERROR msg="could not create note" error="UNIQUE constraint failed: notes.id"
http://localhost:8082/w
time=2025-08-23T07:31:05.614+02:00 level=ERROR msg="could not create note" error="UNIQUE constraint failed: notes.id"
http://localhost:8082/Y
http://localhost:8082/9
http://localhost:8082/J
time=2025-08-23T07:31:05.648+02:00 level=ERROR msg="could not create note" error="UNIQUE constraint failed: notes.id"
http://localhost:8082/C
http://localhost:8082/x
http://localhost:8082/e
# Description When the sequence of ID in the database is nearly full, collerd doesn't retry to find a new ID but returns this error instead: ``` msg="could not create note" error="UNIQUE constraint failed: notes.id" ``` # How to reproduce Reduce the ID length to quickly reproduce the issue: collerd.json: ```json { "listen_port": 8082, "id_length": 1 } ``` Start the server: ``` collerd -config collerd.json ``` In another terminal, create notes in a loop: ``` $ for i in $(seq 1 10) ; do ./bin/coller -no-password -url http://localhost:8082; done; time=2025-08-23T07:31:05.596+02:00 level=ERROR msg="could not create note" error="UNIQUE constraint failed: notes.id" http://localhost:8082/w time=2025-08-23T07:31:05.614+02:00 level=ERROR msg="could not create note" error="UNIQUE constraint failed: notes.id" http://localhost:8082/Y http://localhost:8082/9 http://localhost:8082/J time=2025-08-23T07:31:05.648+02:00 level=ERROR msg="could not create note" error="UNIQUE constraint failed: notes.id" http://localhost:8082/C http://localhost:8082/x http://localhost:8082/e ```
jriou closed this issue 2025-08-24 15:16:09 +02:00
jriou self-assigned this 2025-08-26 09:27:24 +02:00
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: jriou/coller#3
No description provided.