3

I've done a lot of researching on this error and found some posts here and on github but none of the resolutions they suggest are working for me. I'm receiving a pretty ambiguous error when trying to deploy my application to a flex environment on google cloud service app engine.

It works fine when I deploy to a standard app service in the app engine, but when I try to deploy to a flex service I receive this error:

ERROR: (gcloud.app.deploy) Error Response: [13] An internal error occurred during deployment.

I know it is nothing wrong with my application code nor my app.yaml because when I do the same deployment on another google cloud account, the service deploys fully, publishes, and I'm able to use the API. It is definitely something failing with my google cloud setup for this specific account. I'm pretty confident that I have all of the apis enabled and correct service account roles applied to this account that is not working, but obviously something is different.

One suggestion I read was to apply the role "App Engine flexible environment Service Agent" to my app engine default service account. That role did not exist on my other account that is working, but I tried anyway - no joy.

Here are my roles assigned to my service accounts on both my working google cloud account, and the non-working one.

enter image description here

Here is a comparison between my enabled APIs on both accounts:

enter image description here

I set both of these cloud accounts up and I do not recall doing anything differently for the one that is working than I did for the one that is not.

I've tried deploying through my cloud build trigger and manually running gcloud app deploy.

I also tried the latter with --verbosity=debug which gives me only a little more information about the failure:

"done": true,
"error": {
    "code": 13,
    "message": "An internal error occurred during deployment."
},
"metadata": {
    "@type": "type.googleapis.com/google.appengine.v1.OperationMetadataV1",
    "endTime": "2022-08-14T00:25:57.780Z",
    "insertTime": "2022-08-14T00:25:54.623Z",
    "method": "google.appengine.v1.Versions.CreateVersion",
    "target": "apps/my-app/services/your-app/versions/20220814t002258",
    "user": "me@you.com"
},

This is a resource I've found similar to my issue: https://github.com/GoogleCloudPlatform/nodejs-getting-started/issues/153

I've tried every suggestion there and still having the problem.

I'm 100% certain it's not the code itself nor the app.yaml because it works fine on my other account. Any other suggestions of places to look would be greatly appreciated.

TIA

Blair Holmes
  • 1,521
  • 2
  • 22
  • 35
  • The API is **google.appengine.v1.Versions.CreateVersion**. That means you are deploying a new revision of your app. There are three items deployed: 1) the configuration (app.yaml) 2); the code; 3) other files. Some of those other files can make the deployment too large and should not be included. There is something wrong with one of those three items. You did not include your code, your configuration, or a list of files being packaged for deployment. – John Hanley Aug 14 '22 at 03:37
  • My guess is item 3 - the deployment is too large. Make a directory listing of your deployment directory including all subdirectories and hidden directories and hidden files. Make sure files that should not be deployed are skipped in app.yaml: **skip_files**. – John Hanley Aug 14 '22 at 03:41
  • @JohnHanley the source files total 68 in number and only add up to 120KB. I'm already skipping the node_modules folder as per a suggestion from the link in my OP. I don't think this is my issue. Also, why would it work on another GCP account with the exact same deployment pattern (same app.yaml, same code files)? – Blair Holmes Aug 14 '22 at 13:49
  • @JohnHanley what elements identify this as the "same" app and my deployments now are just revisions (per your first comment)? I've tried changing the service name with no luck. Is there something else GCP uses to identify this app service that I can change to try and avoid the CreateVersion method? – Blair Holmes Aug 14 '22 at 13:58
  • 1
    Try deploying again with the ```log-http``` flag i.e. run the command ```gcloud app deploy --log-http ```. This will log all HTTP server requests and responses i.e. your log file will have the following blocks for each part of the deploy process - http start/end, the url being called, the method (GET, POST, etc), status code. This should help narrow down where exactly the error is occurring – NoCommandLine Aug 14 '22 at 16:56
  • @NoCommandLine this yields the exact same error response at the bottom of my OP. There are two requests that go through successfully to what appears to be the same end point, the third response contains the error object with `code: 13` and `message: "An internal error occurred during deployment."` This is happening when it's trying to update the service after it has been deployed: `Updating service [nest-api] (this may take several minutes)...failed.` – Blair Holmes Aug 14 '22 at 17:16
  • In one of the links in the GitHub link you have in your OP, it says the issue was from their combo of resources. Did you try removing the ```resources``` attribute in ```app.yaml```file or maybe try different combinations? – NoCommandLine Aug 14 '22 at 17:30
  • @NoCommandLine yes, I've tried lots of different values for resources as well as paring down the app.yaml to only include the service name, runtime, and env and still having the same problem. It's pretty frustrating because the error is so vague and the fact that it works fine on my other cloud account is odd to me. – Blair Holmes Aug 14 '22 at 17:37
  • Yes, nothing as frustrating as a ```vague``` error message. In situations like these, I typically leave the problem for about a day/few hours (come back to it with fresh eyes, issue could be resolved by the cloud provider) or look for workarounds (in your case that would be - consider using GAE standard; deploy to the other account, invite the non-working account as a collaborator and then transfer ownership to it) – NoCommandLine Aug 14 '22 at 17:42
  • May I know what is the location of your App Engine project? Can you also try to deploy a simple hello world on App Engine Flex by [following this quickstart](https://cloud.google.com/appengine/docs/flexible/nodejs/create-app) to check if the issue still persists. You can also see if there are error message in the Cloud build page -> History tab – Darwin Aug 15 '22 at 00:04
  • @Darwin the location of the project is: `locationId: us-central`. I have already tried a greenfielded NestJS hello world app in flex and same result on the failing account. – Blair Holmes Aug 15 '22 at 00:30
  • Verify that you do not have a billing problem. Do not assume that you don't go to the billing screens and double check. – John Hanley Aug 15 '22 at 00:40
  • @JohnHanley I thought about this as well, I've already sent an email to the client asking to make sure everything is in order on the billing side. Unfortunately, I can't see that module. – Blair Holmes Aug 15 '22 at 00:47
  • May I know if the issue still persists? if yes, can you try to deploy using incognito mode or different browsers or deploy using a different device and internet provider. There might be a browser cache issue. – Darwin Aug 16 '22 at 03:41
  • @Darwin issue still persists - I haven't not heard back from the client yet about the billing. I have already tried incognito on two different browsers (edge and chrome). I've also tried deploying from the cloud sdk shell on two different machines. Unfortunately, I can not try a different ISP as I don't have that luxury. – Blair Holmes Aug 16 '22 at 16:02
  • @JohnHanley billing checks out - they been billed successfully the past two months and the credit card on file in the account is current and working. I hate to give up, but I think I'm just going to run it in standard. They don't really need any of the bells and whistles that flex provides for this app right now anyway. Appreciate everyone taking a look and trying to lend a hand. – Blair Holmes Aug 16 '22 at 18:37

0 Answers0