Sitelet https://github.com/grpc/grpc-java/issues/7643
Skip to content

ALTS: GRPCLB LoadBalancer had an error  #7643

Description

@veblush

When running GCS benchmark over DirectPath with gRPC 1.34.0-SNAPSHOT, it failed with the error below. It has been working with gRPC 1.33.1.

What version of gRPC-Java are you using?

gRPC 1.34.0-SNAPSHOT

What is your environment?

Linux Debian/10

What did you expect to see?

Connecting to the backend using ALTS.

What did you see instead?

GRPCLB Error

Exception in thread "main" io.grpc.StatusRuntimeException: UNAUTHENTICATED: Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.
Stream to GRPCLB LoadBalancer had an error
        at io.grpc.Status.asRuntimeException(Status.java:533)
        at io.grpc.stub.ClientCalls$BlockingResponseStream.hasNext(ClientCalls.java:648)
        at io.grpc.gcs.GrpcClient.makeMediaRequest(GrpcClient.java:179)
        at io.grpc.gcs.GrpcClient.startCalls(GrpcClient.java:106)
        at io.grpc.gcs.TestMain.main(TestMain.java:52)

Steps to reproduce the bug

java -jar $HOME/grpc-gcp-java/end2end-test-examples/gcs/libs_1.34.0/gcs-1.0-SNAPSHOT.jar --client=grpc --bkt=$GCS_BUCKET --obj=$GCS_OBJECT --method=read --dp=true --calls=1

Activity

  1. veblush commented on Nov 19, 2020

    @veblush
    ContributorAuthor

    1.34.0_error.txt is a debug log of gRPC.

  2. sanjaypujare commented on Nov 19, 2020

    @sanjaypujare
    Contributor

    There is an earlier error in the log. Is that related or is that also seen with 1.33.1

    Nov 19, 2020 2:25:10 AM io.grpc.grpclb.GrpclbNameResolver resolveBalancerAddresses
    FINE: Balancer resolution failure
    javax.naming.OperationNotSupportedException: DNS service refused [response code 5]; remaining name '_grpclb._tcp.metadata.google.internal.'
    	at com.sun.jndi.dns.DnsClient.checkResponseCode(DnsClient.java:663)
    	at com.sun.jndi.dns.DnsClient.isMatchResponse(DnsClient.java:578)
    	at com.sun.jndi.dns.DnsClient.doUdpQuery(DnsClient.java:426)
    	at com.sun.jndi.dns.DnsClient.query(DnsClient.java:211)
    	at com.sun.jndi.dns.Resolver.query(Resolver.java:81)
    	at com.sun.jndi.dns.DnsContext.c_getAttributes(DnsContext.java:434)
    	at com.sun.jndi.toolkit.ctx.ComponentDirContext.p_getAttributes(ComponentDirContext.java:235)
    	at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.getAttributes(PartialCompositeDirContext.java:141)
    	at com.sun.jndi.toolkit.url.GenericURLDirContext.getAttributes(GenericURLDirContext.java:103)
    	at javax.naming.directory.InitialDirContext.getAttributes(InitialDirContext.java:142)
    	at io.grpc.internal.JndiResourceResolverFactory$JndiRecordFetcher.getAllRecords(JndiResourceResolverFactory.java:216)
    	at io.grpc.internal.JndiResourceResolverFactory$JndiResourceResolver.resolveSrv(JndiResourceResolverFactory.java:133)
    	at io.grpc.grpclb.GrpclbNameResolver.resolveBalancerAddresses(GrpclbNameResolver.java:79)
    	at io.grpc.grpclb.GrpclbNameResolver.doResolve(GrpclbNameResolver.java:62)
    	at io.grpc.internal.DnsNameResolver$Resolve.run(DnsNameResolver.java:318)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    	at java.lang.Thread.run(Thread.java:748)
    
    
  3. sanjaypujare commented on Nov 19, 2020

    @sanjaypujare
    Contributor

    @dapengzhang0 any idea what changes in grpclb could have caused this?

  4. jiangtaoli2016 commented on Nov 19, 2020

    @jiangtaoli2016
    Contributor

    @apolcyn
    It may relate to Identity bound token enforced by gRPC LB.
    The problem is only on a particular version of grpc?

  5. apolcyn commented on Nov 19, 2020

    @apolcyn
    Contributor

    I think the '_grpclb._tcp.metadata.google.internal.' query failure is expected, and just happens because we have SRV queries enabled (so the inner ALTS channel will also make the SRV query). However, metadata.google.internal. isn't a load balanced name, so that query should fail.

    +1 that this seems likely related to ID bound token. Can we check what the target name (https://github.com/grpc/grpc/blob/e6e6be4b0b12562e38083181aee27438d8258b5a/src/proto/grpc/gcp/handshaker.proto#L104) is that is passed to the ALTS handshake service?

  6. veblush commented on Nov 19, 2020

    @veblush
    ContributorAuthor

    I haven't seen this issue with gRPC Java prior to 1.34. I just checked that gRPC 1.33.1 doesn't have this issue. So commits after v1.33.1 most likely caused this.

  7. jiangtaoli2016 commented on Nov 19, 2020

    @jiangtaoli2016
    Contributor

    I don't think Id bound token rollout in grpclb touches grpc code. It is all backend enabling. Let me check with Jianing who is responsible for Id bound token.

  8. apolcyn commented on Nov 19, 2020

    @apolcyn
    Contributor

    Although ID bound token rollout itself doesn't touch grpc code, if I'm correct it does newly require the client to pass ALTS target names and RPC authority headers on the LB channel properly, which might have changed at the client

  9. jiangtaoli2016 commented on Nov 19, 2020

    @jiangtaoli2016
    Contributor

    Confirmed with Jianing, rollout only change ESF config and fallback code is still there.

    I haven't seen this issue with gRPC Java prior to 1.34. I just checked that gRPC 1.33.1 doesn't have this issue. So commits after v1.33.1 most likely caused this.

    Based on this, it looks like some changes in gRPC code caused the failure.

  10. dapengzhang0 commented on Nov 23, 2020

    @dapengzhang0
    Contributor

    There wasn't much change to grpclb/alts between 1.33.1 and 1.34. I suspect #7613 or #7589 which was added to 1.34 is causing the problem.

  11. added
    TODO:release blockerIssue/PR is important enough to delay the release. Removed after release issues resolved
    on Dec 7, 2020
  12. ejona86 commented on Dec 7, 2020

    @ejona86
    Member

    This should have been a release blocker for v1.34 since it seems to be a serious regression.

    gRPCLB doesn't provide any call credentials to the server. If the server now requires it, that would definitely break gRPC. But why would older versions succeed? That's the important question.

    Looking at the logs, it appears that the gRPCLB request includes a JWT. That's surprising. I wonder if the swap to ChannelCredentials somehow added it.

  13. ejona86 commented on Dec 7, 2020

    @ejona86
    Member

    This is a regression caused by ChannelCredentials. ManagedChannelImpl injects the call credentials to the existing CallCredentialsApplyingTransportFactory which is used by both normal and OOB connections.

  14. added this to the 1.35 milestone on Dec 7, 2020
  15. 2 remaining items

  16. apolcyn commented on Dec 8, 2020

    @apolcyn
    Contributor

    How was this not detected by interop tests?

    Created b/175066772 to follow up on this internally.

  17. ejona86 commented on Dec 9, 2020

    @ejona86
    Member

    I spoke with @veblush, and the service was not DP-only, so fallback to CFE should have occurred.

    I think if RPCs continued the fallback may have taken place. The initial RPCs seem to fail because the picker is immediately failed when lb RPC fails and there are no backends. Changing the logic to try fallback backends first should be possible, but it also seems it will be a hard to define/implement all the edge cases.

    @apolcyn, does it seem appropriate that some RPCs failed, assuming later ones would have succeeded? It seems like we may need to change this error behavior.

  18. veblush commented on Dec 9, 2020

    @veblush
    ContributorAuthor

    This is interesting and I cannot reproduce this anymore on the same machine. Luckily I could run the exact same 1.34.0-SNAPSHOT binary which was used for the error case above and it somehow ran successfully over DirectPath.

  19. veblush commented on Dec 9, 2020

    @veblush
    ContributorAuthor

    1.34.0.log: Success log with the one which failed previously
    1.34.1.log: Success log with the one with Eric's patch.

  20. veblush commented on Dec 9, 2020

    @veblush
    ContributorAuthor

    This might be caused by a combination of the server and the client issue. Since I cannot reproduce this issue anymore with the same client, something which made the client fail to the GCS backend via DirectPath appears to be addressed.

  21. ejona86 commented on Dec 9, 2020

    @ejona86
    Member

    @veblush, the v1.34.1 log still includes the authorization header in the gRPCLB request. So either there was a mistake when testing or my patch doesn't address the problem.

  22. added 2 commits that reference this issue on Dec 9, 2020
    6b3298b
    d3419ff
  23. added a commit that references this issue on Dec 10, 2020
    4be68f3
  24. removed
    TODO:release blockerIssue/PR is important enough to delay the release. Removed after release issues resolved
    on Dec 10, 2020
  25. added 2 commits that reference this issue on Dec 10, 2020
    234bb44
    ef28b27
  26. added a commit that references this issue on Jan 15, 2021
    b2af473
  27. locked as resolved and limited conversation to collaborators on Jun 3, 2021
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

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions