sist2 icon indicating copy to clipboard operation
sist2 copied to clipboard

Incremental scan cannot open old index

Open gostapit opened this issue 2 years ago • 4 comments

sist2 version: 2.11.7

Platform (Linux or Docker, x86-64 or arm64): 4.18.0-193.14.2.el8_2.x86_64

Elasticsearch version: 7.9.2

Command with arguments: /opt/sist2/sist2-x64-linux-debug scan -t 4 /media/skaner --incremental=/opt/sist2/media-skaner -o /opt/sist2/media-skaner-tmp

I have this script to do incremental scan and index.

If i run it first time everything works fine:

/opt/sist2/sist2-x64-linux-debug scan -t 2 /media/skaner -o /opt/sist2/media-skaner

On the second run: /opt/sist2/sist2-x64-linux-debug scan -t 2 /media/skaner --incremental=/opt/sist2/media-skaner -o /opt/sist2/media-skaner-tmp

i get:

[7F6A6E804AC0] [2022-04-04 08:18:37] [FATAL main.c] Could not open original main index for incremental scan: Success

Script i use:

#!/bin/bash
set -x

dir=/opt/sist2
sist=$dir/sist2-x64-linux
sist=$dir/sist2-x64-linux-debug
cd $dir

array=( media/skaner media/doc media/ses)

for i in "${array[@]}"
do

        j=$(echo $i | sed 's/\//-/')

        if  [ -d $j ]

        then
                 $sist scan -t 2 /$i --incremental=$j -o $j-tmp
                 rm -rf $j
                 mv $j-tmp $j

        else
                 $sist scan -t 2 /$i  -o $j

        fi
        $sist index -t 2 $j


        list="$list $j"

done


$sist web --bind=192.168.4.18:8081 --auth=a:b  $list

If i remove index files and folders first scan and index completes and starts webserver. Second run gives me scan errors and blank screen during index. I don't want to repeat full scan every time.

gostapit avatar Apr 04 '22 07:04 gostapit

Could you give more information about your OS (which distro etc.) ? I can't seem to reproduce that error on my side

simon987 avatar Apr 17 '22 17:04 simon987

Did you ever get this fixed? I am having the same problem, in docker and as binary on debian.

Badlee2020 avatar Aug 02 '22 04:08 Badlee2020

After a lot of testing, the incremental scan is a bit buggy:

Incremental scan only worked in my test (no errors) when new files were added to the folder being scanned.

the bugs I found that produced this error "Could not open original main index for incremental scan:":

  • incremental scan without changes in the folder to be scanned (worked once, the second time it gave the error)
  • incremental scan with deleting files in folder being scanned (worked once, the second time it gave the error)

it seems as if the original index is not being copied over to the new index when there are no file changes or deletion of files

Badlee2020 avatar Aug 03 '22 07:08 Badlee2020

thanks this will be fixed in an upcoming update

simon987 avatar Aug 03 '22 22:08 simon987

Fixed in c18557e360b30f6bba5c1c767ac30aab23185dda, will be included in the next update 2.13.0

simon987 avatar Nov 24 '22 01:11 simon987