Skip to content

[GraphQl] Route query infinite loop #39707

Open
@rybkinevg

Description

@rybkinevg

Preconditions and environment

  • Magento version: 2.4.7-p4

Steps to reproduce

  1. Go to Magento Admin -> Marketing -> SEO & Search -> URL Rewrites
  2. Create a new URL rewrite via Add URL Rewrite with following values:
    • Create URL Rewrite = Custom
    • Request Path = test
    • Target Path = test
  3. Send the following GraphQl query:
{
  route(url: "/test") {
    relative_url
  }
}

Expected result

{
  "errors": [
    {
      "message": "No such entity found with matching URL key: test",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "route"
      ],
      "extensions": {
        "category": "graphql-no-such-entity"
      }
    }
  ],
  "data": {
    "route": null
  }
}

Actual result

The request have been cycled in the infinite loop, and some day will fall with timeout

Additional information

The example above is synthetic, but custom URL rewrite entity types will be affected by this issue.

For example, if we have the Blog module with Post entity, and we are not going to show posts via Magento frontend (so we do not have the frontend controllers) we will fetch them via GraphQl queries and show on the custom frontend.

We will create the custom URL rewrite entity type and resolver for it:

enum UrlRewriteEntityTypeEnum {
    BLOG_POST
}

Also we will create the URL rewrite entry for post with the following values:

  • Create URL Rewrite = Custom
  • Request Path = blog/some-post-title
  • Target Path = blog/some-post-title

When frontend will query the route it will fall with timeout.

Release note

No response

Triage and priority

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: ContentComponent: UrlRewriteIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P2A defect with this priority could have functionality issues which are not to expectations.Reported on 2.4.7-p4Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branch

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions