Skip to content

IPv6 Emulator Addresses not functioning #7168

@stephenplusplus

Description

@stephenplusplus

The Datastore emulator supports-- and automatically use sometimes-- IPv6 addresses (https://cloud.google.com/sdk/gcloud/reference/beta/emulators/datastore/start). Our code has only been parsing input such as "localhost:8081", which is still the default emulator address format. However, if you start a second emulator, or just define the address yourself, it can be IPv6.

image

So, this is a two part issue.

  1. Our code needs to figure out how to handle these addresses. This will definitely involve changes to our code, and possibly to the generated client code or gax as well. That code automatically concatenates servicePath and port, but IPv6 is a bit different. We might be able to get creative with parsing the IPv6 to work around that, e.g. options.servicePath = '[::1:8244]' and options.port = ??.

  2. I can't seem to get gRPC to send requests to the IPv6 address. Here are the settings our client passes and then the response.

{ libName: 'gccl',
  libVersion: '4.3.0',
  scopes:
   [ 'https://www.googleapis.com/auth/cloud-platform',
     'https://www.googleapis.com/auth/datastore' ],
  servicePath: '[::1:8244]',
  port: 443,
  projectId: undefined }
{ Error: Deadline exceeded
    at Http2CallStream.call.on (/Users/stephen/dev/nodejs-datastore/node_modules/@grpc/grpc-js/build/src/client.js:96:45)
    at Http2CallStream.emit (events.js:194:15)
    at process.nextTick (/Users/stephen/dev/nodejs-datastore/node_modules/@grpc/grpc-js/build/src/call-stream.js:71:22)
    at process._tickCallback (internal/process/next_tick.js:61:11)
  code: 4,
  details: 'Deadline exceeded',
  metadata: Metadata { options: undefined, internalRepr: Map {} } }

The emulator readout doesn't change, so it's not being hit.

  • Is there a default emulator port for these addresses?
  • Can gRPC handle directly pinging IPv6 addresses?
  • Is there a strict format we should be following?
    • Do we use http://?
    • Does the IP have to be wrapped within brackets?
    • Is a specific port required?

I've tried all of the combinations I can think of, and it's either "Invalid URL: http://::1:8244" or a Deadline Exceeded error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    api: datastoreIssues related to the Datastore API.library: datastoreIssues transferred from another repositorypriority: p2Moderately-important priority. Fix may not be included in next release.status: blockedResolving the issue is dependent on other work.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions