Maps App stalls while scanning photos

Thank you for your hint with OCC. Now I see what’s the Error: After several thousands files I am getting this message (* marked out)

In AbstractMySQLDriver.php line 53:
                                                                                                                                                                       
  An exception occurred while executing 'UPDATE `oc_file_locks` SET `lock` = `lock` + 1, `ttl` = ? WHERE `key` = ? AND `lock` >= 0' with params [1567960279, "files\/  
  ************************"]:                                                                                                                                  
                                                                                                                                                                       
  SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction                                                      
                                                                                                                                                                       

In PDOStatement.php line 143:
                                                                                                                   
  SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction  
                                                                                                                   

In PDOStatement.php line 141:
                                                                                                                   
  SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction