modxevil / google-cloud-sdk

Automatically exported from code.google.com/p/google-cloud-sdk
0 stars 0 forks source link

Cannot deploy custom VM, hangs on docker build output #328

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Issue running command [gcloud preview app deploy].

What steps will reproduce the problem?

trying to deploy anything. I cant use the preview tool either. stuck on the 
custom-endpoint issue. on my windows PC and on my ubuntu system at work.

What is the expected output? What do you see instead?

a successful deployment.

Please provide any additional information below.

Traceback (most recent call last):
  File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin\..\./lib\googlecloudsdk\calliope\cli.py", line 592, in Execute
    result = args.cmd_func(cli=self, args=args)
  File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin\..\./lib\googlecloudsdk\calliope\backend.py", line 1223, in Run
    resources = command_instance.Run(args)
  File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin\..\./lib\googlecloudsdk\appengine\app_commands\deploy.py", line 259, in Run
    remote_build)
  File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin\..\./lib\googlecloudsdk\appengine\lib\deploy_command_util.py", line 153, in BuildAndPushDockerImages
    info.file, docker_client, image_name)
  File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin\..\./lib\googlecloudsdk\appengine\lib\deploy_command_util.py", line 239, in BuildAndPushDockerImage
    image.Build(docker_client)
  File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin\..\./lib\googlecloudsdk\appengine\lib\docker_image.py", line 99, in Build
    nocache=self._nocache, rm=self._rm, pull=False)
  File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin\..\./lib\docker\docker\client.py", line 394, in build
    timeout=timeout,
[output truncated]

File "C:\Program Files (x86)\Google\Cloud 
SDK\google-cloud-sdk\bin\..\./lib\docker\docker\client.py", line 103, in _post
    return self.post(url, **self._set_request_timeout(kwargs))
  File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin\..\./lib\requests\sessions.py", line 507, in post
    return self.request('POST', url, data=data, json=json, **kwargs)
  File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin\..\./lib\requests\sessions.py", line 464, in request
    resp = self.send(prep, **send_kwargs)
  File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin\..\./lib\requests\sessions.py", line 576, in send
    r = adapter.send(request, **kwargs)
  File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin\..\./lib\requests\adapters.py", line 415, in send
    raise ConnectionError(err, request=request)
ConnectionError: ('Connection aborted.', error(10053, 'An established 
connection was aborted by the software in your host machine'))

Installation information:

Google Cloud SDK [0.9.83]

Platform: [Windows, x86_64]
Python Version: [2.7.10 (default, May 23 2015, 09:44:00) [MSC v.1500 64 bit 
(AMD64)]]
Site Packages: [Disabled]

Installation Root: [C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk]
Installed Components:
  core: [2015.10.16]
  app-engine-python: [1.9.27]
  bq-win: [2.0.18]
  core-win: [2015.10.16]
  app: [2015.10.16]
  gcloud: [2015.10.16]
  windows-ssh-tools: [2015.09.21]
  beta: [2015.10.08]
  gsutil: [4.15]
  bq: [2.0.18]
  gsutil-win: [4.15]

when trying to deploy i end up hung on the following:
WARNING: The [application] field is specified in file 
[C:\Users\micha\my-app\app.yaml].  This field is not used by gcloud and should 
be removed.
WARNING: The [version] field is specified in file 
[C:\Users\micha\my-app\app.yaml].  This field is not used by gcloud and should 
be removed.
You are about to deploy the following modules:
 - my-app/default (from [C:\Users\micha\my-app\app.yaml])
     Deployed URL: [https://1-dot-my-app.appspot.com]
     (add --promote if you also want to make this module available from
     [https://my-app.appspot.com])

Do you want to continue (Y/n)?  y

Beginning deployment...
Verifying that Managed VMs are enabled and ready.

Provisioning remote build service.
Copying certificates for secure access. You may be prompted to create an SSH 
keypair.
Building and pushing image for module [default]
--------------------------------------------------------------------------------
--------- DOCKER BUILD OUTPUT 
-----------------------------------------------------

then i have to delete the gae-builder compute VM to get :

Original issue reported on code.google.com by bugahdug on 21 Oct 2015 at 9:36

GoogleCodeExporter commented 8 years ago
Same problem has occurred in my environment, but now fixed.

my environment is like this...

- mac os x 10.9.5
- result of command 'gcloud info'
Google Cloud SDK [0.9.87]

Platform: [Mac OS X, x86_64]
Python Version: [2.7.5 (default, Mar  9 2014, 22:15:05)  [GCC 4.2.1 Compatible 
Apple LLVM 5.0 (clang-500.0.68)]]
Python Location: [/usr/bin/python]
Site Packages: [Disabled]

Installation Root: [/Applications/google-cloud-sdk]
Installed Components:
  core: [2015.11.18]
  app-engine-python: [1.9.28]
  core-nix: [2015.11.16]
  app-engine-php: [ ]
  app-engine-java: [1.9.28]
  gcloud: []
  gsutil-nix: [4.15]
  app-engine-python-extras: [1.9.21]
  gsutil: [4.15]
  bq: [2.0.18]
  app-engine-php-darwin: [2015.11.16]
  app: []
  bq-nix: [2.0.18]

in my case, maybe the main reason is total file size of my application, 
including many node modules and bower components.
(and my lack of skill to treat docker and knowledge of GAE......orz...)

this is how the problem is fixed.

1. make a new directory only for go files to be built and asset files to be 
published. 
2. move all go files and asset files referred by my app to the new directory.
    (IMPORTANT! : excluding node modules and bower components.)
3. also move app.yaml and index.yaml in root directory to the new directory.
4. fixed some paths in code to apply new directory settings. (if necessary)
5. change working directory to the new dir.
6. run develop server for test with command "dev_appserver.py ./app.yaml" -> ok!
7. in same dir, just run "aedeploy gcloud preview app deploy app.yaml 
--promote"    that's all!

= directory composition sample =
before : 
.
├── Gruntfile.js
├── app.yaml
├── index.yaml
├── main.go
├── public (for assets)
├── tpl
├── batch
│   └── ***.sh
├── bower.json
├── bower_components
│   └── ****
├── node_modules
│   └── ****
├── package.json
└── src
    ├── img
    ├── js
    └── scss

after : 
.
├── Gruntfile.js
├── app
│   ├── app.yaml
│   ├── index.yaml
│   ├── main.go
│   ├── public (for assets)
│   └── tpl
├── batch
│   └── ***.sh
├── bower.json
├── bower_components
│   └── ****
├── node_modules
│   └── ****
├── package.json
└── src
    ├── img
    ├── js
    └── scss

i hope this would be helpful info in some aspects.

Original comment by keep.nao...@gmail.com on 23 Nov 2015 at 5:52

GoogleCodeExporter commented 8 years ago
I'm glad yours is now fixed. Mine is working now after several SDK updates and 
various changes in my app.yaml files (basically starting from scratch, adding 
bits in as I needed them) 

Thanks.

Original comment by bugahdug on 24 Nov 2015 at 9:23

GoogleCodeExporter commented 8 years ago
Thanks for reporting this. We're working on a fix.

The recommended workaround right now is to add 'node_modules' to the 
'skip_files' clause of app.yaml, as described here: 
https://cloud.google.com/appengine/docs/python/config/appconfig?hl=en#Python_app
_yaml_Skipping_files

It'll look something like:

    skip_files:
    - ^(.*/)?#.*#$
    - ^(.*/)?.*~$
    - ^(.*/)?.*\.py[co]$
    - ^(.*/)?.*/RCS/.*$
    - ^(.*/)?\..*$
    - ^node_modules/.*$

Original comment by z...@google.com on 24 Nov 2015 at 11:38