Cannot deploy function to GCP after changing the timeout #16282
Closed
Description
opened on Feb 12, 2020
For confirmed bugs, please report:
- Version: 7.6.0
- Operating System: MacOS
- Discuss Forum URL: N/A
- Steps to Reproduce:
- Configure Functionbeat to deploy a Google Cloud Function that gets events from a gcp storage bucket.
functionbeat.provider.gcp.location_id: "us-central1"
functionbeat.provider.gcp.project_id: "myprojectid"
functionbeat.provider.gcp.storage_name: "functionbeatbucket"
functionbeat.provider.gcp.functions:
- name: storage
enabled: true
type: storage
#timeout: 60s
trigger:
resource: "projects/dede-268001/buckets/functionbeatbucket"
event_type: "google.storage.object.finalize"
The output config looks like this (simply points for ESS running on cloud)
output.elasticsearch:
hosts: ["https://xyz:9243"]
username: "elastic"
password: "mypassword"
-
Deploy the function by running
./functionbeat deploy storage
-
Verify that the function is sucessfully deployed to GCP.
-
Generate an event on the storage bucket by uploading a file.
-
Check the Cloud Function log. The log contains entries like:
2020-02-12 07:41:21.554 PST
storage
984673706582765
Function execution took 6 ms, finished with status: 'timeout'
Expand all | Collapse all{
insertId: "000000-b70aa0b0-0358-47b7-b4f3-32aba84db602"
labels: {
execution_id: "984673706582765"
}
logName: "projects/dede-268001/logs/cloudfunctions.googleapis.com%2Fcloud-functions"
receiveTimestamp: "2020-02-12T15:41:22.205417965Z"
resource: {
labels: {…}
type: "cloud_function"
}
severity: "DEBUG"
textPayload: "Function execution took 6 ms, finished with status: 'timeout'"
timestamp: "2020-02-12T15:41:21.554034871Z"
trace: "projects/dede-268001/traces/d9973adc68b86cbbb905c0bdf8b053e0"
}
-
Set the timeout in functionbeat.yml:
timeout: 120s
. -
Update the function by running
./functionbeat update storage
Functionbeat returns the message:
Function: storage, could not update, error: error while updating function: googleapi: Error 400:
Invalid value at 'function.timeout' (type.googleapis.com/google.protobuf.Duration), Field 'timeout',
Invalid duration format, failed to parse seconds, invalid
fail to update 1 function(s)
Activity