Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot deploy function to GCP after changing the timeout #16282

Closed
dedemorton opened this issue Feb 12, 2020 · 0 comments · Fixed by #16287
Closed

Cannot deploy function to GCP after changing the timeout #16282

dedemorton opened this issue Feb 12, 2020 · 0 comments · Fixed by #16287

Comments

@dedemorton
Copy link
Contributor

For confirmed bugs, please report:

  • Version: 7.6.0
  • Operating System: MacOS
  • Discuss Forum URL: N/A
  • Steps to Reproduce:
  1. 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"
  1. Deploy the function by running ./functionbeat deploy storage

  2. Verify that the function is sucessfully deployed to GCP.

  3. Generate an event on the storage bucket by uploading a file.

  4. 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"  
}
  1. Set the timeout in functionbeat.yml: timeout: 120s.

  2. 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants