nextcloud / nextcloud/contacts

[PHP] Error: Undefined offset: 0 at /var/www/html/nextcloud/apps/contacts/lib/Service/SocialApiService.php#184

Open
#2,721 43 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage bug feature: contacts
Dominant language
JavaScript
Stars
642
Forks
220
Avg merge
14h 39m
Merged PRs (30d)
51

Description

Describe the bug

There PHP-Errors into the LOG:

[PHP] Error: Undefined offset: 0 at /var/www/html/nextcloud/apps/contacts/lib/Service/SocialApiService.php#184
/var/www/html/nextcloud/apps/contacts/lib/Service/SocialApiService.php - line 184:

OC\Log\ErrorHandler::onError()

/var/www/html/nextcloud/apps/contacts/lib/Service/SocialApiService.php - line 410:

OCA\Contacts\Service\SocialApiService->updateContact("*** sensiti ... *")

/var/www/html/nextcloud/apps/contacts/lib/Cron/SocialUpdate.php - line 56:

OCA\Contacts\Service\SocialApiService->updateAddressbooks("*** sensiti ... *")

/var/www/html/nextcloud/lib/public/BackgroundJob/Job.php - line 79:

OCA\Contacts\Cron\SocialUpdate->run()

/var/www/html/nextcloud/lib/public/BackgroundJob/QueuedJob.php - line 47:

OCP\BackgroundJob\Job->execute()

/var/www/html/nextcloud/cron.php - line 150:

OCP\BackgroundJob\QueuedJob->execute()
Steps to reproduce
  1. Go to 'nextcloud.log'
  2. Click on 'logging'
  3. Scroll to the last php-error
  4. See PHP-Error
Expected behavior

there shoul be no PHP-errors

Actual behavior

There are PHP-Errors coming from contacts app.
The sequence is about 20 Times in one minute.

I think the PHP-errors are coming only from the only one/same user

Other users seems not to be affected.

Contact version

contacts: 4.1.0

Operating system

Red Hat Enterprise Linux release 8.5

PHP engine version

PHP 7.4

Web server

Apache (supported)

Database

MariaDB

Operating system

Red Hat Enterprise Linux release 8.5

List of activated Apps
Enabled:
  - accessibility: 1.9.0
  - activity: 2.15.0
  - analytics: 4.2.1
  - announcementcenter: 6.1.1
  - apporder: 0.15.0
  - audioplayer: 3.3.0
  - audioplayer_sonos: 1.3.0
  - bookmarks: 10.2.1
  - breezedark: 23.2.1
  - bruteforcesettings: 2.4.0
  - calendar: 3.2.2
  - circles: 23.1.0
  - cloud_federation_api: 1.6.0
  - cms_pico: 1.0.18
  - collectives: 1.0.0
  - comments: 1.13.0
  - contacts: 4.1.0
  - contactsinteraction: 1.4.0
  - cookbook: 0.9.11
  - cospend: 1.4.6
  - dashboard: 7.3.0
  - data_request: 1.10.0
  - dav: 1.21.0
  - deck: 1.6.1
  - dicomviewer: 1.2.3
  - documentserver_community: 0.1.12
  - drawio: 1.0.2
  - electronicsignatures: 1.10.1
  - end_to_end_encryption: 1.9.1
  - event_update_notification: 1.5.0
  - extract: 1.3.3
  - federatedfilesharing: 1.13.0
  - federation: 1.13.0
  - files: 1.18.0
  - files_antivirus: 3.2.2
  - files_automatedtagging: 1.13.0
  - files_downloadactivity: 1.13.0
  - files_external: 1.15.0
  - files_markdown: 2.3.6
  - files_mindmap: 0.0.26
  - files_pdfviewer: 2.4.0
  - files_photospheres: 1.23.0
  - files_rightclick: 1.2.0
  - files_sharing: 1.15.0
  - files_trashbin: 1.13.0
  - files_versions: 1.16.0
  - files_videoplayer: 1.12.0
  - firstrunwizard: 2.12.0
  - forms: 2.5.0
  - gpxpod: 4.3.0
  - groupfolders: 11.1.2
  - health: 1.5.0
  - impersonate: 1.10.0
  - integration_discourse: 1.0.2
  - integration_dropbox: 1.0.4
  - integration_github: 1.0.2
  - integration_gitlab: 1.0.3
  - integration_google: 1.0.6
  - integration_jira: 1.0.2
  - integration_mastodon: 1.0.2
  - integration_moodle: 1.0.2
  - integration_openproject: 1.0.6
  - integration_reddit: 1.0.3
  - integration_suitecrm: 1.0.3
  - integration_twitter: 1.0.2
  - integration_zammad: 1.0.3
  - logreader: 2.8.0
  - lookup_server_connector: 1.11.0
  - maps: 0.1.10
  - nextcloud_announcements: 1.12.0
  - notes: 4.3.1
  - notifications: 2.11.1
  - oauth2: 1.11.0
  - onlyoffice: 7.3.2
  - passman: 2.4.0
  - password_policy: 1.13.0
  - photos: 1.5.0
  - polls: 3.5.4
  - privacy: 1.7.0
  - provisioning_api: 1.13.0
  - quicknotes: 0.7.3
  - quota_warning: 1.14.0
  - rainloop: 7.2.2
  - ransomware_protection: 1.13.0
  - recommendations: 1.2.0
  - serverinfo: 1.13.0
  - settings: 1.5.0
  - sharebymail: 1.13.0
  - socialsharing_diaspora: 2.5.0
  - socialsharing_email: 2.5.0
  - socialsharing_facebook: 2.5.0
  - socialsharing_twitter: 2.5.0
  - spreed: 13.0.5
  - support: 1.6.0
  - systemtags: 1.13.0
  - talk_matterbridge: 1.23.2
  - tasks: 0.14.4
  - terms_of_service: 1.9.3
  - text: 3.4.1
  - theming: 1.14.0
  - timemanager: 0.2.9
  - twofactor_backupcodes: 1.12.0
  - twofactor_totp: 6.2.0
  - updatenotification: 1.13.0
  - user_status: 1.3.1
  - video_converter: 1.0.4
  - viewer: 1.7.0
  - weather_status: 1.3.0
  - welcome: 1.0.1
  - workflow_media_converter: 1.3.6
  - workflow_ocr: 1.23.2
  - workflow_pdf_converter: 1.8.0
  - workflow_script: 1.8.0
  - workflowengine: 2.5.0
Disabled:
  - admin_audit: 1.6.0
  - audioplayer_editor: 0.3.0
  - drop_account: 2.0.0
  - encryption
  - external: 3.10.2
  - files_3d: 0.5.0
  - files_accesscontrol: 1.13.0
  - files_external_onedrive: 1.1.0
  - files_fulltextsearch: 23.0.1
  - flow_notifications: 1.2.0
  - flowupload: 1.1.3
  - fulltextsearch: 23.0.0
  - fulltextsearch_elasticsearch: 23.0.0
  - gpxedit: 0.0.14
  - gpxmotion: 0.1.0
  - integration_onedrive: 1.1.2
  - integration_whiteboard: 0.0.14
  - issuetemplate: 0.7.0
  - joplin: 0.0.25
  - ojsxc: 5.0.0
  - passwords: 2022.4.10
  - podcast: 0.3.1
  - registration: 1.4.0
  - side_menu: 2.3.5
  - social: 0.4.2
  - socialsharing_googleplus: 1.0.4
  - survey_client: 1.3.0
  - talked: 0.3.0
  - user_ldap
  - weather: 1.7.6
Nextcloud Signing status
No errors have been found.
Configuration report
{
    "system": {
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "filelocking.enabled": true,
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 0,
            "dbindex": 0,
            "timeout": 1.5,
            "password": "***REMOVED SENSITIVE VALUE***"
        },
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "xxx",
            "xxx"
        ],
        "overwrite.cli.url": "https:\/\/xxxx",
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "htaccess.RewriteBase": "\/",
        "overwriteprotocol": "https",
        "dbtype": "mysql",
        "version": "23.0.3.2",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "maintenance": false,
        "theme": "",
        "loglevel": 2,
        "auth.bruteforce.protection.enabled": true,
        "check_for_working_htaccess": true,
        "updater.release.channel": "stable",
        "data-fingerprint": "xxxx",
        "logfile": "\/xxx\/log\/nextcloud.log",
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpmode": "smtp",
        "mail_smtpauthtype": "LOGIN",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpsecure": "xxx",
        "mail_smtpauth": 1,
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "xxx",
        "session_lifetime": 1200,
        "session_keepalive": false,
        "logtimezone": "xxxx",
        "default_phone_region": "xxx",
        "knowledgebaseenabled": false,
        "log_rotate_size": xxx,
        "mail_sendmailmode": "smtp",
        "app_install_overwrite": [
            "passman",
            "dicomviewer",
            "radio",
            "cookbook",
            "health"
        ]
    }
}
Additional info

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in apps/contacts/lib/Service/SocialApiService.php at line 184, then follow the updateContact call from line 410 and the SocialUpdate.php background-job entry point at line 56. Reproduce the cron path and identify why the offset is missing; done means the reported undefined-offset error no longer appears during contact updates.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.