-
Notifications
You must be signed in to change notification settings - Fork 45
INVALID_ARGUMENT: Invalid resource field value in the request. #394
Description
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!