Error: SqliteError: UNIQUE constraint failed: AssetFile.assetId, AssetFile.shown'

I’ve come across a new one, running 2.1.0-alpha.7 in docker on Ubuntu Server:

/ps/app $ ./photostructure sync /media/photos/2022/2022\ 07*
{"dbReady":true}
exit {
  reason: 'Error: SqliteError: UNIQUE constraint failed: AssetFile.assetId, AssetFile.shown',
  status: 13
}

Thanks for reporting–did you happen to have info or debug logging enabled, by chance? If so, could you email your logs to me please?

And in case you’re interested in what’s going on here: the AssetFile table has a constraint that prevents multiple file variations from being the “best” (aka “primary” or “shown”) for a given asset.

There’s an advisory lock acquired during file import that should prevent concurrent asset file imports happening for the same asset, but that lock may not have been acquired or held correctly.

1 Like

Will investigate the logs now (edit, yes set to INFO). I can report that there has been another instance for August (July is still broken):

/ps/app $ ./photostructure sync /media/photos/2022/2022\ 08*
{"dbReady":true}
exit {
  reason: 'Error: SqliteError: UNIQUE constraint failed: AssetFile.assetId, AssetFile.shown',
  status: 13
}
/ps/app $

Any luck on the logs @mrm? Can I furnish you with anything else that would help?

Sorry for the delay: I’ve been away from my desk. Your email is on my todo list for tomorrow morning.

Hi @mrm, just checking in to see if I can provide anything else. I’m generally blocked on ingesting new images because of this error.

I believe I’ve found and fixed the error, I’ll try to get a new build out soon.

1 Like