nextcloud / nextcloud/contacts

Tag svg invalid in Entity, line: 377 at /var/www/nextcloud/apps/contacts/lib/Service/Social/TwitterProvider.php#136

Open
#2,585 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Steps to reproduce

Use contacs in 23.0.0

Expected behaviour

No error

Actual behaviour

Bombarded with "line: 379 at /var/www/nextcloud/apps/contacts/lib/Service/Social/TwitterProvider.php#136"

Server configuration detail

Operating system: Linux 5.4.0-91-generic #102-Ubuntu SMP Fri Nov 5 16:31:28 UTC 2021 x86_64

Webserver: Apache (fpm-fcgi)

Database: pgsql PostgreSQL 12.9 (Ubuntu 12.9-0ubuntu0.20.04.1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0, 64-bit

PHP version:

7.4.3
Modules loaded: Core, date, libxml, openssl, pcre, zlib, filter, hash, Reflection, SPL, session, standard, sodium, cgi-fcgi, mysqlnd, PDO, xml, bcmath, bz2, calendar, ctype, curl, dom, mbstring, FFI, fileinfo, ftp, gd, gettext, gmp, iconv, igbinary, imap, intl, json, ldap, exif, mysqli, pdo_mysql, pdo_pgsql, pgsql, Phar, posix, readline, redis, shmop, SimpleXML, soap, sockets, sysvmsg, sysvsem, sysvshm, tokenizer, xmlreader, xmlwriter, xsl, zip, Zend OPcache

Nextcloud version: 23.0.0 - 23.0.0.10

Updated from an older Nextcloud/ownCloud or fresh install:

Where did you install Nextcloud from: unknown

Signing status

Array
(
)

List of activated apps
Enabled:
 - accessibility: 1.9.0
 - activity: 2.15.0
 - bookmarks: 10.0.3
 - calendar: 3.0.3
 - cloud_federation_api: 1.6.0
 - comments: 1.13.0
 - contacts: 4.0.7
 - contactsinteraction: 1.4.0
 - dav: 1.21.0
 - federatedfilesharing: 1.13.0
 - federation: 1.13.0
 - files: 1.18.0
 - files_antivirus: 3.2.2
 - files_pdfviewer: 2.4.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
 - impersonate: 1.10.0
 - issuetemplate: 0.7.0
 - logreader: 2.8.0
 - lookup_server_connector: 1.11.0
 - mail: 1.11.4
 - maps: 0.1.10
 - notes: 4.2.0
 - notifications: 2.11.1
 - oauth2: 1.11.0
 - password_policy: 1.13.0
 - phonetrack: 0.6.9
 - photos: 1.5.0
 - privacy: 1.7.0
 - provisioning_api: 1.13.0
 - richdocuments: 5.0.1
 - serverinfo: 1.13.0
 - settings: 1.5.0
 - sharebymail: 1.13.0
 - spreed: 13.0.1
 - survey_client: 1.11.0
 - systemtags: 1.13.0
 - text: 3.4.0
 - theming: 1.14.0
 - twofactor_backupcodes: 1.12.0
 - updatenotification: 1.13.0
 - user_status: 1.3.1
 - viewer: 1.7.0
 - weather_status: 1.3.0
 - workflowengine: 2.5.0
Disabled:
 - admin_audit
 - circles
 - dashboard
 - encryption
 - files_external
 - nextcloud_announcements
 - recommendations
 - support
 - user_ldap

Configuration (config/config.php)
{
    "passwordsalt": "***REMOVED SENSITIVE VALUE***",
    "secret": "***REMOVED SENSITIVE VALUE***",
    "trusted_domains": [
        "localhost",
        "192.168.15.111",
        "cloud.danielhansson.nu",
        "office.danielhansson.nu"
    ],
    "datadirectory": "***REMOVED SENSITIVE VALUE***",
    "dbtype": "pgsql",
    "version": "23.0.0.10",
    "overwrite.cli.url": "https:\/\/cloud.danielhansson.nu\/",
    "dbname": "***REMOVED SENSITIVE VALUE***",
    "dbhost": "***REMOVED SENSITIVE VALUE***",
    "dbport": "",
    "dbtableprefix": "oc_",
    "dbuser": "***REMOVED SENSITIVE VALUE***",
    "dbpassword": "***REMOVED SENSITIVE VALUE***",
    "installed": true,
    "instanceid": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpmode": "smtp",
    "remember_login_cookie_lifetime": "1800",
    "log_rotate_size": "10485760",
    "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
    "forwarded_for_headers": [
        "HTTP_X_FORWARDED",
        "HTTP_FORWARDED_FOR"
    ],
    "overwriteprotocol": "https",
    "htaccess.RewriteBase": "\/",
    "loglevel": "2",
    "log_type": "file",
    "logfile": "\/var\/log\/nextcloud\/nextcloud.log",
    "logtimezone": "Europe\/Stockholm",
    "maintenance": false,
    "mail_smtpsecure": "tls",
    "mail_sendmailmode": "smtp",
    "mail_from_address": "***REMOVED SENSITIVE VALUE***",
    "mail_domain": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpauthtype": "LOGIN",
    "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpport": "587",
    "trashbin_retention_obligation": "auto, 180",
    "activity_expire_days": 60,
    "filelocking.enabled": true,
    "memcache.distributed": "\\OC\\Memcache\\Redis",
    "memcache.locking": "\\OC\\Memcache\\Redis",
    "redis": {
        "host": "***REMOVED SENSITIVE VALUE***",
        "port": 0,
        "timeout": 0.5,
        "dbindex": 0,
        "password": "***REMOVED SENSITIVE VALUE***"
    },
    "enable_previews": true,
    "preview_max_x": "2048",
    "preview_max_y": "2048",
    "jpeg_quality": "60",
    "enabledPreviewProviders": {
        "11": "OC\\Preview\\PNG",
        "12": "OC\\Preview\\JPEG",
        "13": "OC\\Preview\\GIF",
        "14": "OC\\Preview\\BMP",
        "15": "OC\\Preview\\MarkDown",
        "16": "OC\\Preview\\MP3",
        "17": "OC\\Preview\\TXT",
        "18": "OC\\Preview\\Movie"
    },
    "default_phone_region": "se",
    "memcache.local": "\\OC\\Memcache\\Redis",
    "app_install_overwrite": [
        "issuetemplate"
    ]
}

Are you using external storage, if yes which one: local/smb/sftp/...

Are you using encryption:

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...

Client configuration

Browser: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:95.0) Gecko/20100101 Firefox/95.0

Operating system: Ubuntu Server 20.04

Logs

Web server error log

Nextcloud log
Error	PHP	Error: DOMDocument::loadHTML(): Tag path invalid in Entity, line: 377 at /var/www/nextcloud/apps/contacts/lib/Service/Social/TwitterProvider.php#136	
2021-12-26T00:35:20+0100
Error	PHP	Error: DOMDocument::loadHTML(): Tag g invalid in Entity, line: 377 at /var/www/nextcloud/apps/contacts/lib/Service/Social/TwitterProvider.php#136	
2021-12-26T00:35:20+0100
Error	PHP	Error: DOMDocument::loadHTML(): Tag svg invalid in Entity, line: 377 at /var/www/nextcloud/apps/contacts/lib/Service/Social/TwitterProvider.php#136	
2021-12-26T00:35:20+0100
Error	PHP	Error: DOMDocument::loadHTML(): Tag path invalid in Entity, line: 377 at /var/www/nextcloud/apps/contacts/lib/Service/Social/TwitterProvider.php#136	
2021-12-26T00:35:20+0100
Error	PHP	Error: DOMDocument::loadHTML(): Tag g invalid in Entity, line: 377 at /var/www/nextcloud/apps/contacts/lib/Service/Social/TwitterProvider.php#136	
2021-12-26T00:35:20+0100
Error	PHP	Error: DOMDocument::loadHTML(): Tag svg invalid in Entity, line: 377 at /var/www/nextcloud/apps/contacts/lib/Service/Social/TwitterProvider.php#136	
2021-12-26T00:35:20+0100
Error	PHP	Error: DOMDocument::loadHTML(): Tag path invalid in Entity, line: 377 at /var/www/nextcloud/apps/contacts/lib/Service/Social/TwitterProvider.php#136	
2021-12-26T00:35:20+0100
Error	PHP	Error: DOMDocument::loadHTML(): Tag g invalid in Entity, line: 377 at /var/www/nextcloud/apps/contacts/lib/Service/Social/TwitterProvider.php#136	
2021-12-26T00:35:20+0100
Error	PHP	Error: DOMDocument::loadHTML(): Tag svg invalid in Entity, line: 377 at /var/www/nextcloud/apps/contacts/lib/Service/Social/TwitterProvider.php#136	
2021-12-26T00:35:20+0100


	Error: DOMDocument::loadHTML(): Tag path invalid in Entity, line: 377 at /var/www/nextcloud/apps/contacts/lib/Service/Social/TwitterProvider.php#136

    <<closure>>

    OC\Log\ErrorHandler::onError()

    /var/www/nextcloud/apps/contacts/lib/Service/Social/TwitterProvider.php - line 136:

    DOMDocument->loadHTML()

    /var/www/nextcloud/apps/contacts/lib/Service/Social/TwitterProvider.php - line 77:

    OCA\Contacts\Service\Social\TwitterProvider->getFromHtml()

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

    OCA\Contacts\Service\Social\TwitterProvider->getImageUrls()

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

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

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

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

    /var/www/nextcloud/lib/private/BackgroundJob/Job.php - line 51:

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

    /var/www/nextcloud/lib/private/BackgroundJob/QueuedJob.php - line 45:

    OC\BackgroundJob\Job->execute()

    /var/www/nextcloud/cron.php - line 128:

    OC\BackgroundJob\QueuedJob->execute()
Browser log

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 with apps/contacts/lib/Service/Social/TwitterProvider.php at line 136, then follow its callers in SocialApiService.php and Cron/SocialUpdate.php. Reproduce the Contacts social update on Nextcloud 23.0.0 and inspect how DOMDocument::loadHTML() handles the Twitter response. Done means the update no longer repeatedly logs invalid SVG, g, and path tag errors.

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
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.