Skip to content

[Bug]: Resolving opengraph link broken with latest master #36042

Closed

Description

@max-nextcloud

⚠️ This issue respects the following points: ⚠️

  • This is a bug, not a question or a configuration/webserver/proxy issue.
  • This issue is not already reported on Github (I've searched it).
  • Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
  • Nextcloud Server is running on 64bit capable CPU, PHP and OS.
  • I agree to follow Nextcloud's Code of Conduct.

Bug description

Since #36016 was merged the link tests in text CI are failing.
Reverting the commit in question makes the tests pass again: https://github.com/nextcloud/text/pull/3653/files

Steps to reproduce

  1. Setup nextcloud-docker-dev with current master and current text app
  2. Start cypress in text:
    export CYPRESS_baseUrl=https://nextcloud.local/index.php
    npx cypress open
  3. Run the nodes/Links.js spec and see the first test fail.

Also fails for current stable25 branch with cypress test Links.js.

Expected behavior

The test should be able to retrieve open graph data and succeed.

Installation method

Community Docker image

Operating system

Debian/Ubuntu

PHP engine version

None

Web server

None

Database engine version

None

Is this bug present after an update or on a fresh install?

Fresh Nextcloud Server install

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

What user-backends are you using?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

{
    "system": {
        "debug": true,
        "profiler": true,
        "apps_paths": [
            {
                "path": "\/var\/www\/html\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/www\/html\/apps-extra",
                "url": "\/apps-extra",
                "writable": false
            },
            {
                "path": "\/var\/www\/html\/apps-writable",
                "url": "\/apps-writable",
                "writable": true
            }
        ],
        "allow_local_remote_servers": true,
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpmode": "smtp",
        "mail_sendmailmode": "smtp",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "1025",
        "skeletondirectory": "\/skeleton",
        "loglevel": 0,
        "log_query": false,
        "query_log_file": "\/var\/www\/html\/data\/query.log",
        "diagnostics.logging": false,
        "diagnostics.logging.threshold": 0,
        "log.condition": {
            "apps": [
                "diagnostics",
                "admin_audit"
            ]
        },
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "localhost",
            "nextcloud",
            "nextcloud.local",
            "192.168.26.5",
            "localhost"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "26.0.0.2",
        "overwrite.cli.url": "https:\/\/nextcloud.local",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "updater.release.channel": "git",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 6379
        },
        "memcache.local": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "overwriteprotocol": "https",
        "theme": "",
        "maintenance": false
    }
}

List of activated Apps

Enabled:
  - circles: 26.0.0-alpha.0
  - cloud_federation_api: 1.9.0
  - comments: 1.16.0
  - contactsinteraction: 1.7.0
  - dashboard: 7.6.0
  - dav: 1.25.0
  - federatedfilesharing: 1.16.0
  - federation: 1.16.0
  - files: 1.21.1
  - files_pdfviewer: 2.7.0
  - files_sharing: 1.18.0
  - files_trashbin: 1.16.0
  - files_versions: 1.19.0
  - hmr_enabler: 1.0.0
  - lookup_server_connector: 1.14.0
  - oauth2: 1.14.0
  - profiler: 1.2.0
  - provisioning_api: 1.16.0
  - recommendations: 1.5.0
  - settings: 1.8.0
  - sharebymail: 1.16.0
  - systemtags: 1.16.0
  - text: 3.7.0
  - theming: 2.1.1
  - twofactor_backupcodes: 1.15.0
  - updatenotification: 1.16.0
  - user_oidc: 1.2.1
  - user_status: 1.6.0
  - viewer: 1.10.0
  - weather_status: 1.6.0
  - workflowengine: 2.8.0
Disabled:
  - admin_audit: 1.16.0
  - collectives: 2.1.1
  - contacts: 5.1.0-alpha.1
  - encryption: 2.14.0
  - files_external: 1.18.0
  - testing: 1.16.0
  - user_ldap: 1.16.0

Nextcloud Signing status

Integrity checker has been disabled. Integrity cannot be verified.

Nextcloud Logs

{"reqId":"MKZIAbKe0569RYDXdiYD","level":0,"time":"2023-01-09T08:07:14+00:00","remoteAddr":"192.168.26.5","user":"dmkbbzwv","app":"PHP","method":"GET","url":"/ocs/v2.php/references/resolve?reference=https%3A%2F%2Fnextcloud.com","message":"Return type of OCP\\Collaboration\\Reference\\Reference::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice at /var/www/html/lib/public/Collaboration/Reference/Reference.php#241","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36","version":"26.0.0.2","data":{"app":"PHP"}}

Additional info

No response

Activity

  1. szaimen commented on Jan 9, 2023

    @szaimen
    Contributor
  2. max-nextcloud commented on Jan 9, 2023

    @max-nextcloud
    ContributorAuthor

    There's no errors and just one debug logging entry on the server side (see above).

    Response to client request to https://nextcloud.local/ocs/v2.php/references/resolve?reference=https%3A%2F%2Fnextcloud.com
    {
      "ocs": {
        "meta": {
          "status": "ok",
          "statuscode": 200,
          "message": "OK"
        },
        "data": {
          "references": {
            "https://nextcloud.com": {
              "richObjectType": "open-graph",
              "richObject": {
                "id": "https://nextcloud.com",
                "name": "https://nextcloud.com",
                "description": null,
                "thumb": null,
                "link": "https://nextcloud.com"
              },
              "openGraphObject": {
                "id": "https://nextcloud.com",
                "name": "https://nextcloud.com",
                "description": null,
                "thumb": null,
                "link": "https://nextcloud.com"
              },
              "accessible": true
            }
          }
        }
      }
    }
  3. juliusknorr commented on Jan 9, 2023

    @juliusknorr
    Member

    Issue seems to be that the content type header is checked against a too exact match, @julien-nc will push a fix for that soonish.

  4. julien-nc commented on Jan 9, 2023

    @julien-nc
    Member

    @max-nextcloud We can also use https://github.com instead of https://nextcloud.com in the Text tests. because the latter one was not accessible this morning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    0. Needs triagePending check for reproducibility or if it fits our roadmap26-feedbackbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions