Potential breaking change in next Joplin Server update (2.5.10)

I was able to upgrade and everything worked fine, and then my syncing stopped working about 2-3 days later

image

Any ideas?

We need the full log client side and server side, and please don't upload that as 50 screenshots.

Attached via google, client log was too big, and server log was uploading at dial up speed.

https://drive.google.com/drive/folders/1cjHWwHTyzvailwq96y1K0YzKbUJlYfy3?usp=sharing

Also, not sure if this will be the correct server log that you want. Was unable to locate log file so did a "docker logs --folllow and output to this txt file.

@laurent

Any update on this?

The log you attached doesn't include the error from your screenshot.

@laurent

Hm, when I run docker logs --follow it shows the error, although a docker logs -- follow > log.txt does not, How can I obtain this for you?

The log.txt you just mentioned should work, or maybe copy and paste the text from your terminal, provided it's all on the same screen.

2021-12-07 07:19:36: [error] App: 200.100.1.1 {
code: '23505',
message: 'insert into "items" ("content_size", "content_storage_id", "created_time", "id", "mime_type", "name", "owner_id", "updated_time") values ($1, $2, $3, $4, $5, $6, $7, $8) - duplicate key value violates unique constraint "items_name_owner_id_unique"'
}
2021-12-07 07:19:36: App: PUT /api/items/root:/locks/sync_desktop_1fca3215cd2e40e790d513d275eea09f.json:/content (500) (139ms)
2021-12-07 07:19:47: [error] App: 200.100.1.1 {
code: '23505',
message: 'insert into "items" ("content_size", "content_storage_id", "created_time", "id", "mime_type", "name", "owner_id", "updated_time") values ($1, $2, $3, $4, $5, $6, $7, $8) - duplicate key value violates unique constraint "items_name_owner_id_unique"'
}
2021-12-07 07:19:47: App: PUT /api/items/root:/locks/sync_desktop_1fca3215cd2e40e790d513d275eea09f.json:/content (500) (141ms)
2021-12-07 07:19:47: App: DELETE /api/items/root:/locks/sync_desktop_1fca3215cd2e40e790d513d275eea09f.json: (200) (10ms)
2021-12-07 07:19:47: App: GET /api/share_users (200) (3ms)
2021-12-07 07:19:47: App: GET /api/shares (200) (9ms)
2021-12-07 07:24:48: App: GET /api/items/root:/info.json:/content (200) (172ms)
2021-12-07 07:24:48: App: GET /api/items/root:/locks/:/children (200) (419ms)
2021-12-07 07:24:48: App: GET /api/items/root:/locks/
:/children (200) (527ms)
2021-12-07 07:24:48: App: PUT /api/items/root:/temp/timeCheck324139.txt:/content (200) (173ms)
2021-12-07 07:24:48: App: GET /api/items/root:/temp/timeCheck324139.txt: (200) (3ms)
2021-12-07 07:24:49: App: PUT /api/items/root:/locks/sync_desktop_1fca3215cd2e40e790d513d275eea09f.json:/content (500) (94ms)
2021-12-07 07:24:49: [error] App: 200.100.1.1 {
code: '23505',
message: 'insert into "items" ("content_size", "content_storage_id", "created_time", "id", "mime_type", "name", "owner_id", "updated_time") values ($1, $2, $3, $4, $5, $6, $7, $8) - duplicate key value violates unique constraint "items_name_owner_id_unique"'
}
2021-12-07 07:24:49: App: DELETE /api/items/root:/temp/timeCheck324139.txt: (200) (97ms)
2021-12-07 07:24:56: App: PUT /api/items/root:/locks/sync_desktop_1fca3215cd2e40e790d513d275eea09f.json:/content (500) (19ms)
2021-12-07 07:24:56: [error] App: 200.100.1.1 {
code: '23505',
message: 'insert into "items" ("content_size", "content_storage_id", "created_time", "id", "mime_type", "name", "owner_id", "updated_time") values ($1, $2, $3, $4, $5, $6, $7, $8) - duplicate key value violates unique constraint "items_name_owner_id_unique"'
}
2021-12-07 07:25:03: [error] App: 200.100.1.1 {
code: '23505',
2021-12-07 07:25:03: App: PUT /api/items/root:/locks/sync_desktop_1fca3215cd2e40e790d513d275eea09f.json:/content (500) (45ms)
message: 'insert into "items" ("content_size", "content_storage_id", "created_time", "id", "mime_type", "name", "owner_id", "updated_time") values ($1, $2, $3, $4, $5, $6, $7, $8) - duplicate key value violates unique constraint "items_name_owner_id_unique"'
}
2021-12-07 07:25:13: [error] App: 200.100.1.1 {
code: '23505',
message: 'insert into "items" ("content_size", "content_storage_id", "created_time", "id", "mime_type", "name", "owner_id", "updated_time") values ($1, $2, $3, $4, $5, $6, $7, $8) - duplicate key value violates unique constraint "items_name_owner_id_unique"'
}
2021-12-07 07:25:13: App: PUT /api/items/root:/locks/sync_desktop_1fca3215cd2e40e790d513d275eea09f.json:/content (500) (7ms)
2021-12-07 07:25:13: App: DELETE /api/items/root:/locks/sync_desktop_1fca3215cd2e40e790d513d275eea09f.json: (200) (3ms)
2021-12-07 07:25:13: App: GET /api/share_users (200) (4ms)
2021-12-07 07:25:13: App: GET /api/shares (200) (4ms)

You can ignore these errors. What's the error, client side?

2021-12-03 14:20:18: "DecryptionWorker: cannot start because no master key is currently loaded."
2021-12-03 14:25:14: RevisionService: "RevisionService::maintenance: Starting..."
2021-12-03 14:25:14: RevisionService: "RevisionService::maintenance: Service is enabled"
2021-12-03 14:25:14: RevisionService: "RevisionService::collectRevisions: Created revisions for 0 notes"
2021-12-03 14:25:14: RevisionService: "RevisionService::maintenance: Done in 115ms"
2021-12-03 14:25:17: "Running background sync on timer..."
2021-12-03 14:25:17: "Preparing scheduled sync"
2021-12-03 14:25:17: "Starting scheduled sync"
2021-12-03 14:25:17: Synchronizer: "Sync: starting: Starting synchronisation to target 9... supportsAccurateTimestamp = true; supportsMultiPut = true [1638563117275]"
2021-12-03 14:25:17: Synchronizer: "Indexing resources..."
2021-12-03 14:25:17: "ResourceService::indexNoteResources: Start"
2021-12-03 14:25:17: "ResourceService::indexNoteResources: Completed"
2021-12-03 14:25:17: Synchronizer: "Sync target remote info:", "{"version_":3,"masterKeys_":[],"e2ee_":{"value":false,"updatedTime":0},"activeMasterKeyId_":{"value":"","updatedTime":0},"ppk_":{"value":null,"updatedTime":0}}"
2021-12-03 14:25:17: Synchronizer: "Sync target is already setup - checking it..."
2021-12-03 14:25:17: Synchronizer: "Sync target local info:", "{"version_":3,"masterKeys_":[],"e2ee_":{"value":false,"updatedTime":0},"activeMasterKeyId_":{"value":"","updatedTime":0},"ppk_":{"value":null,"updatedTime":0}}"
2021-12-03 14:25:17: JoplinServerApi: "curl -v -X PUT -H "Content-Type: application/octet-stream" -H "X-API-AUTH: ******" -H "X-API-MIN-VERSION: 2.1.4" -H "Content-Length: 84" --data '{"type":"sync","clientType":"desktop","clientId":"1fca3215cd2e40e790d513d275eea09f"}' 'https://kvm.heyzzeus.com/joplin/api/items/root:/locks/sync_desktop_1fca3215cd2e40e790d513d275eea09f.json:/content'"
2021-12-03 14:25:17: JoplinServerApi: "Error: insert into "items" ("content_size", "content_storage_id", "created_time", "id", "mime_type", "name", "owner_id", "updated_time") values ($1, $2, $3, $4, $5, $6, $7, $8) - duplicate key value violates unique constraint "items_name_owner_id_unique"
Code: 23505
Error: insert into "items" ("content_size", "content_storage_id", "created_time", "id", "mime_type", "name", "owner_id", "updated_time") values ($1, $2, $3, $4, $5, $6, $7, $8) - duplicate key value violates unique constraint "items_name_owner_id_unique"
at newError (C:\Program Files\Joplin\resources\app.asar\node_modules@joplin\lib\JoplinServerApi.js:191:28)
at JoplinServerApi. (C:\Program Files\Joplin\resources\app.asar\node_modules@joplin\lib\JoplinServerApi.js:215:31)
at Generator.next ()
at fulfilled (C:\Program Files\Joplin\resources\app.asar\node_modules@joplin\lib\JoplinServerApi.js:5:58)
at processTicksAndRejections (internal/process/task_queues.js:95:5)"
2021-12-03 14:25:21: JoplinServerApi: "curl -v -X PUT -H "Content-Type: application/octet-stream" -H "X-API-AUTH: ******" -H "X-API-MIN-VERSION: 2.1.4" -H "Content-Length: 84" --data '{"type":"sync","clientType":"desktop","clientId":"1fca3215cd2e40e790d513d275eea09f"}' 'https://kvm.heyzzeus.com/joplin/api/items/root:/locks/sync_desktop_1fca3215cd2e40e790d513d275eea09f.json:/content'"
2021-12-03 14:25:21: JoplinServerApi: "Error: insert into "items" ("content_size", "content_storage_id", "created_time", "id", "mime_type", "name", "owner_id", "updated_time") values ($1, $2, $3, $4, $5, $6, $7, $8) - duplicate key value violates unique constraint "items_name_owner_id_unique"
Code: 23505
Error: insert into "items" ("content_size", "content_storage_id", "created_time", "id", "mime_type", "name", "owner_id", "updated_time") values ($1, $2, $3, $4, $5, $6, $7, $8) - duplicate key value violates unique constraint "items_name_owner_id_unique"
at newError (C:\Program Files\Joplin\resources\app.asar\node_modules@joplin\lib\JoplinServerApi.js:191:28)
at JoplinServerApi. (C:\Program Files\Joplin\resources\app.asar\node_modules@joplin\lib\JoplinServerApi.js:215:31)
at Generator.next ()
at fulfilled (C:\Program Files\Joplin\resources\app.asar\node_modules@joplin\lib\JoplinServerApi.js:5:58)
at processTicksAndRejections (internal/process/task_queues.js:95:5)"
2021-12-03 14:25:28: JoplinServerApi: "curl -v -X PUT -H "Content-Type: application/octet-stream" -H "X-API-AUTH: ******" -H "X-API-MIN-VERSION: 2.1.4" -H "Content-Length: 84" --data '{"type":"sync","clientType":"desktop","clientId":"1fca3215cd2e40e790d513d275eea09f"}' 'https://kvm.heyzzeus.com/joplin/api/items/root:/locks/sync_desktop_1fca3215cd2e40e790d513d275eea09f.json:/content'"
2021-12-03 14:25:28: JoplinServerApi: "Error: insert into "items" ("content_size", "content_storage_id", "created_time", "id", "mime_type", "name", "owner_id", "updated_time") values ($1, $2, $3, $4, $5, $6, $7, $8) - duplicate key value violates unique constraint "items_name_owner_id_unique"
Code: 23505
Error: insert into "items" ("content_size", "content_storage_id", "created_time", "id", "mime_type", "name", "owner_id", "updated_time") values ($1, $2, $3, $4, $5, $6, $7, $8) - duplicate key value violates unique constraint "items_name_owner_id_unique"
at newError (C:\Program Files\Joplin\resources\app.asar\node_modules@joplin\lib\JoplinServerApi.js:191:28)
at JoplinServerApi. (C:\Program Files\Joplin\resources\app.asar\node_modules@joplin\lib\JoplinServerApi.js:215:31)
at Generator.next ()
at fulfilled (C:\Program Files\Joplin\resources\app.asar\node_modules@joplin\lib\JoplinServerApi.js:5:58)
at processTicksAndRejections (internal/process/task_queues.js:95:5)"
2021-12-03 14:25:39: JoplinServerApi: "curl -v -X PUT -H "Content-Type: application/octet-stream" -H "X-API-AUTH: ******" -H "X-API-MIN-VERSION: 2.1.4" -H "Content-Length: 84" --data '{"type":"sync","clientType":"desktop","clientId":"1fca3215cd2e40e790d513d275eea09f"}' 'https://kvm.heyzzeus.com/joplin/api/items/root:/locks/sync_desktop_1fca3215cd2e40e790d513d275eea09f.json:/content'"
2021-12-03 14:25:39: JoplinServerApi: "Error: insert into "items" ("content_size", "content_storage_id", "created_time", "id", "mime_type", "name", "owner_id", "updated_time") values ($1, $2, $3, $4, $5, $6, $7, $8) - duplicate key value violates unique constraint "items_name_owner_id_unique"
Code: 23505
Error: insert into "items" ("content_size", "content_storage_id", "created_time", "id", "mime_type", "name", "owner_id", "updated_time") values ($1, $2, $3, $4, $5, $6, $7, $8) - duplicate key value violates unique constraint "items_name_owner_id_unique"
at newError (C:\Program Files\Joplin\resources\app.asar\node_modules@joplin\lib\JoplinServerApi.js:191:28)
at JoplinServerApi. (C:\Program Files\Joplin\resources\app.asar\node_modules@joplin\lib\JoplinServerApi.js:215:31)
at Generator.next ()
at fulfilled (C:\Program Files\Joplin\resources\app.asar\node_modules@joplin\lib\JoplinServerApi.js:5:58)
at processTicksAndRejections (internal/process/task_queues.js:95:5)"
2021-12-03 14:25:39: Synchronizer: "Error: insert into "items" ("content_size", "content_storage_id", "created_time", "id", "mime_type", "name", "owner_id", "updated_time") values ($1, $2, $3, $4, $5, $6, $7, $8) - duplicate key value violates unique constraint "items_name_owner_id_unique"
Code: 23505
Error: insert into "items" ("content_size", "content_storage_id", "created_time", "id", "mime_type", "name", "owner_id", "updated_time") values ($1, $2, $3, $4, $5, $6, $7, $8) - duplicate key value violates unique constraint "items_name_owner_id_unique"
at newError (C:\Program Files\Joplin\resources\app.asar\node_modules@joplin\lib\JoplinServerApi.js:191:28)
at JoplinServerApi. (C:\Program Files\Joplin\resources\app.asar\node_modules@joplin\lib\JoplinServerApi.js:215:31)
at Generator.next ()
at fulfilled (C:\Program Files\Joplin\resources\app.asar\node_modules@joplin\lib\JoplinServerApi.js:5:58)
at processTicksAndRejections (internal/process/task_queues.js:95:5)"
2021-12-03 14:25:39: Synchronizer: "Details:", "PUT api/items/root:/locks/sync_desktop_1fca3215cd2e40e790d513d275eea09f.json:/content: insert into "items" ("content_size", "content_storage_id", "created_time", "id", "mime_type", "name", "owner_id", "updated_time") values ($1, $2, $3, $4, $5, $6, $7, $8) - duplicate key value violates unique constraint "items_name_owner_id_unique" (23505): {"error":"insert into "items" ("content_size", "content_storage_id", "created_time", "id", "mime_type", "name", "owner_id", "updated_time") values ($1, $2, $3, $4, $5, $6, $7, $8) - duplicate key value violates unique constraint "items_name_owner_id_unique"","code":"23505"}"
2021-12-03 14:25:39: Synchronizer: "Sync: finished: Synchronisation finished [1638563117275]"
2021-12-03 14:25:39: Synchronizer: "Operations completed: "
2021-12-03 14:25:39: Synchronizer: "Total folders: 30"
2021-12-03 14:25:39: Synchronizer: "Total notes: 277"
2021-12-03 14:25:39: Synchronizer: "Total resources: 331"
2021-12-03 14:25:39: Synchronizer: "There was some errors:"
2021-12-03 14:25:39: Synchronizer: "Error: insert into "items" ("content_size", "content_storage_id", "created_time", "id", "mime_type", "name", "owner_id", "updated_time") values ($1, $2, $3, $4, $5, $6, $7, $8) - duplicate key value violates unique constraint "items_name_owner_id_unique"
Code: 23505
Error: insert into "items" ("content_size", "content_storage_id", "created_time", "id", "mime_type", "name", "owner_id", "updated_time") values ($1, $2, $3, $4, $5, $6, $7, $8) - duplicate key value violates unique constraint "items_name_owner_id_unique"
at newError (C:\Program Files\Joplin\resources\app.asar\node_modules@joplin\lib\JoplinServerApi.js:191:28)
at JoplinServerApi. (C:\Program Files\Joplin\resources\app.asar\node_modules@joplin\lib\JoplinServerApi.js:215:31)
at Generator.next ()
at fulfilled (C:\Program Files\Joplin\resources\app.asar\node_modules@joplin\lib\JoplinServerApi.js:5:58)
at processTicksAndRejections (internal/process/task_queues.js:95:5)"

It's not syncing my data any longer and this is all I have to go on currently

If you're still having this issue, please give a try to the latest pre-release:

https://discourse.joplinapp.org/t/pre-release-v2-6-is-now-available-updated-9-dec/21821/8

It solves some issues that could have caused this constraint error.

EDIT: Disregard, I've dropped the database, and started over. :slight_smile:

So the upgrade didn't work for me. Upon running the command (owner_id did not exist);

select count(*), name
from items group by name
having count(*) > 1;

I got a very long list of files/notes/resources.

..........
     2 | .resource/d187823454bb8c11a1ef4ed89cda9b45
     2 | .resource/d1980929c5fab6813394d3f1b15397f7
     2 | .resource/d89746888da2d9510b64a9f031eaecd5
     2 | .resource/dbaad4432ff19b521d3ed9f281f2b718
     2 | .resource/df3e567d6f16d040326c7a0ea29a4f41
     2 | .resource/e2985fefa1638c082186d36fd5f78b01
     2 | .resource/e49a69a7be25bc87af36d5545ab0baa2
     2 | .resource/e94bb2cf7bc285138eb166b201779768
     2 | .resource/ed280a0ea3cc38f3cbbc747acfbef47d
     2 | .resource/ee6b9c39521425bd589014da9609b820
     2 | .resource/f058206bb8ff732dbe8e7aa10d74c9cd
     2 | .resource/fbd3929a893b147ae0940d48d533e023
     2 | .resource/fc94fb0c3ed8a8f909dbc7630a0987ff
     2 | .sync/readme.txt
     2 | .sync/version.txt
     3 | temp/timeCheck276731.txt
(170 rows)

We are two users and have a fair number of notes. Is there any way to find out what I'm deleting, before I delete it?

Thanks!