Every Time i delete on the ios Client pictures i get an 502 Error

#1

Nextcloud version (eg, 12.0.2): 15.07
Operating system and version (eg, Ubuntu 17.04): 18.04
Apache or nginx version (eg, Apache 2.4.25): nginx version: nginx/1.14.0
PHP version (eg, 7.1): 7.3

The issue you are facing:

i got an 502 Error when i try to delete some Pictures over the Media Tap.

Is this the first time you’ve seen this error? (Y/N): Yes

Steps to replicate it:

  1. open the Nextcloud iOS App
  2. go to the media Tab and select few Pictures (More then 10)
  3. Click on delete

The output of your Nextcloud log in Admin > Logging:

[index] Error: Doctrine\DBAL\Exception\DriverException: An exception occurred while executing 'UPDATE `oc_filecache` SET `mtime` = GREATEST(`mtime`, ?), `etag` = ? WHERE (`storage` = ?) AND (`path_hash` IN ('d41d8cd98f00b204e9800998ecf8427e', '5daaf223b01f8f3e1bd9287170826fbc', 'cf498b17a24a54a1a59b325812a2ac55', '9e290de8aa7cce634ce5c0dabd05067d'))' with params [1555865486, "5cbc9f8e0707a", 10]:

SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction at <<closure>>

 0. /var/www/cloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php line 128
    convertException("An exception oc ... n", Doctrine\DBAL\Dr ... ]})
 1. /var/www/cloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php line 1015
    driverExceptionDuringQuery(Doctrine\DBAL\Driver\PDOMySql\Driver {}, Doctrine\DBAL\Dr ... ]}, "UPDATE `oc_file ... )", {1: 1555865486,2: "5cbc9f8e0707a",3: 10})
 2. /var/www/cloud/lib/private/DB/Connection.php line 216
    executeUpdate("UPDATE `oc_file ... )", [1555865486,"5cbc9f8e0707a",10], [1,2,1])
 3. /var/www/cloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php line 208
    executeUpdate("UPDATE `oc_file ... )", {dcValue1: 15558 ... 0}, {dcValue1: 1,dcValue2: 2,dcValue3: 1})
 4. /var/www/cloud/lib/private/DB/QueryBuilder/QueryBuilder.php line 214
    execute()
 5. /var/www/cloud/lib/private/Files/Cache/Propagator.php line 90
    execute()
 6. /var/www/cloud/lib/private/Files/View.php line 1337
    propagateChange("Photos/2019/03/ ... g", 1555865486)
 7. /var/www/cloud/lib/private/Files/View.php line 1376
    getCacheEntry(OCA\RansomwarePr ... l}, "Photos/2019/03/ ... g", "/larsNC/files/N ... g")
 8. /var/www/cloud/lib/private/Files/Node/Root.php line 198
    getFileInfo("/larsNC/files/N ... g")
 9. /var/www/cloud/lib/private/Files/Node/Folder.php line 134
    get("/larsNC/files/N ... g")
10. /var/www/cloud/core/Controller/PreviewController.php line 105
    get("Nextcloud/Photo ... g")
11. /var/www/cloud/lib/private/AppFramework/Http/Dispatcher.php line 166
    getPreview("Nextcloud/Photo ... g", 310, 672, true, true, "cover")
12. /var/www/cloud/lib/private/AppFramework/Http/Dispatcher.php line 99
    executeController(OC\Core\Controller\PreviewController {}, "getPreview")
13. /var/www/cloud/lib/private/AppFramework/App.php line 118
    dispatch(OC\Core\Controller\PreviewController {}, "getPreview")
14. /var/www/cloud/lib/private/AppFramework/Routing/RouteActionHandler.php line 47
    main("OC\\Core\\Controller\\PreviewController", "getPreview", OC\AppFramework\ ... {}, {_route: "core.Preview.getPreview"})
15. <<closure>>
    __invoke({_route: "core.Preview.getPreview"})
16. /var/www/cloud/lib/private/Route/Router.php line 297
    call_user_func(OC\AppFramework\ ... {}, {_route: "core.Preview.getPreview"})
17. /var/www/cloud/lib/base.php line 987
    match("/core/preview.png")
18. /var/www/cloud/index.php line 42
    handleRequest()

GET /index.php/core/preview.png?file=Nextcloud/Photos/2019/03/19-03-01%2012-28-56%200010.png&x=310&y=672&a=1&mode=cover
from 79.231.209.96 by larsNC at 2019-04-21T16:55:27+00:00

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

PASTE HERE

The output of your Apache/nginx/system log in /var/log/____:

Nginx/error.log

2019/04/21 18:48:56 [error] 15307#15307: *256040 connect() to unix:/run/php/php7                                                                                                                                                             .3-fpm.sock failed (11: Resource temporarily unavailable) while connecting to up                                                                                                                                                             stream, client: 79.231.209.96, server: cloud.larsmueller.net, request: "GET /ind                                                                                                                                                             ex.php/core/preview.png?file=Nextcloud/Photos/Nut.jpg&x=310&y=672&a=1&mode=cover                                                                                                                                                              HTTP/2.0", upstream: "fastcgi://unix:/run/php/php7.3-fpm.sock:", host: "cloud.l                                                                                                                                                             arsmueller.net"

php 7.3-fpm.log

[21-Apr-2019 18:47:28] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 32 children, there are 0 idle, and 69 total children

i set it to /etc/php/7.3/fpm/pool.d/www.conf

pm = dynamic
pm.max_children = 120
pm.start_servers = 12
pm.min_spare_servers = 6
pm.max_spare_servers = 18