Deployment fails with error

996 views
Skip to first unread message

duynhan bui

unread,
Feb 8, 2021, 3:38:58 AM2/8/21
to Google App Engine
Hello everyone,

I am trying to deploy GAE from jenkins but I get this error:
+ gcloud app deploy build/gcloud_staging.yaml --project=abcdefe --quiet --version=20211789 ERROR: gcloud crashed (ValueError): invalid literal for int() with base 10: 'c010:101:5476:1c09:2::51]:3128'
10: 'c010:101:5476:1c09:2::51]:3128' looks like IP.
Has anyone ever faced it? If there is solution, please tell me. thank you.

jstsetinin

unread,
Feb 8, 2021, 10:34:17 AM2/8/21
to Google App Engine
Hello,

What Cloud SDK version are you using? The latest version is 326 [1]. Also you can add verbosity=debug [2] flag to get more debug information about the error, share the output with us if possible.


duynhan bui

unread,
Mar 10, 2021, 10:19:03 PM3/10/21
to Google App Engine

@jstsetinin, sorry for late response.
i have checked gcloud sdk version i am using
+ gcloud version
Google Cloud SDK 324.0.0
alpha 2021.01.19
app-engine-go 1.9.71
app-engine-java 1.9.84
app-engine-python 1.9.91
app-engine-python-extras 1.9.91

i also added verbosity=debug [2] flag. This is what I got
+ gcloud app deploy build/gcloud_staging.yaml --project=project-id --quiet --version=2021121112 --verbosity=debug
DEBUG: Running [gcloud.app.deploy] with arguments: [--project: "project-id", --quiet: "True", --verbosity: "debug", --version: "2021121112", DEPLOYABLES:1: "['build/gcloud_staging.yaml']"]
DEBUG: Loading runtimes experiment config from [gs://runtime-builders/experiments.yaml]
INFO: Reading [<googlecloudsdk.api_lib.storage.storage_util.ObjectReference object at 0x7f39b0084c50>]
DEBUG: Response content was invalid (invalid literal for int() with base 10: 'c010:101:5476:1c02:2::51]:3128'), retrying
DEBUG: Retrying request to url https://storage.googleapis.com/storage/v1/b/runtime-builders/o/experiments.yaml?alt=media after exception invalid literal for int() with base 10: 'c010:101:5476:1c02:2::51]:3128'
DEBUG: Response content was invalid (invalid literal for int() with base 10: 'c010:101:5476:1c02:2::51]:3128'), retrying
DEBUG: Retrying request to url https://storage.googleapis.com/storage/v1/b/runtime-builders/o/experiments.yaml?alt=media after exception invalid literal for int() with base 10: 'c010:101:5476:1c02:2::51]:3128'
DEBUG: Response content was invalid (invalid literal for int() with base 10: 'c010:101:5476:1c02:2::51]:3128'), retrying
DEBUG: Retrying request to url https://storage.googleapis.com/storage/v1/b/runtime-builders/o/experiments.yaml?alt=media after exception invalid literal for int() with base 10: 'c010:101:5476:1c02:2::51]:3128'
DEBUG: Response content was invalid (invalid literal for int() with base 10: 'c010:101:5476:1c02:2::51]:3128'), retrying
DEBUG: Retrying request to url https://storage.googleapis.com/storage/v1/b/runtime-builders/o/experiments.yaml?alt=media after exception invalid literal for int() with base 10: 'c010:101:5476:1c02:2::51]:3128'
DEBUG: Response content was invalid (invalid literal for int() with base 10: 'c010:101:5476:1c02:2::51]:3128'), retrying
DEBUG: Retrying request to url https://storage.googleapis.com/storage/v1/b/runtime-builders/o/experiments.yaml?alt=media after exception invalid literal for int() with base 10: 'c010:101:5476:1c02:2::51]:3128'
DEBUG: Response content was invalid (invalid literal for int() with base 10: 'c010:101:5476:1c02:2::51]:3128'), retrying
DEBUG: Retrying request to url https://storage.googleapis.com/storage/v1/b/runtime-builders/o/experiments.yaml?alt=media after exception invalid literal for int() with base 10: 'c010:101:5476:1c02:2::51]:3128'
DEBUG: invalid literal for int() with base 10: 'c010:101:5476:1c02:2::51]:3128'
Traceback (most recent call last):
  File "/usr/lib/google-cloud-sdk/lib/googlecloudsdk/calliope/cli.py", line 982, in Execute
    resources = calliope_command.Run(cli=self, args=args)
  File "/usr/lib/google-cloud-sdk/lib/googlecloudsdk/calliope/backend.py", line 809, in Run
    resources = command_instance.Run(args)
  File "/usr/lib/google-cloud-sdk/lib/surface/app/deploy.py", line 111, in Run
    self._ServerSideExperimentEnabled()):
  File "/usr/lib/google-cloud-sdk/lib/surface/app/deploy.py", line 137, in _ServerSideExperimentEnabled
    runtimes_builder_root)
  File "/usr/lib/google-cloud-sdk/lib/googlecloudsdk/api_lib/app/runtime_builders.py", line 518, in LoadFromURI
    with _Read(uri) as f:
  File "/usr/lib/python3.7/contextlib.py", line 112, in __enter__
    return next(self.gen)
  File "/usr/lib/google-cloud-sdk/lib/googlecloudsdk/api_lib/app/runtime_builders.py", line 269, in _Read
    with contextlib.closing(storage_client.ReadObject(object_)) as f:
  File "/usr/lib/google-cloud-sdk/lib/googlecloudsdk/api_lib/storage/storage_api.py", line 311, in ReadObject
    self.client.objects.Get(get_req, download=download)
  File "/usr/lib/google-cloud-sdk/lib/googlecloudsdk/third_party/apis/storage/v1/storage_v1_client.py", line 1081, in Get
    download=download)
  File "/usr/bin/../lib/google-cloud-sdk/lib/third_party/apitools/base/py/base_api.py", line 709, in _RunMethod
    download.InitializeDownload(http_request, client=self.client)
  File "/usr/bin/../lib/google-cloud-sdk/lib/third_party/apitools/base/py/transfer.py", line 320, in InitializeDownload
    self.bytes_http or http, http_request)
  File "/usr/bin/../lib/google-cloud-sdk/lib/third_party/apitools/base/py/http_wrapper.py", line 350, in MakeRequest
    check_response_func=check_response_func)
  File "/usr/bin/../lib/google-cloud-sdk/lib/third_party/apitools/base/py/http_wrapper.py", line 400, in _MakeRequestNoRetry
    redirections=redirections, connection_type=connection_type)
  File "/usr/lib/google-cloud-sdk/lib/googlecloudsdk/core/transport.py", line 243, in WrappedRequest
    response = orig_request(*modified_args, **modified_kwargs)
  File "/usr/bin/../lib/google-cloud-sdk/lib/third_party/google_auth_httplib2/__init__.py", line 205, in request
    **kwargs)
  File "/usr/lib/google-cloud-sdk/lib/googlecloudsdk/core/transport.py", line 243, in WrappedRequest
    response = orig_request(*modified_args, **modified_kwargs)
  File "/usr/bin/../lib/google-cloud-sdk/lib/third_party/httplib2/python3/httplib2/__init__.py", line 1808, in request
    tls_minimum_version=self.tls_minimum_version,
  File "/usr/bin/../lib/google-cloud-sdk/lib/third_party/httplib2/python3/httplib2/__init__.py", line 1249, in __init__
    self.proxy_info = proxy_info("https")
  File "/usr/lib/google-cloud-sdk/lib/googlecloudsdk/core/http_proxy.py", line 49, in GetDefaultProxyInfo
    pi = httplib2.proxy_info_from_url(proxy_url, method)
  File "/usr/bin/../lib/google-cloud-sdk/lib/third_party/httplib2/python3/httplib2/__init__.py", line 1083, in proxy_info_from_url
    port = int(port)
ValueError: invalid literal for int() with base 10: 'c010:101:5476:1c02:2::51]:3128'
ERROR: gcloud crashed (ValueError): invalid literal for int() with base 10: 'c010:101:5476:1c02:2::51]:3128'
I have tried to find out but the reason is unclear.

Thank and regards,

nibrass

unread,
Mar 11, 2021, 11:14:08 AM3/11/21
to Google App Engine
Hello,

I understand that you are getting the following error [1] when deploying to App Engine. 

Could you please update your Cloud SDK using the next command [2] , restart your Cloud Shell and try again?

- gcloud components update

Best Regards,

Nibrass

============================

[1]: ERROR: gcloud crashed (ValueError): invalid literal for int() with base 10

duynhan bui

unread,
Mar 15, 2021, 4:32:47 AM3/15/21
to Google App Engine
Hi nibrass,

Thank you for answering.
I tried to update Cloud SDK  but it doesn't work because i am using google/cloud-sdk docker image in jenkins.
It seems that when loading the config from gs: //runtime-builders/experiments.yaml, the conversion of the port from string to number failed [2]. But I don't know why this happened.

[1] DEBUG: Loading runtimes experiment config from [gs://runtime-builders/experiments.yaml]
INFO: Reading [<googlecloudsdk.api_lib.storage.storage_util.ObjectReference object at 0x7f39b0084c50>]
DEBUG: Response content was invalid (invalid literal for int() with base 10: 'c010:101:5476:1c02:2::51]:3128'), retrying
[2] File "/usr/bin/../lib/google-cloud-sdk/lib/third_party/httplib2/python3/httplib2/__init__.py", line 1083, in proxy_info_from_url
    port = int(port)

Thank and regards,
Nhan

nibrass

unread,
Mar 19, 2021, 7:42:08 AM3/19/21
to Google App Engine

Hello,

Google App engine is not supported by Jenkins as is mentioned in this [Official Documentation](https://cloud.google.com/jenkins), but you can use [Cloud Build](https://cloud.google.com/source-repositories/docs/quickstart-triggering-builds-with-source-repositories) to create a CI/CD pipeline to deploy your applications to Google App Engine Standard Environment.

So I would like to ask you the following information in order to determine if the issue has been with gcloud command or not:

-  Please try to deploy your app with Maven build tool as mentioned in the folllowing [Documetation](https://cloud.google.com/appengine/docs/standard/java/tools/uploadinganapp#using_maven_recommended) and share the results.
- Please provide how are you deploying you app to App Engine from Jenkins?
- Please provide your app.yaml file.

Note: Don't share any sensitive data such as credentials, passwords, project id's , tokens etc.

Have a look into the following [medium tutorial](https://medium.com/@sportans300/jenkins-pipeline-to-deploy-angular-app-to-appengine-gcp-1f58160e2779#1cf6) which explains step by step how to create Jenkins Pipeline to deploy an App to App Engine.

I would also suggest you to have a look into the following Stackoverflow [post](https://stackoverflow.com/a/57262985/8791788).

Looking forward to your reply.

Best Regards,

Nibrass

duynhan bui

unread,
Mar 24, 2021, 2:24:41 AM3/24/21
to Google App Engine
Hi nibrass,

Thank you for answering.
I send to you some informations you asked

> Please provide how are you deploying you app to App Engine from Jenkins?
I create a project in jenkins that connects to my company's enterprise github, and run the pipeline script below [1].
all run until the gcloud app deploy command ......

> Please provide your app.yaml file.
I paste it on item 2. 

[1] jenkin pipeline
pipeline {
  agent none
  stages {
    stage('Build') {
      agent {
        docker { image 'node:14.10.1' }
      }

      steps {
        sh 'yarn --ignore-optional --silent'

        sh 'yarn run build:production'

        // Stash build folder to use when deploy
        stash name: "build-folder", includes: "build/*"
      }
    }

    stage('Deploy') {
      agent {
        docker { image 'google/cloud-sdk' }
      }

      environment {
        NOW = java.time.LocalDateTime.now()
        YYYY = NOW.getYear()
        MM = NOW.getMonthValue()
        dd = NOW.getDayOfMonth()
        HH = NOW.getHour()
        mm = NOW.getMinute()
      }

      steps {
        unstash "build-folder"

        sh 'cp ./gcloud_staging.yaml build'

        withCredentials([file(credentialsId: 'GCLOUD_SERVICE_FILE', variable: 'gcloudServiceFile')]) {
          sh 'gcloud auth activate-service-account --key-file=${gcloudServiceFile}'
        }

        sh 'ls -al build'

        sh 'gcloud config set project project-id'

        sh 'gcloud app deploy build/gcloud_staging.yaml --project=project-id --quiet --version=${YYYY}${MM}${dd}${HH}${mm} --verbosity=debug'
      }
    }
  }
}

[2] app.yaml
env: standard
runtime: nodejs12
service: service-name

handlers:
# Serve all static files with url ending with a file extension
- url: /ecare-portal/(.*\..+)$
static_files: \1
upload: (.*\..+)$
# Catch all handler to index.html
- url: /.*
static_files: index.html
upload: index.html

Thank you and regards,
Nhan

nibrass

unread,
Mar 31, 2021, 6:40:58 AM3/31/21
to Google App Engine
Hello,

After checking your Script and the error, I can see that the version is not being taken correctly. I think when you are specifying the version, it is not formatting it correctly. Could you please try to run the script without the --version flag?

Looking forward to your reply.

Best Regards,
Nibrass

duynhan bui

unread,
Mar 31, 2021, 9:32:54 PM3/31/21
to Google App Engine
HI Nibrass,

I think the version is correct because when jenkins runs, the version will be generated according to the date and time.
You can see in the previous emails I attached

+ gcloud app deploy build/gcloud_staging.yaml --project=project-id --quiet --version=2021121112 --verbosity=debug
DEBUG: Running [gcloud.app.deploy] with arguments: [--project: "project-id", --quiet: "True", --verbosity: "debug", --version: "2021121112", DEPLOYABLES:1: "['build/gcloud_staging.yaml']"]
DEBUG: Loading runtimes experiment config from [gs://runtime-builders/experiments.yaml]

Thank you and regards,
Nhan

duynhan bui

unread,
Mar 31, 2021, 9:33:34 PM3/31/21
to Google App Engine
I will try to run again without --version flag.

Thank and regards,
Nhan

Reply all
Reply to author
Forward
0 new messages