7
votes

I am trying to deploy cloud functions in production environment after testing it in test environment. Everything in test environment worked fine. But in prod environment when I crate cloud function is get following error

Failed to initialize a region

The complete stackdriver log is here:

{
 protoPayload: {
  @type: "type.googleapis.com/google.cloud.audit.AuditLog"    
  status: {
   code: 13     
   message: "Failed to initialize a region"     
  }
  serviceName: "cloudfunctions.googleapis.com"    
  methodName: "google.cloud.functions.v1beta2.CloudFunctionsService.CreateFunction"    
  resourceName: "projects/**********/locations/us-central1/functions/load-to-bigquery"    
 }
 insertId: "54F77BC951659.A03E406.770C4DE6"   
 resource: {
  type: "cloud_function"
  labels: {
   project_id: "**********"     
   region: "us-central1"     
   function_name: "load-to-bigquery"     
  }
 }
 timestamp: "2017-05-14T08:29:27.142Z"   
 severity: "ERROR"   
 logName: "projects/********/logs/cloudaudit.googleapis.com%2Factivity"   
 operation: {
  id: "operations/dWRjb2xsZWN0L3VzLWNlbnRyYWwxL3VkYy10by1icS9NaXRlVlI2MW1xbw"    
  producer: "cloudfunctions.googleapis.com"    
  last: true    
 }
 receiveTimestamp: "2017-05-14T08:29:28.495542553Z"   
}

I wanted to know what could be the cause of error? Both environments are quite similar and I have same permission (Project editor) in both environment.

1
@user6733196 Your project turned out to be very old, used during alpha testing, so some setup was incorrect. Please try deleting the functions now. I'm closing the issue now, but please reopen if it still fails. more info you can check at issuetracker.google.com/issues/67027944Prags

1 Answers

0
votes

It's possible that the Cloud Functions API was enabled in your Google Cloud Platform project while the product was in Alpha and was somehow missed during the migration. If that's the case and you are still being affected by this issue you should disable and re-enable the Cloud Function API on your project, which first requires deleting all of your functions.

If you have issues deleting your functions or re-enabling the API, you should create an issue so the product team can help you.