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.

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 $