Wanting to add a service to my default app.
This is my config
# app.yaml
runtime: python311
service: myservice
entrypoint: gunicorn -b :$PORT app:app
env_variables:
color: "green"
vehicle: "bike"
I did run using the cli
gcloud app deploy --verbosity=debug --log-http
Updating service [myservice]...⠧---- response start ----
status: 200
-- headers start --
-content-encoding: gzip
alt-svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
cache-control: private
content-length: 565
content-location: https://appengine.googleapis.com/v1/apps/tidal-osprey-290511/operations/5ecf17c0-1d02-44d6-a737-429cb1ce0eb0?alt=json
content-type: application/json; charset=UTF-8
date: Mon, 08 May 2023 19:39:13 GMT
server: ESF
transfer-encoding: chunked
vary: Origin, X-Origin, Referer
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
x-xss-protection: 0
-- headers end --
-- body start --
{
"name": "apps/tidal-osprey-290511/operations/5ecf17c0-1d02-44d6-a737-429cb1ce0eb0",
"metadata": {
"@type": "type.googleapis.com/google.appengine.v1.OperationMetadataV1",
"method": "google.appengine.v1.Versions.CreateVersion",
"insertTime": "2023-05-08T19:24:04.982Z",
"endTime": "2023-05-08T19:39:07.516Z",
"user": "PII Removed by Staff",
"target": "apps/tidal-osprey-290511/services/myservice/versions/20230508t212401"
},
"done": true,
"error": {
"code": 13,
"message": "An internal error occurred."
}
}
-- body end --
total round trip time (request+response): 0.245 secs
---- response end ----
----------------------
DEBUG: Operation [apps/tidal-osprey-290511/operations/5ecf17c0-1d02-44d6-a737-429cb1ce0eb0] complete. Result: {
"done": true,
"error": {
"code": 13,
"message": "An internal error occurred."
},
"metadata": {
"@type": "type.googleapis.com/google.appengine.v1.OperationMetadataV1",
"endTime": "2023-05-08T19:39:07.516Z",
"insertTime": "2023-05-08T19:24:04.982Z",
"method": "google.appengine.v1.Versions.CreateVersion",
"target": "apps/tidal-osprey-290511/services/mycervice/versions/20230508t212401",
"user": "PII Removed by Staff"
},
"name": "apps/tidal-osprey-290511/operations/5ecf17c0-1d02-44d6-a737-429cb1ce0eb0"
}
Updating service [myservice]...failed.
DEBUG: (gcloud.app.deploy) Error Response: [13] An internal error occurred.
Traceback (most recent call last):
File "/opt/homebrew/share/google-cloud-sdk/lib/googlecloudsdk/calliope/cli.py", line 987, in Execute
resources = calliope_command.Run(cli=self, args=args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/share/google-cloud-sdk/lib/googlecloudsdk/calliope/backend.py", line 807, in Run
resources = command_instance.Run(args)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/share/google-cloud-sdk/lib/surface/app/deploy.py", line 127, in Run
return deploy_util.RunDeploy(
^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/share/google-cloud-sdk/lib/googlecloudsdk/command_lib/app/deploy_util.py", line 692, in RunDeploy
deployer.Deploy(
File "/opt/homebrew/share/google-cloud-sdk/lib/googlecloudsdk/command_lib/app/deploy_util.py", line 471, in Deploy
self.api_client.DeployService(new_version.service, new_version.id,
File "/opt/homebrew/share/google-cloud-sdk/lib/googlecloudsdk/api_lib/app/appengine_api_client.py", line 230, in DeployService
return operations_util.WaitForOperation(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/share/google-cloud-sdk/lib/googlecloudsdk/api_lib/app/operations_util.py", line 307, in WaitForOperation
completed_operation = waiter.WaitFor(
^^^^^^^^^^^^^^^
File "/opt/homebrew/share/google-cloud-sdk/lib/googlecloudsdk/api_lib/util/waiter.py", line 261, in WaitFor
operation = PollUntilDone(
^^^^^^^^^^^^^^
File "/opt/homebrew/share/google-cloud-sdk/lib/googlecloudsdk/api_lib/util/waiter.py", line 322, in PollUntilDone
operation = retryer.RetryOnResult(
^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/share/google-cloud-sdk/lib/googlecloudsdk/core/util/retry.py", line 249, in RetryOnResult
if not should_retry(result, state):
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/share/google-cloud-sdk/lib/googlecloudsdk/api_lib/util/waiter.py", line 320, in _IsNotDone
return not poller.IsDone(operation)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/share/google-cloud-sdk/lib/googlecloudsdk/api_lib/app/operations_util.py", line 182, in IsDone
raise OperationError(requests.ExtractErrorMessage(
googlecloudsdk.api_lib.app.operations_util.OperationError: Error Response: [13] An internal error occurred.
ERROR: (gcloud.app.deploy) Error Response: [13] An internal error occurred.
I could not figure out the meaning of the debug message, perhaps someone here has a better view on this issue.
Solved! Go to Solution.
I have verified both points.
The solution for me was to remove the version numbers from the requirements.txt, On the app Engine platform I had chosen an newer Python version so there was probably a conflict with some requirements not being suitable for python 3.11.
Thanks for the help.
Within the same project I have succesfully uploaded another server using one of the samples.
appengine/standard/flask/hello_world with a small adjustment to the app.yaml file. So that the default service would not be replaced, I have added a service: myservicetest entry.
runtime: python27
service: myservicetest
api_version: 1
threadsafe: true
handlers:
- url: /.*
script: main.app
libraries:
- name: flask
version: 0.12
Now I know it has probably nothing to do with my rights or version of the cli SDK.
Since your service has an entrypoint - gunicorn -b :$PORT app:app.
a) Do you have a file named app.py which exposes the app object for Flask?
b) Do you have 'gunicorn' in your requirements.txt file? Because you specified gunicorn in your entrypoint, you need to explicitly include 'gunicorn' in your requirements.txt file
I have verified both points.
The solution for me was to remove the version numbers from the requirements.txt, On the app Engine platform I had chosen an newer Python version so there was probably a conflict with some requirements not being suitable for python 3.11.
Thanks for the help.