-
-
Notifications
You must be signed in to change notification settings - Fork 47
More than 1000 expressions in list are not allowed on Oracle #786
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Same here: QueryException: More than 1000 expressions in a list are not allowed on Oracle. "File": "/var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php", Server configuration |
This issue must have been here for some time. Batches contain a minimum of 2000 faces if the hidden setting is not changed. Confusingly, I couldn't find any code to disable batches if there are more than 25k faces, as the docs say. Also, I'm not using Oracle as the DB, but postgresql, and still get the same message as above. afaik postgresql has no limit of values for the IN clause, which Oracle have
|
I will restart indexing now. Let's see how it goes. |
Did not work... Rewrote this function in lib/Db/FaceMapper.php:
Edit: Edited to the version that works after testing and debugging. I have Postgres - might not work for mariadb or sqlite. Will update again if needed |
I'm seeing this as well (on Mariadb 10.11) and found that NextCloud upstream fixed this by pagination: https://github.com/nextcloud/server/blob/master/lib/private/Comments/Manager.php#L673 Doing it this way should work across DB platforms since it's using the Symfony backend. |
That was my initial solution as well but I thought it might reduce performance so went with the current approach instead |
I switched over to this chunk approach: public function findDescriptorsBathed (array $faceIds): array {
$qb = $this->db->getQueryBuilder();
$qb->select('id', 'descriptor')
->from($this->getTableName(), 'f')
->where($qb->expr()->in('id', $qb->createParameter('face_ids')));
$descriptors = array_fill(0, sizeof($faceIds), 0);
$arrayindex = 0;
foreach (array_chunk($faceIds, 1000) as $chunk) {
$qb->setParameter('face_ids', $chunk, IQueryBuilder::PARAM_INT_ARRAY);
$result = $qb->executeQuery();
while ($row = $result->fetch()) {
$descriptors[$arrayindex] = [
'id' => $row['id'],
'descriptor' => json_decode($row['descriptor'])
];
$arrayindex++;
}
$result->closeCursor();
}
return $descriptors;
} |
After trying a few fancy stuff for better efficiency, I ended up implementing something similar to what you did |
This seems to have worked for me as well (on MariaDB) - Thanks! I just finished a cron run without it blowing up journald. |
Can this please be fixed with the code change as a pull request? I'm getting the exact same issue (with MariaDB). Thanks. |
Does anyone need funding to deliver these fixes or restart this project? I can furnish some. |
Same here. Any progress? |
same here, I am not a coder, and I do not dare to edit the files. Can we expect the fix to be released officially @matiasdelellis ? I have some 500 errors if this type in my log... |
Hi.. Sorry for the delay. I opted for a much simpler approach, but I'm considering other changes. Please confirm if the latest version works. |
I am still using NC30 though, because I have AIO. So I will likely have to wait for the latest release to be available |
OHh.. You're right.. I'm waiting for confirmation from nc31 and I'll send the same patch for nc30 |
The fix is 150acd3? Isn't it just for sqlite db? |
For me 150acd3 didn't fix the issue. I'm using mariaDB. Since installation of the latest version the log entries are back again. |
I confirm this as well. Spamming journald hard here. I had been using this hack before the recent update and it worked: #786 (comment) . After the update, it broke again. I then replaced that function with the one from that comment and didn't get that message again the next time the cron ran. |
Same problem with latest version. The patch proposed on #786 (comment) seems to fix the problem. |
Hey, Thanks for reporting issues back to Nextcloud Face Recognition. Please, try to complete this report in detail so we can help you easier. 😄
Make sure you read all the documentation, and the FAQ, and that the issue has not been reported before. 😉
Expected behaviour
No error
Actual behaviour
Error logged saying more than 1000 expressions not allowed
Steps to reproduce
Server configuration
Operating system:
Unraid. AIO install
Pdlib version:
How is DLib installed: Make sure it is working correctly with this tool
Container
How is PDlib installed: Make sure it is working correctly with this tool
PHP version:
Web server:
Database: Postgres
Nextcloud version: 30
Client configuration
Browser:
Operating system:
Logs
Background task log with debug.
sudo -u apache php occ -vvv face:background_job
Web server error log
Web server error log
Nextcloud log (data/nextcloud.log)
Nextcloud log
Browser log
Browser log
The text was updated successfully, but these errors were encountered: