Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.19.0: "Cannot add fragment of condition ... to parent type" #3133

Closed
marc-barry opened this issue May 23, 2023 · 10 comments · Fixed by #3135
Closed

v1.19.0: "Cannot add fragment of condition ... to parent type" #3133

marc-barry opened this issue May 23, 2023 · 10 comments · Fixed by #3135
Assignees

Comments

@marc-barry
Copy link
Contributor

Describe the bug

We rolled out 1.19.0 today and immediately hit an error and found the same error was reported under apollographql/federation#2592. It looks like a PR was created under apollographql/federation#2594 to address the issue.

I wasn't sure how to report you pulled in a dependency from https://github.com/apollographql/federation which broke some queries for specific users. We have since downgraded back to https://github.com/apollographql/router/releases/tag/v1.18.1 while we wait for a new release to pull in a new version of the federation dependency.

To Reproduce

See apollographql/federation#2594 for the fix.

Expected behavior

The behaviour proposed by apollographql/federation#2594.

Output

Error output from what we saw:

{"errors":[{"message":"value retrieval failed: router bridge error: the deno runtime raised an error: `request: couldn't receive response couldn't deserialize payload `11308918137995749901`: `deno: couldn't deserialize response : `Error(\"invalid neither null nor empty object: found Object {\\\"code\\\": String(\\\"QUERY_PLANNING_FAILED\\\"), \\\"exception\\\": Object {\\\"stacktrace\\\": Array [String(\\\"Cannot add fragment of condition \\\\\\\"Entry\\\\\\\" (runtimes: [Entry]) to parent type \\\\\\\"EntryPercent\\\\\\\" (runtimes: PaymentSplitConfigEntryPercent)\\\")]}}\", line: 0, column: 0)``.`","extensions":{"code":"INTERNAL_SERVER_ERROR"}}]}

Desktop (please complete the following information):

  • OS: Linux
  • Version: v1.19.0

Additional context

N/A

@Meemaw
Copy link
Contributor

Meemaw commented May 24, 2023

Does v1.18.1 work fine for you? For us pretty much every release since 1.15.1 has been broken, due to different serialisation/buffer issues.

@Geal
Copy link
Contributor

Geal commented May 24, 2023

@marc-barry thanks for pointing it out. This should be available shortly in the router's query planner
@Meemaw are your serialization or buffer issues related to query planning too? Or is it other issues, like the compression bugs we had?

@abernix abernix changed the title Deserialize payload issue with v1.19.0 v1.19.0: "Cannot add fragment of condition ... to parent type" May 24, 2023
@Meemaw
Copy link
Contributor

Meemaw commented May 24, 2023

@Geal Seemed more related to compression.

@abernix
Copy link
Member

abernix commented May 24, 2023

@marc-barry You opened the issue in a fine place! Thank you! In fact, the issue on federation you linked to was previously here on router, but we transferred it to federation to get it fixed by the right team. As you noted, router merely embeds that query-planning component and as @Geal noted, there should be a fix for it soon via a Federation query planner bug fix. Approximations suggest Friday. We'll keep your issue here to track updating the dep on the Router side and close it with the release.

@Meemaw Previous releases you mentioned may have been impacted by different bugs at the time of their release but, but v1.18.1 doesn't exhibit this particular bug as @marc-barry noted in the original post. I've updated the title of this issue to concretely frame this particular bug.

Thanks!

@Geal
Copy link
Contributor

Geal commented May 24, 2023

@Meemaw 1.18.1 should have fixed the compression bug with ##3067. If you still see related bugs, please open an issue, I'll take a look shortly

@marc-barry
Copy link
Contributor Author

Does v1.18.1 work fine for you? For us pretty much every release since 1.15.1 has been broken, due to different serialisation/buffer issues.

Yes. It is working for us and we have currently reverted back to v1.18.1.

@abernix abernix pinned this issue May 26, 2023
@abernix
Copy link
Member

abernix commented May 26, 2023

We should have a Router release out today with Federation 2.4.6's query planner which fixes this: https://github.com/apollographql/federation/releases/tag/%40apollo%2Fquery-planner%402.4.6.

Geal added a commit that referenced this issue May 26, 2023
Fix #3133

This fixes some errors in query planning on fragment with overlapping
subselections, with a message of the form "Cannot add selection of field
X to selection set of parent type Y".

The new router-bridge version also allows updating some dependencies
that were fixed to older versions: bytes, regex, once_cell, tokio, uuid
@Geal Geal self-assigned this May 26, 2023
@abernix
Copy link
Member

abernix commented May 26, 2023

@marc-barry
Copy link
Contributor Author

marc-barry commented May 26, 2023

We deployed https://github.com/apollographql/router/releases/tag/v1.19.1 and unfortunately, the router did this for the queries causing issues when we moved to v1.19.0. We have had to revert back to v1.18.1.

{
    "span": {
        "http.flavor": "HTTP/1.1",
        "http.method": "POST",
        "http.route": "/graphql",
        "otel.kind": "SERVER",
        "name": "request"
    },
    "classification": "Status code: 500 Internal Server Error",
    "spans": [
        {
        "http.flavor": "HTTP/1.1",
        "otel.kind": "SERVER",
        "http.method": "POST",
        "http.route": "/graphql",
        "name": "request"
        }
    ],
    "message": "response failed",
    "timestamp": "2023-05-26T16:22:50.211396Z",
    "latency": "0 ms",
    "level": "ERROR"
}

@abernix
Copy link
Member

abernix commented May 31, 2023

@marc-barry As noted on the other issue, please check again with https://github.com/apollographql/router/releases/tag/v1.20.0.

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

Successfully merging a pull request may close this issue.

4 participants