Skip to content
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

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

Closed
jmechnich opened this issue Apr 25, 2024 · 19 comments
Labels
0. Needs triage Issues that need to be triaged bug

Comments

@jmechnich
Copy link

jmechnich commented Apr 25, 2024

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 jmechnich added 0. Needs triage Issues that need to be triaged bug labels Apr 25, 2024
@jmechnich
Copy link
Author

jmechnich commented Apr 25, 2024

Looks like the required changes have already been added in bb59297 but a new release still has to be created.

@caguiar

This comment was marked as spam.

@beankylla
Copy link

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 ?

@jmechnich
Copy link
Author

jmechnich commented Apr 29, 2024

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 (?)

@beankylla
Copy link

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!

@jmechnich
Copy link
Author

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

@gregjohnsonsaltaire
Copy link

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.

@jmechnich
Copy link
Author

jmechnich commented May 10, 2024

@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.

@gregjohnsonsaltaire
Copy link

gregjohnsonsaltaire commented May 11, 2024 via email

@D3nnis3n
Copy link

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.

@jmechnich
Copy link
Author

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).

@D3nnis3n
Copy link

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

@cpence
Copy link

cpence commented May 16, 2024

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.

@nonofr91

This comment was marked as duplicate.

@XueSheng-GIT
Copy link
Contributor

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

@jmechnich
Copy link
Author

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"
}

@XueSheng-GIT
Copy link
Contributor

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.

@prolibre
Copy link

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

@solracsf
Copy link
Member

Let's only keep one issue open at #2964 to track this one 👍

@solracsf solracsf closed this as not planned Won't fix, can't repro, duplicate, stale May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Issues that need to be triaged bug
Projects
None yet
Development

No branches or pull requests

10 participants