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

PHP8 Error: unsupported operand types: int & array #1464

Closed
ghost opened this issue Apr 25, 2021 · 17 comments
Closed

PHP8 Error: unsupported operand types: int & array #1464

ghost opened this issue Apr 25, 2021 · 17 comments
Assignees
Labels
4. to release Items that are ready for releasing bug

Comments

@ghost
Copy link

ghost commented Apr 25, 2021

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.

Expected behaviour

no logged error

Actual behaviour

Logging of Error core

**TypeError**: Unsupported operand types: int & array

1. */var/www/nextcloud/lib/private/Files/Cache/Wrapper/CacheWrapper.php* *- line 74:*
   OC\Files\Cache\Wrapper\CachePermissionsMask->formatCacheEntry()

2. */var/www/nextcloud/apps/groupfolders/lib/Versions/VersionsBackend.php* *- line 170:*
   OC\Files\Cache\Wrapper\CacheWrapper->get()

3. `<<closure>>`
   *OCA\GroupFolders\Versions\VersionsBackend->OCA\GroupFolders\Versions\{closure}(**"\**\* sensiti ... \*"**)

4. */var/www/nextcloud/apps/groupfolders/lib/Versions/VersionsBackend.php* *- line 169:*
   array_map()

5. */var/www/nextcloud/apps/groupfolders/lib/Versions/GroupVersionsExpireManager.php* *- line 64:*
   OCA\GroupFolders\Versions\VersionsBackend->getAllVersionedFiles()

6. */var/www/nextcloud/apps/groupfolders/lib/Versions/GroupVersionsExpireManager.php* *- line 58:*
   OCA\GroupFolders\Versions\GroupVersionsExpireManager->expireFolder()

7. */var/www/nextcloud/apps/groupfolders/lib/BackgroundJob/ExpireGroupVersions.php* *- line 40:*
   OCA\GroupFolders\Versions\GroupVersionsExpireManager->expireAll()

8. */var/www/nextcloud/lib/private/BackgroundJob/Job.php* *- line 52:*
   OCA\GroupFolders\BackgroundJob\ExpireGroupVersions->run()

9. */var/www/nextcloud/lib/private/BackgroundJob/TimedJob.php* *- line 59:*
   OC\BackgroundJob\Job->execute()

10. */var/www/nextcloud/cron.php* *- line 128:*
    OC\BackgroundJob\TimedJob->execute()

Server configuration

see nextcloud/server#26743

@solracsf solracsf transferred this issue from nextcloud/server Apr 25, 2021
@horstkrawunke

This comment has been minimized.

@fschrempf fschrempf added 0. Needs triage Issues that need to be triaged bug labels Apr 30, 2021
@alex1702

This comment has been minimized.

@solracsf solracsf changed the title NC21.01 | Logging of Error core: unsupported operand types: int & array Error core: unsupported operand types: int & array May 5, 2021
@nursoda
Copy link

nursoda commented Jun 2, 2021

These seem to be some technical debts. I get log entries every cron run. System: Arch, PHP8, NC21.0.2. Formatted logs:

Required parameter $tagManager follows optional parameter

{
  "reqId": "CNkdZLgnAYyjHsOGsKnd",
  "level": 3,
  "time": "2021-06-02T23:08:22+02:00",
  "remoteAddr": "",
  "user": "--",
  "app": "PHP",
  "method": "",
  "url": "--",
  "message": {
    "Exception": "Error",
    "Message": "Required parameter $tagManager follows optional parameter $fileIdentifier at nextcloud/apps/files/lib/Helper.php#220",
    "Code": 0,
    "Trace": [
      {
        "file": "nextcloud/lib/composer/composer/ClassLoader.php",
        "line": 478,
        "function": "onError",
        "class": "OC\\Log\\ErrorHandler",
        "type": "::"
      },
      {
        "file": "nextcloud/lib/composer/composer/ClassLoader.php",
        "line": 478,
        "function": "include"
      },
      {
        "file": "nextcloud/lib/composer/composer/ClassLoader.php",
        "line": 346,
        "function": "Composer\\Autoload\\includeFile"
      },
      {
        "file": "nextcloud/apps/files_trashbin/lib/Helper.php",
        "line": 109,
        "function": "loadClass",
        "class": "Composer\\Autoload\\ClassLoader",
        "type": "->"
      },
      {
        "file": "nextcloud/apps/files_trashbin/lib/BackgroundJob/ExpireTrash.php",
        "line": 88,
        "function": "getTrashFiles",
        "class": "OCA\\Files_Trashbin\\Helper",
        "type": "::"
      },
      {
        "file": "nextcloud/lib/private/User/Manager.php",
        "line": 646,
        "function": "OCA\\Files_Trashbin\\BackgroundJob\\{closure}",
        "class": "OCA\\Files_Trashbin\\BackgroundJob\\ExpireTrash",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "nextcloud/apps/files_trashbin/lib/BackgroundJob/ExpireTrash.php",
        "line": 90,
        "function": "callForSeenUsers",
        "class": "OC\\User\\Manager",
        "type": "->"
      },
      {
        "file": "nextcloud/lib/private/BackgroundJob/Job.php",
        "line": 52,
        "function": "run",
        "class": "OCA\\Files_Trashbin\\BackgroundJob\\ExpireTrash",
        "type": "->"
      },
      {
        "file": "nextcloud/lib/private/BackgroundJob/TimedJob.php",
        "line": 59,
        "function": "execute",
        "class": "OC\\BackgroundJob\\Job",
        "type": "->"
      },
      {
        "file": "nextcloud/cron.php",
        "line": 128,
        "function": "execute",
        "class": "OC\\BackgroundJob\\TimedJob",
        "type": "->"
      }
    ],
    "File": "nextcloud/lib/private/Log/ErrorHandler.php",
    "Line": 92,
    "CustomMessage": "--"
  },
  "userAgent": "--",
  "version": "21.0.2.1"
}

TypeError: Unsupported operand types: int & array

{
  "reqId": "gIAZA03EbEPPBfdrFedj",
  "level": 3,
  "time": "2021-06-02T23:17:49+02:00",
  "remoteAddr": "",
  "user": "--",
  "app": "core",
  "method": "",
  "url": "--",
  "message": {
    "Exception": "TypeError",
    "Message": "Unsupported operand types: int & array",
    "Code": 0,
    "Trace": [
      {
        "file": "nextcloud/lib/private/Files/Cache/Wrapper/CacheWrapper.php",
        "line": 74,
        "function": "formatCacheEntry",
        "class": "OC\\Files\\Cache\\Wrapper\\CachePermissionsMask",
        "type": "->"
      },
      {
        "file": "nextcloud/apps/groupfolders/lib/Versions/VersionsBackend.php",
        "line": 170,
        "function": "get",
        "class": "OC\\Files\\Cache\\Wrapper\\CacheWrapper",
        "type": "->"
      },
      {
        "function": "OCA\\GroupFolders\\Versions\\{closure}",
        "class": "OCA\\GroupFolders\\Versions\\VersionsBackend",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "nextcloud/apps/groupfolders/lib/Versions/VersionsBackend.php",
        "line": 169,
        "function": "array_map"
      },
      {
        "file": "nextcloud/apps/groupfolders/lib/Versions/GroupVersionsExpireManager.php",
        "line": 64,
        "function": "getAllVersionedFiles",
        "class": "OCA\\GroupFolders\\Versions\\VersionsBackend",
        "type": "->"
      },
      {
        "file": "nextcloud/apps/groupfolders/lib/Versions/GroupVersionsExpireManager.php",
        "line": 58,
        "function": "expireFolder",
        "class": "OCA\\GroupFolders\\Versions\\GroupVersionsExpireManager",
        "type": "->"
      },
      {
        "file": "nextcloud/apps/groupfolders/lib/BackgroundJob/ExpireGroupVersions.php",
        "line": 40,
        "function": "expireAll",
        "class": "OCA\\GroupFolders\\Versions\\GroupVersionsExpireManager",
        "type": "->"
      },
      {
        "file": "nextcloud/lib/private/BackgroundJob/Job.php",
        "line": 52,
        "function": "run",
        "class": "OCA\\GroupFolders\\BackgroundJob\\ExpireGroupVersions",
        "type": "->"
      },
      {
        "file": "nextcloud/lib/private/BackgroundJob/TimedJob.php",
        "line": 59,
        "function": "execute",
        "class": "OC\\BackgroundJob\\Job",
        "type": "->"
      },
      {
        "file": "nextcloud/cron.php",
        "line": 128,
        "function": "execute",
        "class": "OC\\BackgroundJob\\TimedJob",
        "type": "->"
      }
    ],
    "File": "nextcloud/lib/private/Files/Cache/Wrapper/CachePermissionsMask.php",
    "Line": 44,
    "CustomMessage": "Error while running background job (class: OCA\\GroupFolders\\BackgroundJob\\ExpireGroupVersions, arguments: )"
  },
  "userAgent": "--",
  "version": "21.0.2.1"
}

@leuedaniel
Copy link

Same error here wrote in
nextcloud/server#25806 (comment)

@tellustheguru

This comment has been minimized.

@J0WI J0WI added 1. to develop Issues that are ready for development and removed 0. Needs triage Issues that need to be triaged labels Aug 27, 2021
@Chartman123

This comment has been minimized.

@SGF-Lon

This comment has been minimized.

@nooblag

This comment has been minimized.

@nooblag

This comment has been minimized.

@julian70400
Copy link

julian70400 commented Oct 4, 2021

Is this only an error message or there is a real and concrete issue which could affect datas stored ? In other worlds, is this issue is dangerous or we can just ignore it safely ?
Got it since I migrate my Nextcloud from PHP 7.4 to PHP 8.0.11

@sletovav
Copy link

sletovav commented Oct 4, 2021

"Group folders" + "Versions" produce homepage 3-5 sec open delay. With this error "unsupported operand types: int & array" in the log.
If you disable "Group folders" app or/and "Versions" app - your homepage opening delay will gone.

@RailsViceRoads

This comment has been minimized.

@ASmith-
Copy link

ASmith- commented Oct 14, 2021

I have the same error code flooding my logs however I also cannot connect remotely to my nextcloud server now, error 522 times out. Locally via a workstation over a LAN my Nextcloud is functioning however the log this error code 1x a hour which seems to be a clue that something is triggering this issue each hour.

Error | core | TypeError: Unsupported operand types: int & array

Snap revert nextcloud
nextcloud reverted to 22.2.0snap1
Did not correct this issue nor restored my remote ability to connect to my nextcloud, still has error 522 timing out waiting for nextcloud to respond. Nextcloud is responding correctly via LAN to my workstation. I've tried restarting Nextcloud, reverting back to 22.2.0snap1 to no avail. Some 2 weeks I had to revert nextcloud due to a release issue. I didn't notice the error 522 timing out error until after the latest snap update and I'm wondering if that is also linked?

@stefanroesler

This comment has been minimized.

@solracsf solracsf changed the title Error core: unsupported operand types: int & array PHP8 Error: unsupported operand types: int & array Nov 9, 2021
@solracsf
Copy link
Member

solracsf commented Nov 9, 2021

For those having this problem, can you check/try nextcloud/server#28385?
(for v22 only)

@danir-de
Copy link

danir-de commented Nov 9, 2021

There is no way of testing in a production environment, since no update was pushed, right?

@CarlSchwan
Copy link
Member

CarlSchwan commented Nov 9, 2021

There is no way of testing in a production environment, since no update was pushed, right?

I believe this was fixed by #1725

You can apply the patch manually:

  1. Download https://patch-diff.githubusercontent.com/raw/nextcloud/groupfolders/pull/ <the number>.diff
  2. Go to app/groupfolders
  3. patch -p1 < <the number>.diff

In case this breaks, you can revert this with:

patch -R -p1 < <the number>.diff

The diff number depends on your Nextcloud version: 1728 for stable20, 1727 for stable21, 1726 for stable22, 1725 for master

@CarlSchwan CarlSchwan added 4. to release Items that are ready for releasing and removed 1. to develop Issues that are ready for development labels Nov 9, 2021
@CarlSchwan CarlSchwan self-assigned this Nov 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4. to release Items that are ready for releasing bug
Projects
None yet
Development

No branches or pull requests