groupfolders icon indicating copy to clipboard operation
groupfolders copied to clipboard

Error while running background job OCA\\GroupFolders\\BackgroundJob\\ExpireGroupVersions

Open jmechnich opened this issue 9 months ago β€’ 6 comments

How to use GitHub

  • Please use the πŸ‘ reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Steps to reproduce

  1. Upgrade to NC 29.0.0
  2. Make sure at least one group folder exists
  3. Wait for error to appear in log, triggered by hourly cron job

Expected behaviour

No error.

Actual behaviour

The following error shows up in log (see below for full backtrace).

"Exception": "TypeError",
"Message": "OCA\\Files_Versions\\Versions\\Version::__construct(): Argument #10 ($metadata) must be of type array, string given, called in /var/www/nextcloud/apps/groupfolders/lib/Versions/GroupVersion.php on line 47",

Server configuration

Operating system: Debian 12 (bookworm)

Web server: nginx 1.22.1

Database: mariadb 15.1

PHP version: PHP 8.2.18

Nextcloud version: (see Nextcloud admin page) Nextcloud Hub 8 (29.0.0)

Group folders version: Group folders 16.0.6

Updated from an older Nextcloud/ownCloud or fresh install: Updated from NC 28.0.4

Are you using encryption: yes/no no

Logs

Full error entry from Nextcloud log:

{
  "reqId": "GiZkyjDaSMBPSGQqtkdE",
  "level": 3,
  "time": "2024-04-25T12:38:38+02:00",
  "remoteAddr": "",
  "user": "--",
  "app": "core",
  "method": "",
  "url": "--",
  "message": "Error while running background job OCA\\GroupFolders\\BackgroundJob\\ExpireGroupVersions (id: 81, arguments: null)",
  "userAgent": "--",
  "version": "29.0.0.19",
  "exception": {
    "Exception": "TypeError",
    "Message": "OCA\\Files_Versions\\Versions\\Version::__construct(): Argument #10 ($metadata) must be of type array, string given, called in /var/www/nextcloud/apps/groupfolders/lib/Versions/GroupVersion.php on line 47",
    "Code": 0,
    "Trace": [
      {
        "file": "/var/www/nextcloud/apps/groupfolders/lib/Versions/GroupVersion.php",
        "line": 47,
        "function": "__construct",
        "class": "OCA\\Files_Versions\\Versions\\Version",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/apps/groupfolders/lib/Versions/VersionsBackend.php",
        "line": 158,
        "function": "__construct",
        "class": "OCA\\GroupFolders\\Versions\\GroupVersion",
        "type": "->"
      },
      {
        "function": "OCA\\GroupFolders\\Versions\\{closure}",
        "class": "OCA\\GroupFolders\\Versions\\VersionsBackend",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/var/www/nextcloud/apps/groupfolders/lib/Versions/VersionsBackend.php",
        "line": 142,
        "function": "array_map"
      },
      {
        "file": "/var/www/nextcloud/apps/groupfolders/lib/Versions/VersionsBackend.php",
        "line": 80,
        "function": "getVersionsForFileFromDB",
        "class": "OCA\\GroupFolders\\Versions\\VersionsBackend",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/apps/groupfolders/lib/Versions/GroupVersionsExpireManager.php",
        "line": 81,
        "function": "getVersionsForFile",
        "class": "OCA\\GroupFolders\\Versions\\VersionsBackend",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/apps/groupfolders/lib/Versions/GroupVersionsExpireManager.php",
        "line": 60,
        "function": "expireFolder",
        "class": "OCA\\GroupFolders\\Versions\\GroupVersionsExpireManager",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/apps/groupfolders/lib/BackgroundJob/ExpireGroupVersions.php",
        "line": 43,
        "function": "expireAll",
        "class": "OCA\\GroupFolders\\Versions\\GroupVersionsExpireManager",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/public/BackgroundJob/Job.php",
        "line": 80,
        "function": "run",
        "class": "OCA\\GroupFolders\\BackgroundJob\\ExpireGroupVersions",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php",
        "line": 102,
        "function": "start",
        "class": "OCP\\BackgroundJob\\Job",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php",
        "line": 92,
        "function": "start",
        "class": "OCP\\BackgroundJob\\TimedJob",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/cron.php",
        "line": 176,
        "function": "execute",
        "class": "OCP\\BackgroundJob\\TimedJob",
        "type": "->"
      }
    ],
    "File": "/var/www/nextcloud/apps/files_versions/lib/Versions/Version.php",
    "Line": 32,
    "message": "Error while running background job OCA\\GroupFolders\\BackgroundJob\\ExpireGroupVersions (id: 81, arguments: null)",
    "exception": {},
    "CustomMessage": "Error while running background job OCA\\GroupFolders\\BackgroundJob\\ExpireGroupVersions (id: 81, arguments: null)"
  }
}

jmechnich avatar Apr 25 '24 11:04 jmechnich

Looks like the required changes have already been added in nextcloud/groupfolders@bb592972e5a43c5dedcb0001d234c0903e7d0702 but a new release still has to be created.

jmechnich avatar Apr 25 '24 17:04 jmechnich

I have the same issue.

caguiar avatar Apr 26 '24 10:04 caguiar

Hello, if you had the app installed and group folders active the app does not work anymore in 29 and the group folders are then deleted from users machines Is there a way to compile the app since it seems that the code has already been written ?

beankylla avatar Apr 29 '24 19:04 beankylla

Hello, if you had the app installed and group folders active the app does not work anymore in 29 and the group folders are then deleted from users machines Is there a way to compile the app since it seems that the code has already been written ?

@beankylla I do not think that your problem is related to this issue here. I can still access group folders in NC 29 using the Desktop app 3.13.0 on macOS. In any case, this repository has nothing to do with the Desktop application so the answer to your question is "no".

Edit: but maybe I misunderstand and you are not talking about the Desktop application (?)

jmechnich avatar Apr 29 '24 20:04 jmechnich

Hi, yes my bad i get the following error when trying to activaste it: Error: This app cannot be enabled because it makes the server unstable Will log this in a separate issue! Thanks for the heads up!

beankylla avatar Apr 30 '24 20:04 beankylla

After trying the current stable29 branch and getting a different error caused by #2910, I was able to get a working version based on nextcloud/groupfolders@bd47d012686afeef19ba70d49f33f5d3ec78bde2, just before the mentioned PR was merged. In case it helps someone, here the created tarball: groupfolders-17.0.0-beta.1-stable29.bd47d012.tar.gz

jmechnich avatar May 01 '24 12:05 jmechnich

Feedback for future upgrading consideration:

  • Docker container was taken down and up during unrelated maintenance ... (compose down, compose up).
  • Nextcloud was upgraded to 29 and GF disabled without any warning.
  • May or may not be relevant - either shortly before or shortly after, MacOS clients were upgraded to Nextcloud desktop client 3.13.0 (users randomly upgraded on receipt of upgrade offer).
  • Because GF had been disabled, users had all synced folders removed from their desktop client (no warning) - a somewhat heart stopping experience.
  • groupfolders-17.0.0-beta.1-stable29.bd47d012.tar.gz installed and GF re-enabled, seems to be working.
  • Users now re-syncing 250GB+ each to regain access to missing folders on desktop clients.

gregjohnsonsaltaire avatar May 07 '24 23:05 gregjohnsonsaltaire

@gregjohnsonsaltaire

  • Docker container was taken down and up during unrelated maintenance ... (compose down, compose up).

If you have nextcloud:latest configured for the image in your compose file you might consider replacing it by a specific tag/version and make a conscious decision to upgrade. In my experience, it is a major source of pain to immediately upgrade to a new NC version in a production environment. It usually takes a few patch releases until the major issues are resolved.

Edit: I just noticed in the list of supported tags that there are also stable and production tags which still point to 28.0.5-apache.

jmechnich avatar May 10 '24 17:05 jmechnich

Hi, yes, thank you, of course, changed. Feedback just for info … many thanks for a great product.

On 11 May 2024, at 03:25, JΓΆrg Mechnich @.***> wrote:

@gregjohnsonsaltaire β€’ Docker container was taken down and up during unrelated maintenance ... (compose down, compose up). If you have nextcloud:latest configured for the image in your compose file you might consider replacing it by a specific tag/version and make a conscious decision to upgrade. In my experience, it is a major source of pain to immediately upgrade to a new NC version in a production environment. It usually takes a few patch releases until the major issues are resolved. β€” Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

gregjohnsonsaltaire avatar May 11 '24 02:05 gregjohnsonsaltaire

After trying the current stable29 branch and getting a different error caused by #2910, I was able to get a working version based on bd47d01, just before the mentioned PR was merged. In case it helps someone, here the created tarball: groupfolders-17.0.0-beta.1-stable29.bd47d012.tar.gz

Just to be sure, that one can be used on NC29? I do have the same error in the logs after upgrading to NC29 with the current 17.0.0-beta1.

D3nnis3n avatar May 16 '24 10:05 D3nnis3n

Just to be sure, that one can be used on NC29? I do have the same error in the logs after upgrading to NC29 with the current 17.0.0-beta1.

If by "current 17.0.0-beta1" you are referring to the tarball from above, then yes. Just to be clear: this is not an official build and I am not a NC developer, just sharing what fixed my problems (for details about my setup see original issue on top of this page).

jmechnich avatar May 16 '24 13:05 jmechnich

No, that beta is what I currently have installed and the issue appears with.

D3nnis3n avatar May 16 '24 13:05 D3nnis3n

I am also getting the same error with the latest beta of groupfolders (not the build posted in this issue, but the currently released 17.0.0-beta1), on an NC29 server. I've tried deleting and recreating the background jobs, to no effect.

cpence avatar May 16 '24 17:05 cpence

j'ai le mΓͺme type de message dans le journal d'administration: {"reqId":"hCZmk0MgMtg323IHuLqq","level":3,"time":"2024-05-15T19:20:01+00:00","remoteAddr":"","user":"--","app":"core","method":"","url":"--","message":"Error while running background job OCA\GroupFolders\BackgroundJob\ExpireGroupVersions (id: 32927, arguments: null)","userAgent":"--","version":"29.0.0.19","exception":{"Exception":"TypeError","Message":"OCA\Files_Versions\Versions\Version::__construct(): Argument #10 ($metadata) must be of type array, string given, called in /config/www/nextcloud/apps/groupfolders/lib/Versions/GroupVersion.php on line 47","Code":0,"Trace":[{"file":"/config/www/nextcloud/apps/groupfolders/lib/Versions/GroupVersion.php","line":47,"function":"__construct","class":"OCA\Files_Versions\Versions\Version","type":"->"},{"file":"/config/www/nextcloud/apps/groupfolders/lib/Versions/VersionsBackend.php","line":158,"function":"__construct","class":"OCA\GroupFolders\Versions\GroupVersion","type":"->"},{"function":"OCA\GroupFolders\Versions\{closure}","class":"OCA\GroupFolders\Versions\VersionsBackend","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/config/www/nextcloud/apps/groupfolders/lib/Versions/VersionsBackend.php","line":142,"function":"array_map"},{"file":"/config/www/nextcloud/apps/groupfolders/lib/Versions/VersionsBackend.php","line":80,"function":"getVersionsForFileFromDB","class":"OCA\GroupFolders\Versions\VersionsBackend","type":"->"},{"file":"/config/www/nextcloud/apps/groupfolders/lib/Versions/GroupVersionsExpireManager.php","line":81,"function":"getVersionsForFile","class":"OCA\GroupFolders\Versions\VersionsBackend","type":"->"},{"file":"/config/www/nextcloud/apps/groupfolders/lib/Versions/GroupVersionsExpireManager.php","line":60,"function":"expireFolder","class":"OCA\GroupFolders\Versions\GroupVersionsExpireManager","type":"->"},{"file":"/config/www/nextcloud/apps/groupfolders/lib/BackgroundJob/ExpireGroupVersions.php","line":43,"function":"expireAll","class":"OCA\GroupFolders\Versions\GroupVersionsExpireManager","type":"->"},{"file":"/app/www/public/lib/public/BackgroundJob/Job.php","line":80,"function":"run","class":"OCA\GroupFolders\BackgroundJob\ExpireGroupVersions","type":"->"},{"file":"/app/www/public/lib/public/BackgroundJob/TimedJob.php","line":102,"function":"start","class":"OCP\BackgroundJob\Job","type":"->"},{"file":"/app/www/public/lib/public/BackgroundJob/TimedJob.php","line":92,"function":"start","class":"OCP\BackgroundJob\TimedJob","type":"->"},{"file":"/app/www/public/cron.php","line":176,"function":"execute","class":"OCP\BackgroundJob\TimedJob","type":"->"}],"File":"/config/www/nextcloud/apps/files_versions/lib/Versions/Version.php","Line":32,"message":"Error while running background job OCA\GroupFolders\BackgroundJob\ExpireGroupVersions (id: 32927, arguments: null)","exception":[],"CustomMessage":"Error while running background job OCA\GroupFolders\BackgroundJob\ExpireGroupVersions (id: 32927, arguments: null)"},"id":"6645135caef0b"}

Moi aussi cela se produit toutes les 1H05.

nonofr91 avatar May 17 '24 06:05 nonofr91

Updated to groupfolders 17.0 (NC 29) and still see that issue.

XueSheng-GIT avatar May 18 '24 17:05 XueSheng-GIT

Updating to the official groupfolders 17.0.0 fixed the original error for me but created a new issue:

OCA\GroupFolders\Versions\VersionsBackend::getVersionFolderForFile(): Argument #1 ($file) must be of type OCP\Files\File, OC\Files\FileInfo given, called in /var/www/nextcloud/apps/groupfolders/lib/Versions/VersionsBackend.php on line 92

Full error entry from Nextcloud log
{
  "reqId": "VhPMgTZdXhoTMCCFFSRl",
  "level": 3,
  "time": "2024-05-18T12:32:18+02:00",
  "remoteAddr": "",
  "user": "--",
  "app": "core",
  "method": "",
  "url": "--",
  "message": "Error while running background job OCA\\GroupFolders\\BackgroundJob\\ExpireGroupVersions (id: 213905, arguments: null)",
  "userAgent": "--",
  "version": "29.0.0.19",
  "exception": {
    "Exception": "TypeError",
    "Message": "OCA\\GroupFolders\\Versions\\VersionsBackend::getVersionFolderForFile(): Argument #1 ($file) must be of type OCP\\Files\\File, OC\\Files\\FileInfo given, called in /var/www/nextcloud/apps/groupfolders/lib/Versions/VersionsBackend.php on line 92",
    "Code": 0,
    "Trace": [
      {
        "file": "/var/www/nextcloud/apps/groupfolders/lib/Versions/VersionsBackend.php",
        "line": 92,
        "function": "getVersionFolderForFile",
        "class": "OCA\\GroupFolders\\Versions\\VersionsBackend",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/apps/groupfolders/lib/Versions/GroupVersionsExpireManager.php",
        "line": 81,
        "function": "getVersionsForFile",
        "class": "OCA\\GroupFolders\\Versions\\VersionsBackend",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/apps/groupfolders/lib/Versions/GroupVersionsExpireManager.php",
        "line": 60,
        "function": "expireFolder",
        "class": "OCA\\GroupFolders\\Versions\\GroupVersionsExpireManager",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/apps/groupfolders/lib/BackgroundJob/ExpireGroupVersions.php",
        "line": 43,
        "function": "expireAll",
        "class": "OCA\\GroupFolders\\Versions\\GroupVersionsExpireManager",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/public/BackgroundJob/Job.php",
        "line": 80,
        "function": "run",
        "class": "OCA\\GroupFolders\\BackgroundJob\\ExpireGroupVersions",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php",
        "line": 102,
        "function": "start",
        "class": "OCP\\BackgroundJob\\Job",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php",
        "line": 92,
        "function": "start",
        "class": "OCP\\BackgroundJob\\TimedJob",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/cron.php",
        "line": 176,
        "function": "execute",
        "class": "OCP\\BackgroundJob\\TimedJob",
        "type": "->"
      }
    ],
    "File": "/var/www/nextcloud/apps/groupfolders/lib/Versions/VersionsBackend.php",
    "Line": 78,
    "message": "Error while running background job OCA\\GroupFolders\\BackgroundJob\\ExpireGroupVersions (id: 213905, arguments: null)",
    "exception": [],
    "CustomMessage": "Error while running background job OCA\\GroupFolders\\BackgroundJob\\ExpireGroupVersions (id: 213905, arguments: null)"
  },
  "id": "6648e583e412c"
}

jmechnich avatar May 18 '24 17:05 jmechnich

Updating to the official groupfolders 17.0.0 fixed the original error for me but created a new issue:

You are right. It's not the same issue. But the new one you mentioned.

XueSheng-GIT avatar May 18 '24 17:05 XueSheng-GIT

I've never seen as many problems as since the switch to version NC29 :-(

prolibre avatar May 19 '24 07:05 prolibre

Let's only keep one issue open at https://github.com/nextcloud/groupfolders/issues/2964 to track this one πŸ‘

solracsf avatar May 29 '24 14:05 solracsf