onflow / flow-go

A fast, secure, and developer-friendly blockchain built to support the next generation of games, apps, and the digital assets that power them.
GNU Affero General Public License v3.0
531 stars 170 forks source link

gRPC Ping call error #1765

Open dougg0k opened 2 years ago

dougg0k commented 2 years ago

Hi,

I've been trying to call the rpc Ping in access-001.candidate4.nodes.onflow.org:9000, access-001.candidate5.nodes.onflow.org:9000 and access-001.candidate6.nodes.onflow.org:9000.

But it returns this error.

Error: 2 UNKNOWN: could not ping execution node: rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing dial tcp 35.197.17.191:9000: connect: connection refused"
    at Object.callErrorFromStatus (/app/node_modules/@grpc/grpc-js/src/call.ts:81:24)
    at Object.onReceiveStatus (/app/node_modules/@grpc/grpc-js/src/client.ts:343:36)
    at Object.onReceiveStatus (/app/node_modules/@grpc/grpc-js/src/client-interceptors.ts:430:34)
    at Object.onReceiveStatus (/app/node_modules/@grpc/grpc-js/src/client-interceptors.ts:392:48)
    at /app/node_modules/@grpc/grpc-js/src/call-stream.ts:299:24
    at processTicksAndRejections (node:internal/process/task_queues:78:11) {
  code: 2,
  details: 'could not ping execution node: rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing dial tcp 35.197.17.191:9000: connect: connection refused"',
  metadata: Metadata {
    internalRepr: Map(1) { 'content-type' => [Array] },
    options: {}
  }
}

While in all other candidate and most mainnet urls seems to be working. Was it because it wasn't implemented in those? Though it doesn't seem like it, given the error.

GetEventsForHeightRange in those endpoints is working. I need because some NFTs token were implemented from the node candidate4.

Edit: For now, this works and will do.

return new Promise((resolve, reject) => {
    client.ping({}, (err, data) => {
        if (err) {
            const isUnavailable =
                err?.code === 14 || err?.message.includes("io exception");
            if (isUnavailable) {
                reject(false);
            }
            client.getNetworkParameters({}, (err, data) => {
                if (err) {
                    reject(false);
                }
                resolve(true);
            });
        }
        resolve(true);
    });
});

Edit2: I am getting a similar error when trying to fetch event range from node candidate6.

  err: {
      "type": "Error",
      "message": "13 INTERNAL: failed to retrieve events from execution node: rpc error: code = Unavailable desc = connection error: desc = \"transport: Error while dialing dial tcp 35.197.17.191:9000: connect: connection refused\"",
      "stack":
          Error: 13 INTERNAL: failed to retrieve events from execution node: rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing dial tcp 35.197.17.191:9000: connect: connection refused"
              at Object.callErrorFromStatus (/app/node_modules/@grpc/grpc-js/src/call.ts:81:24)
              at Object.onReceiveStatus (/app/node_modules/@grpc/grpc-js/src/client.ts:343:36)
              at Object.onReceiveStatus (/app/node_modules/@grpc/grpc-js/src/client-interceptors.ts:430:34)
              at Object.onReceiveStatus (/app/node_modules/@grpc/grpc-js/src/client-interceptors.ts:392:48)
              at /app/node_modules/@grpc/grpc-js/src/call-stream.ts:299:24
              at processTicksAndRejections (node:internal/process/task_queues:78:11)
      "code": 13,
      "details": "failed to retrieve events from execution node: rpc error: code = Unavailable desc = connection error: desc = \"transport: Error while dialing dial tcp 35.197.17.191:9000: connect: connection refused\"",
      "metadata": {
        "content-type": [
          "application/grpc"
        ]
      }
    }

Still rpc GetNetworkParameters works for them all.

dougg0k commented 2 years ago

I am testing with getEventsForHeightRange and candidate5 is up, but not candidate6, all the others are working.

{
  "code": 13,
  "details": "failed to retrieve events from execution node: rpc error: code = Unavailable desc = connection error: desc = \"transport: Error while dialing dial tcp 35.197.17.191:9000: connect: connection refused\"",
  "metadata": {
    "content-type": [
      "application/grpc"
    ]
  }
}