GoogleCloudPlatform / professional-services

Common solutions and tools developed by Google Cloud's Professional Services team. This repository and its contents are not an officially supported Google product.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This new PR breaks the cloudFunctions and i cant deploy anymore.

mkadriDevops opened this issue · comments

This new PR breaks the cloudFunctions and i cant deploy anymore.


Error: Error waiting for Creating CloudFunctions Function: Error code 3, message: Build failed: ...nctions.eventpojos.ProjectQuota
[ERROR] /workspace/src/main/java/functions/ScanProjectHelper.java:[120,17] cannot find symbol
[ERROR]   symbol:   method setLimit(java.lang.String)
[ERROR]   location: variable projectQuota of type functions.eventpojos.ProjectQuota
[ERROR] /workspace/src/main/java/functions/ScanProjectHelper.java:[121,17] cannot find symbol
[ERROR]   symbol:   method setUsage(java.lang.String)
[ERROR]   location: variable projectQuota of type functions.eventpojos.ProjectQuota
[ERROR] /workspace/src/main/java/functions/ScanProjectHelper.java:[132,17] cannot find symbol
[ERROR]   symbol:   method setLimit(java.lang.String)
[ERROR]   location: variable projectQuota of type functions.eventpojos.ProjectQuota
[ERROR] /workspace/src/main/java/functions/ScanProjectHelper.java:[133,17] cannot find symbol
[ERROR]   symbol:   method setUsage(java.lang.String)
[ERROR]   location: variable projectQuota of type functions.eventpojos.ProjectQuota
[ERROR] /workspace/src/main/java/functions/ScanProjectHelper.java:[144,41] cannot find symbol
[ERROR]   symbol:   method getUsage()
[ERROR]   location: variable projectQuota of type functions.eventpojos.ProjectQuota
[ERROR] /workspace/src/main/java/functions/ScanProjectHelper.java:[145,41] cannot find symbol
[ERROR]   symbol:   method getLimit()
[ERROR]   location: variable projectQuota of type functions.eventpojos.ProjectQuota
[ERROR] /workspace/src/main/java/functions/ScanProjectHelper.java:[149,43] cannot find symbol
[ERROR]   symbol:   method getProject()
[ERROR]   location: variable projectQuota of type functions.eventpojos.ProjectQuota
[ERROR] /workspace/src/main/java/functions/ScanProjectHelper.java:[208,22] cannot find symbol
[ERROR]   symbol:   method setRegionClient(com.google.cloud.compute.v1.RegionClient)
[ERROR]   location: variable gcpResourceClient of type functions.eventpojos.GCPResourceClient
[ERROR] /workspace/src/main/java/functions/ScanProjectHelper.java:[209,22] cannot find symbol
[ERROR]   symbol:   method setNetworkClient(com.google.cloud.compute.v1.NetworkClient)
[ERROR]   location: variable gcpResourceClient of type functions.eventpojos.GCPResourceClient
[ERROR] /workspace/src/main/java/functions/ScanProject.java:[97,50] cannot find symbol
[ERROR]   symbol:   method getRegionClient()
[ERROR]   location: variable gcpResourceClient of type functions.eventpojos.GCPResourceClient
[ERROR] /workspace/src/main/java/functions/ScanProject.java:[117,52] cannot find symbol
[ERROR]   symbol:   method getNetworkClient()
[ERROR]   location: variable gcpResourceClient of type functions.eventpojos.GCPResourceClient
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException; Error ID: 54f66959

  on main.tf line 41, in resource "google_cloudfunctions_function" "function-listProjects":
  41: resource "google_cloudfunctions_function" "function-listProjects" {



Error: Error waiting for Creating CloudFunctions Function: Error code 3, message: Build failed: ...nctions.eventpojos.ProjectQuota
[ERROR] /workspace/src/main/java/functions/ScanProjectHelper.java:[120,17] cannot find symbol
[ERROR]   symbol:   method setLimit(java.lang.String)
[ERROR]   location: variable projectQuota of type functions.eventpojos.ProjectQuota
[ERROR] /workspace/src/main/java/functions/ScanProjectHelper.java:[121,17] cannot find symbol
[ERROR]   symbol:   method setUsage(java.lang.String)
[ERROR]   location: variable projectQuota of type functions.eventpojos.ProjectQuota
[ERROR] /workspace/src/main/java/functions/ScanProjectHelper.java:[132,17] cannot find symbol
[ERROR]   symbol:   method setLimit(java.lang.String)
[ERROR]   location: variable projectQuota of type functions.eventpojos.ProjectQuota
[ERROR] /workspace/src/main/java/functions/ScanProjectHelper.java:[133,17] cannot find symbol
[ERROR]   symbol:   method setUsage(java.lang.String)
[ERROR]   location: variable projectQuota of type functions.eventpojos.ProjectQuota
[ERROR] /workspace/src/main/java/functions/ScanProjectHelper.java:[144,41] cannot find symbol
[ERROR]   symbol:   method getUsage()
[ERROR]   location: variable projectQuota of type functions.eventpojos.ProjectQuota
[ERROR] /workspace/src/main/java/functions/ScanProjectHelper.java:[145,41] cannot find symbol
[ERROR]   symbol:   method getLimit()
[ERROR]   location: variable projectQuota of type functions.eventpojos.ProjectQuota
[ERROR] /workspace/src/main/java/functions/ScanProjectHelper.java:[149,43] cannot find symbol
[ERROR]   symbol:   method getProject()
[ERROR]   location: variable projectQuota of type functions.eventpojos.ProjectQuota
[ERROR] /workspace/src/main/java/functions/ScanProjectHelper.java:[208,22] cannot find symbol
[ERROR]   symbol:   method setRegionClient(com.google.cloud.compute.v1.RegionClient)
[ERROR]   location: variable gcpResourceClient of type functions.eventpojos.GCPResourceClient
[ERROR] /workspace/src/main/java/functions/ScanProjectHelper.java:[209,22] cannot find symbol
[ERROR]   symbol:   method setNetworkClient(com.google.cloud.compute.v1.NetworkClient)
[ERROR]   location: variable gcpResourceClient of type functions.eventpojos.GCPResourceClient
[ERROR] /workspace/src/main/java/functions/ScanProject.java:[97,50] cannot find symbol
[ERROR]   symbol:   method getRegionClient()
[ERROR]   location: variable gcpResourceClient of type functions.eventpojos.GCPResourceClient
[ERROR] /workspace/src/main/java/functions/ScanProject.java:[117,52] cannot find symbol
[ERROR]   symbol:   method getNetworkClient()
[ERROR]   location: variable gcpResourceClient of type functions.eventpojos.GCPResourceClient
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException; Error ID: 54f66959

Originally posted by @mkadriDevops in #746 (comment)

Adding the author of the original PR @kimjulia1117

Hi! I see that you used ScanProjectHelper.java and ScanProject.java for your Cloud Functions based on the error logs. I did not touch those files nor did I test them out in Cloud Functions.

I only made changes in the ScanProjectQuotas.java and ScanProjectQuotasHelper.java files. I used these files for my Cloud Functions.

Please try taking latest code and redeploy it. We are not using ScanProjectHelper.java nor ScanProject.java anymore.

Hi @kimjulia1117, we are deploying the latest QMS v4.2. I confirm that we are not using ScanProjectHelper.java or ScanProject.java. Our Functions have entry points to ScanProjectQuotas and ListProjects. I am also receiving the same error mentioned above.

Error: Error while updating cloudfunction configuration: Error waiting for Updating CloudFunctions Function: Error code 3, message: Build failed: ...nctions.eventpojos.ProjectQuota [ERROR] /workspace/src/main/java/functions/ScanProjectHelper.java:[120,17] cannot find symbol [ERROR] symbol: method setLimit(java.lang.String) [ERROR] location: variable projectQuota of type functions.eventpojos.ProjectQuota [ERROR] /workspace/src/main/java/functions/ScanProjectHelper.java:[121,17] cannot find symbol [ERROR] symbol: method setUsage(java.lang.String) [ERROR] location: variable projectQuota of type functions.eventpojos.ProjectQuota [ERROR] /workspace/src/main/java/functions/ScanProjectHelper.java:[132,17] cannot find symbol [ERROR] symbol: method setLimit(java.lang.String) [ERROR] location: variable projectQuota of type functions.eventpojos.ProjectQuota [ERROR] /workspace/src/main/java/functions/ScanProjectHelper.java:[133,17] cannot find symbol [ERROR] symbol: method setUsage(java.lang.String) [ERROR] location: variable projectQuota of type functions.eventpojos.ProjectQuota [ERROR] /workspace/src/main/java/functions/ScanProjectHelper.java:[144,41] cannot find symbol [ERROR] symbol: method getUsage() [ERROR] location: variable projectQuota of type functions.eventpojos.ProjectQuota [ERROR] /workspace/src/main/java/functions/ScanProjectHelper.java:[145,41] cannot find symbol [ERROR] symbol: method getLimit() [ERROR] location: variable projectQuota of type functions.eventpojos.ProjectQuota [ERROR] /workspace/src/main/java/functions/ScanProjectHelper.java:[149,43] cannot find symbol [ERROR] symbol: method getProject() [ERROR] location: variable projectQuota of type functions.eventpojos.ProjectQuota [ERROR] /workspace/src/main/java/functions/ScanProjectHelper.java:[208,22] cannot find symbol [ERROR] symbol: method setRegionClient(com.google.cloud.compute.v1.RegionClient) [ERROR] location: variable gcpResourceClient of type functions.eventpojos.GCPResourceClient [ERROR] /workspace/src/main/java/functions/ScanProjectHelper.java:[209,22] cannot find symbol [ERROR] symbol: method setNetworkClient(com.google.cloud.compute.v1.NetworkClient) [ERROR] location: variable gcpResourceClient of type functions.eventpojos.GCPResourceClient [ERROR] /workspace/src/main/java/functions/ScanProject.java:[97,50] cannot find symbol [ERROR] symbol: method getRegionClient() [ERROR] location: variable gcpResourceClient of type functions.eventpojos.GCPResourceClient [ERROR] /workspace/src/main/java/functions/ScanProject.java:[117,52] cannot find symbol [ERROR] symbol: method getNetworkClient() [ERROR] location: variable gcpResourceClient of type functions.eventpojos.GCPResourceClient [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException; Error ID: 54f66959
with module.google_quotamon_solution.module.google_cloud_functions_scan_project.google_cloudfunctions_function.function
on .terraform/modules/google_quotamon_solution.google_cloud_functions_scan_project/main.tf line 17, in resource "google_cloudfunctions_function" "function":
resource "google_cloudfunctions_function" "function" {

The thing is the code inside ScanProjectHelper.java is calling some functions that doesn't exists anymore after merged in eventpojos/GCPResourceClient.java and eventpojos/ProjectQuota.java.

So if ScanProjectHelper.java is not being used anymore as explained by @kimjulia1117 shouldn't it be removed?

Same error in here:

terraform.tfvars
================
source_code_zip               = "v4.2/quota-monitoring-solution-v4.2.zip"
source_code_notification_zip  = "v4.2/quota-monitoring-notification-v3.zip"

Step #4 - "tf apply": │ Error: Error waiting for Creating CloudFunctions Function: Error code 3, message: Build failed: ...nctions.eventpojos.ProjectQuota
Step #4 - "tf apply": │ [ERROR] /workspace/src/main/java/functions/ScanProjectHelper.java:[120,17] cannot find symbol
Step #4 - "tf apply": │ [ERROR]   symbol:   method setLimit(java.lang.String)
Step #4 - "tf apply": │ [ERROR]   location: variable projectQuota of type functions.eventpojos.ProjectQuota
Step #4 - "tf apply": │ [ERROR] /workspace/src/main/java/functions/ScanProjectHelper.java:[121,17] cannot find symbol
Step #4 - "tf apply": │ [ERROR]   symbol:   method setUsage(java.lang.String)
Step #4 - "tf apply": │ [ERROR]   location: variable projectQuota of type functions.eventpojos.ProjectQuota
Step #4 - "tf apply": │ [ERROR] /workspace/src/main/java/functions/ScanProjectHelper.java:[132,17] cannot find symbol
Step #4 - "tf apply": │ [ERROR]   symbol:   method setLimit(java.lang.String)
Step #4 - "tf apply": │ [ERROR]   location: variable projectQuota of type functions.eventpojos.ProjectQuota
Step #4 - "tf apply": │ [ERROR] /workspace/src/main/java/functions/ScanProjectHelper.java:[133,17] cannot find symbol
Step #4 - "tf apply": │ [ERROR]   symbol:   method setUsage(java.lang.String)
Step #4 - "tf apply": │ [ERROR]   location: variable projectQuota of type functions.eventpojos.ProjectQuota
Step #4 - "tf apply": │ [ERROR] /workspace/src/main/java/functions/ScanProjectHelper.java:[144,41] cannot find symbol
Step #4 - "tf apply": │ [ERROR]   symbol:   method getUsage()
Step #4 - "tf apply": │ [ERROR]   location: variable projectQuota of type functions.eventpojos.ProjectQuota
Step #4 - "tf apply": │ [ERROR] /workspace/src/main/java/functions/ScanProjectHelper.java:[145,41] cannot find symbol
Step #4 - "tf apply": │ [ERROR]   symbol:   method getLimit()
Step #4 - "tf apply": │ [ERROR]   location: variable projectQuota of type functions.eventpojos.ProjectQuota
Step #4 - "tf apply": │ [ERROR] /workspace/src/main/java/functions/ScanProjectHelper.java:[149,43] cannot find symbol
Step #4 - "tf apply": │ [ERROR]   symbol:   method getProject()
Step #4 - "tf apply": │ [ERROR]   location: variable projectQuota of type functions.eventpojos.ProjectQuota
Step #4 - "tf apply": │ [ERROR] /workspace/src/main/java/functions/ScanProjectHelper.java:[208,22] cannot find symbol
Step #4 - "tf apply": │ [ERROR]   symbol:   method setRegionClient(com.google.cloud.compute.v1.RegionClient)
Step #4 - "tf apply": │ [ERROR]   location: variable gcpResourceClient of type functions.eventpojos.GCPResourceClient
Step #4 - "tf apply": │ [ERROR] /workspace/src/main/java/functions/ScanProjectHelper.java:[209,22] cannot find symbol
Step #4 - "tf apply": │ [ERROR]   symbol:   method setNetworkClient(com.google.cloud.compute.v1.NetworkClient)
Step #4 - "tf apply": │ [ERROR]   location: variable gcpResourceClient of type functions.eventpojos.GCPResourceClient
Step #4 - "tf apply": │ [ERROR] /workspace/src/main/java/functions/ScanProject.java:[97,50] cannot find symbol
Step #4 - "tf apply": │ [ERROR]   symbol:   method getRegionClient()
Step #4 - "tf apply": │ [ERROR]   location: variable gcpResourceClient of type functions.eventpojos.GCPResourceClient
Step #4 - "tf apply": │ [ERROR] /workspace/src/main/java/functions/ScanProject.java:[117,52] cannot find symbol
Step #4 - "tf apply": │ [ERROR]   symbol:   method getNetworkClient()
Step #4 - "tf apply": │ [ERROR]   location: variable gcpResourceClient of type functions.eventpojos.GCPResourceClient
Step #4 - "tf apply": │ [ERROR] -> [Help 1]
Step #4 - "tf apply": │ [ERROR] 
Step #4 - "tf apply": │ [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
Step #4 - "tf apply": │ [ERROR] Re-run Maven using the -X switch to enable full debug logging.
Step #4 - "tf apply": │ [ERROR] 
Step #4 - "tf apply": │ [ERROR] For more information about the errors and possible solutions, please read the following articles:
Step #4 - "tf apply": │ [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException; Error ID: 54f66959
Step #4 - "tf apply": │ 
Step #4 - "tf apply": │   with google_cloudfunctions_function.function-listProjects,
Step #4 - "tf apply": │   on quotamon.tf line 101, in resource "google_cloudfunctions_function" "function-listProjects":
Step #4 - "tf apply": │  101: resource "google_cloudfunctions_function" "function-listProjects" {

@saurabh-deochake and @mkadriDevops you need to

  1. Download the source code and unzip
  2. Remove the files src/main/java/functions/ScanProject.java and src/main/java/functions/ScanProjectHelper.java
  3. Zip and upload the code to Cloud Functions. (If you want to use terraform, upload the *.zip to a Cloud Storage bucket of your project and replace the path on terraform.tfvars)

I tested it and worked!

image

For Quota Monitoring dev team (@boredabdel and @kimjulia1117 ), please remove obsolete references and upload a v4.2.1

Best regards!

@kleberam Yes, I also did something similar. After copying/removing the code, the Functions were deployed successfully.