Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

184
Views
GCP MetricServiceClient gets Error: 14 UNAVAILABLE

I have a Cloud function(node 10) that sends metrics using (@google-cloud/monitoring) MetricServiceClient.

I send 25 metrics using async-await syntax once a day (there is a similar task in another project at the same time).

  const request = {
    name: client.projectPath(projectId),
    timeSeries: [timeSeriesData],
  };

  const options = {
    timeout: 120000
  };

  try {
    await client.createTimeSeries(request, options);
    return Promise.resolve();
  } catch (error) {
    console.error(error);
    throw error;

But from time to time I get an error on the environment(but can't reproduce it locally)

{ Error: 14 UNAVAILABLE: Deadline expired before operation could complete.
at Object.callErrorFromStatus (/workspace/node_modules/@grpc/grpc-js/build/src/call.js:31:26)
at Object.onReceiveStatus (/workspace/node_modules/@grpc/grpc-js/build/src/client.js:179:52)
at Object.onReceiveStatus (/workspace/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:336:141)
at Object.onReceiveStatus (/workspace/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:299:181)
at process.nextTick (/workspace/node_modules/@grpc/grpc-js/build/src/call-stream.js:145:78)
at process._tickCallback (internal/process/next_tick.js:61:11)
code: 14,
details: 'Deadline expired before operation could complete.', 
metadata:
Metadata {internalRepr: Map { 'grpc-server-stats-bin' => [Array] }, options: {} } }

I checked different values for the timeout option but it seems that it isn't connected:

  • this error can appear sooner than the specified timeout option (13 000 ms with 120 000 ms timeout value)
  • if we poot a really small timeout we will have a different error Error: 4 DEADLINE_EXCEEDED: Deadline exceeded that I tracked down by source code.

I assume error details probably go from server-side @grpc/grpc-js/src/call-stream.ts line 592.

if (this.internalError.code === 'ECONNRESET') {
                  code = Status.UNAVAILABLE;
                  details = this.internalError.message;

Does anyone know where it might come from?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!