Handle errors during import more gracefully [Seafile Pro 7.1.11]


seaf-import.sh failed to import some folders with the following errors;

[          3.5%          ]^M[02/05/21 12:40:07] seaf-import.c(102): Failed to stat /storage-old/foobar/Pictures/iChat Icons.
[02/05/21 12:40:07] seaf-import.c(188): Failed to import dir /storage-old/foobar to repo d147fa11, import failed.
 run done

Turns out it’s symlinks pointing to non-existant files;

lrwxrwx--- 1 seafile seafile 47 Aug 28  2014 '/storage-old/foobar/Pictures/iChat Icons' -> '/Library/Application Support/Apple/iChat Icons/'

Maybe it should handle these more gracefully? In our case, it stopped a several days long import of 15+TB at 93%…

Give a warning (that could also be printed at the summary after completion), skip the import of the file, but don’t stop the import.

Now it happened again, this time with a different error. Should probably handle this also more gracefully; continue the import, and just list whatever files had issue for whatever reason at the end of the run, so that one can follow up on them (i.e. fix them manually).

[02/07/21 23:11:05] ../../common/fs-mgr.c(850): Failed to chunk file with CDC.
[02/07/21 23:11:05] seaf-import.c(113): Failed to index blocks for file /storage-old/foobar/somefolder/file.mov.
[02/07/21 23:11:05] seaf-import.c(188): Failed to import dir /storage-old/foobar to repo 99380db9, import failed.
 run done

Not sure what the issue is, but might be the permissions it complains about (even if the seafile user is the owner);

---------- 1 seafile seafile 40G Jun  8  2018 '/storage-old/foobar/somefolder/file.mov'