Skip to content
This repository was archived by the owner on Jul 13, 2023. It is now read-only.
This repository was archived by the owner on Jul 13, 2023. It is now read-only.

INVALID_ARGUMENT: Invalid resource field value in the request. #394

@tljesse

Description

@tljesse

Environment details

  • Firestore Functions 3.3.0
  • Node.js version: 8
  • npm version: 6.13.4
  • @google-cloud/tasks version: 1.9.0

Error

Error: 3 INVALID_ARGUMENT: Invalid resource field value in the request.
at Object.callErrorFromStatus (/srv/node_modules/@google-cloud/tasks/node_modules/@grpc/grpc-js/build/src/call.js:30:26)
at Http2CallStream.call.on (/srv/node_modules/@google-cloud/tasks/node_modules/@grpc/grpc-js/build/src/client.js:96:33)
at emitOne (events.js:121:20)
at Http2CallStream.emit (events.js:211:7)
at process.nextTick (/srv/node_modules/@google-cloud/tasks/node_modules/@grpc/grpc-js/build/src/call-stream.js:100:22)
at _combinedTickCallback (internal/process/next_tick.js:132:7)
at process._tickDomainCallback (internal/process/next_tick.js:219:9)

Steps to Reproduce

I have been trying to create a task which I understand should be working with the latest version. I keep getting this error and have been unable to find the cause of it. I've tried the sample code as well with the same error.

const { CloudTasksClient } = require('@google-cloud/tasks');

const location = 'us-central1';
const queue = 'posts-ttl';

const tasksClient = new CloudTasksClient();
const queuePath: string = tasksClient.queuePath(PROJECT_ID, location, queue);

const url = `https://${location}-${PROJECT_ID}.cloudfunctions.net/callback`;

// let payload: ScheduledTaskPayload = {
// 	collection: 'scheduledPosts',
// 	doc_id: post._id,
// 	group_id: group._id
// };
const payload = 'Hello, world';

const seconds = 1000; //(+a[0]) * 60 * 60 + (+a[1]) * 60; 

const task = {
    httpRequest: {
      httpMethod: 'POST',
      url,
      body: Buffer.from(JSON.stringify(payload)).toString('base64'),
      // headers: {
      //   'Content-Type': 'application/json',
      // },
    },
    scheduleTime: {
      seconds: seconds
    }
 }
 console.log(task);

const [ response ] = await tasksClient.createTask({ queuePath, task });

Thanks for any help!

Metadata

Metadata

Assignees

Labels

🚨This issue needs some love.api: cloudtasksIssues related to the googleapis/nodejs-tasks API.triage meI really want to be triaged.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions