forms icon indicating copy to clipboard operation
forms copied to clipboard

Cron cleanup: Did expect one result but found none

Open solracsf opened this issue 1 month ago • 2 comments

NC 31.0.11 Forms 5.2.3

{
  "reqId": "fOa37UIcRtj3G9oKw1Nn",
  "level": 3,
  "time": "2025-11-23T21:33:22+01:00",
  "remoteAddr": "",
  "user": "--",
  "app": "core",
  "method": "",
  "url": "--",
  "message": "Error while running background job OCA\\Forms\\BackgroundJob\\CleanupUploadedFilesJob (id: 4910295, arguments: null)",
  "userAgent": "--",
  "version": "31.0.11.2",
  "exception": {
    "Exception": "OCP\\AppFramework\\Db\\DoesNotExistException",
    "Message": "Did expect one result but found none when executing: query \"SELECT * FROM `*PREFIX*forms_v2_forms` WHERE `id` = :dcValue1\"; ",
    "Code": 0,
    "Trace": [
      {
        "file": "/var/www/nextcloud/lib/public/AppFramework/Db/QBMapper.php",
        "line": 375,
        "function": "findOneQuery",
        "class": "OCP\\AppFramework\\Db\\QBMapper",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/apps/forms/lib/Db/FormMapper.php",
        "line": 76,
        "function": "findEntity",
        "class": "OCP\\AppFramework\\Db\\QBMapper",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/apps/forms/lib/BackgroundJob/CleanupUploadedFilesJob.php",
        "line": 54,
        "function": "findById",
        "class": "OCA\\Forms\\Db\\FormMapper",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/public/BackgroundJob/Job.php",
        "line": 61,
        "function": "run",
        "class": "OCA\\Forms\\BackgroundJob\\CleanupUploadedFilesJob",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php",
        "line": 97,
        "function": "start",
        "class": "OCP\\BackgroundJob\\Job",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php",
        "line": 84,
        "function": "start",
        "class": "OCP\\BackgroundJob\\TimedJob",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/cron.php",
        "line": 170,
        "function": "execute",
        "class": "OCP\\BackgroundJob\\TimedJob",
        "type": "->"
      }
    ],
    "File": "/var/www/nextcloud/lib/public/AppFramework/Db/QBMapper.php",
    "Line": 277,
    "message": "Error while running background job OCA\\Forms\\BackgroundJob\\CleanupUploadedFilesJob (id: 4910295, arguments: null)",
    "exception": [],
    "CustomMessage": "Error while running background job OCA\\Forms\\BackgroundJob\\CleanupUploadedFilesJob (id: 4910295, arguments: null)"
  },
  "id": "6923757431273"
}

solracsf avatar Nov 23 '25 21:11 solracsf

The job fails here when the form gets deleted and there are uploaded and not submitted files for that form.

As a solution we could silently fail (and keep the files in the folders), or - from my point of view the better solution - integrate cleanup of unsubmitted files in the general file cleanup upon form deletion that will be implemented to fix #2676

@susnux @Koc what do you think?

Chartman123 avatar Nov 28 '25 08:11 Chartman123

As a solution we could silently fail (and keep the files in the folders), or - from my point of view the better solution - integrate cleanup of unsubmitted files in the general file cleanup upon form deletion that will be implemented to fix https://github.com/nextcloud/forms/issues/2676

Agree with your assessment

susnux avatar Nov 28 '25 13:11 susnux