NC 28.0.4: TypeError key(): Argument #1 ($array) must be of type array, string given Error while running background job

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version: 28.0.4
Operating system and version: Debian 11.9
Apache or nginx version: 1.24.0.3
PHP version: 8.2.17

The issue you are facing:
I found the error in the Logs of my Nextcloud. The first time I saw it was after the Update to 28.0.4. It seems like everything is working (including the Cron), its just this Output in the Log every 5 minutes (= after every time the cron runs)

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

Steps to replicate it:

  1. Run the Nextcloud cron.php

The output of your Nextcloud log in Admin > Logging:

TypeError key(): Argument #1 ($array) must be of type array, string given Error while running background job (class: OCA\Polls\Cron\AutoReminderCron, arguments: )

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

<?php
$CONFIG = array (
  'passwordsalt' => '***',
  'secret' => '***',
  'trusted_domains' => 
  array (
   ***
  ),
  'datadirectory' => '/var/www/nextcloud/data/a0269387ec24',
  'dbtype' => 'mysql',
  'version' => '28.0.4.1',
  'overwrite.cli.url' => 'https://***',
  'dbname' => '***',
  'dbhost' => '***',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => '***',
  'dbpassword' => '***',
  'installed' => true,
  'instanceid' => '***',
  'trashbin_retention_obligation' => 'auto, 90',
  'versions_retention_obligation' => 'auto, 90',
  'activity_expire_days' => 90,
  'default_phone_region' => 'DE',
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => 'cloud',
  'mail_domain' => '***',
  'mail_smtpauth' => 1,
  'mail_smtphost' => '***',
  'mail_smtpname' => '***',
  'mail_smtppassword' => '***',
  'mail_smtpport' => '465',
  'maintenance' => false,
  'theme' => '',
  'log_type' => 'file',
  'logtimezone' => 'Europe/Berlin',
  'logfile' => '/var/www/nextcloud/logs/nextcloud.log',
  'loglevel' => 2,
  'syslog_tag' => 'Nextcloud',
);

Output errors in nextcloud.log: (every 5 mins)

{"reqId":"cNu2AeWATpb4ilutMg7H","level":3,"time":"2024-04-11T11:25:01+02:00","remoteAddr":"","user":"--","app":"core","method":"","url":"--","message":"Error while running background job (class: OCA\\Polls\\Cron\\AutoReminderCron, arguments: )","userAgent":"--","version":"28.0.4.1","exception":{"Exception":"TypeError","Message":"key(): Argument #1 ($array) must be of type array, string given","Code":0,"Trace":[{"file":"/var/www/nextcloud/httpdocs/apps/polls/lib/Model/Group/Group.php","line":64,"function":"key"},{"file":"/var/www/nextcloud/httpdocs/apps/polls/lib/Service/MailService.php","line":277,"function":"getMembers","class":"OCA\\Polls\\Model\\Group\\Group","type":"->"},{"file":"/var/www/nextcloud/httpdocs/apps/polls/lib/Service/MailService.php","line":265,"function":"sendAutoReminderToRecipients","class":"OCA\\Polls\\Service\\MailService","type":"->"},{"file":"/var/www/nextcloud/httpdocs/apps/polls/lib/Service/MailService.php","line":228,"function":"processSharesForAutoReminder","class":"OCA\\Polls\\Service\\MailService","type":"->"},{"file":"/var/www/nextcloud/httpdocs/apps/polls/lib/Cron/AutoReminderCron.php","line":49,"function":"sendAutoReminder","class":"OCA\\Polls\\Service\\MailService","type":"->"},{"file":"/var/www/nextcloud/httpdocs/lib/public/BackgroundJob/Job.php","line":81,"function":"run","class":"OCA\\Polls\\Cron\\AutoReminderCron","type":"->"},{"file":"/var/www/nextcloud/httpdocs/lib/public/BackgroundJob/TimedJob.php","line":102,"function":"start","class":"OCP\\BackgroundJob\\Job","type":"->"},{"file":"/var/www/nextcloud/httpdocs/lib/public/BackgroundJob/TimedJob.php","line":92,"function":"start","class":"OCP\\BackgroundJob\\TimedJob","type":"->"},{"file":"/var/www/nextcloud/httpdocs/cron.php","line":152,"function":"execute","class":"OCP\\BackgroundJob\\TimedJob","type":"->"}],"File":"/var/www/nextcloud/httpdocs/apps/polls/lib/Model/Group/Group.php","Line":64,"message":"Error while running background job (class: OCA\\Polls\\Cron\\AutoReminderCron, arguments: )","exception":{},"CustomMessage":"Error while running background job (class: OCA\\Polls\\Cron\\AutoReminderCron, arguments: )"}}

Does anyone know a solution to it?

The issue seems to be caused by the Polls app. Here you will find more detailed information about the issue:

2 Likes

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.