Endless loop when doing a sync --force after keyword reorganization

Expected Behavior

Force Resync to complete

Current Behavior

I’m working to get my keywords organized so occationally I want to do a resync with --force to pickup Keyword changes. Worth noting is that I did root tree renaming so it is expected that alot of existing tags in the database should be removed, I don’t know if that has something to do with this.

So i run ./photostructure sync --force but it seems to have encountered an endless loop. I enabled logging and also SQL-logging

{“ts”:1623835038309,“l”:“debug”,“ctx”:“DbRequest”,“msg”:“all(): select * from Tag order by id asc limit 128”}

{“ts”:1623835038309,“l”:“debug”,“ctx”:“DbRequest”,“msg”:“run(): insert into tag_fts (path, root, rowid) values (“Type Image”, “Type”, 8)”}

=||= (…I quess ~2500 rows with lots of tags, my removed tags included)

{“ts”:1623835038904,“l”:“debug”,“ctx”:“DbRequest”,“msg”:“run(): insert into tag_fts (path, root, rowid) values (“Keywords Locations Sverige Linköping”, “Keywords”, 2450)”}

{“ts”:1623835038904,“l”:“debug”,“ctx”:“DbRequest”,“msg”:“all(): select * from Tag where id > 2450 order by id asc limit 128”}
{“ts”:1623835038904,“l”:“warn”,“ctx”:“TagSql”,“msg”:“runTagMaintenance(): completed in 595ms”}
{“ts”:1623835044329,“l”:“info”,“ctx”:“Tag”,“msg”:“findByPath”,“meta”:{“tagPath”:[“fs”],“dbIsNull”:false}}
{“ts”:1623835044329,“l”:“debug”,“ctx”:“DbRequest”,“msg”:“get(): select * from Tag where _path like “fs\u001f””}
{“ts”:1623835044329,“l”:“debug”,“ctx”:“DbRequest”,“msg”:“all(): select * from Tag where parentId = 645 order by COALESCE(ordinal, _path) COLLATE NOCASE”}
{“ts”:1623835044329,“l”:“info”,“ctx”:“updateTagMountpoints()”,“msg”:“updated tag”,“meta”:{“id”:648,“path”:[“fs”,“3bkauEvc3”],“displayName”:“My Book Duo”}}
{“ts”:1623835044329,“l”:“debug”,“ctx”:“DbRequest”,“msg”:“get(): select mountpoint from AssetFile where uri like “psfile://e:/%” limit 1”}
{“ts”:1623835044329,“l”:“debug”,“ctx”:“updateTagMountpoints()”,“msg”:“cannot update tag: no current volume.”,“meta”:{“id”:2143,“path”:[“fs”,“e:”]}}
{“ts”:1623835044329,“l”:“info”,“ctx”:“updateTagMountpoints()”,“msg”:“updated tag”,“meta”:{“id”:1883,“path”:[“fs”,“TNjQAVZj4”],“displayName”:“App”}}
{“ts”:1623835044329,“l”:“debug”,“ctx”:“DbRequest”,“msg”:“all(): WITH RECURSIVE ancestors(id) AS ( SELECT tagId FROM ChangedTag UNION SELECT Tag.parentId FROM Tag, ancestors WHERE Tag.id = ancestors.id ) SELECT id FROM ancestors”}
{“ts”:1623835044329,“l”:“debug”,“ctx”:“DbRequest”,“msg”:“run(): INSERT INTO tag_fts(tag_fts) VALUES(‘delete-all’)”}
{“ts”:1623835044329,“l”:“debug”,“ctx”:“DbRequest”,“msg”:“all(): select * from Tag order by id asc limit 128”}

And then it just seems to repeat the above over and over again.

Steps to Reproduce

Environment

Windows 2019 Server, Node
Beta7

Thanks for taking the time to report this!

I’ve rewritten the tag mountpoint update code in beta.8, so I expect this issue to be resolved as soon as I push this build.

Beta.9 is out: is this fixed for you?

Yes :slight_smile: , it has not completed yet (inprogress) but it has gone past where it looped before, happened directly at start. So this can be closed :+1: