400 Error when trying to deploy the Node.js helloworld app to appengine

1,230 views
Skip to first unread message

James Mortensen

unread,
May 22, 2015, 10:29:16 AM5/22/15
to google-a...@googlegroups.com

Hello,

I'm going through all of the instructions here to deploy the helloworld Node.js app to Google App Engine, and I get a 400 error with no other details as to the problem.  https://cloud.google.com/nodejs/getting-started/hello-world#running_hello_world

Below is the output from the terminal:

gcloud preview app deploy app.yaml --set-default

You are about to deploy the following modules:

 - nodejs-start/default/20150522t194829  From: [/Users/jem/Dev/1-hello-world/app.yaml]

Do you want to continue (Y/n)?  


ERROR: (gcloud.preview.app.deploy) Server responded with code [400]:

  Bad Request Unexpected HTTP status 400

Jamess-MacBook-Pro-3:1-hello-world jem$ 



Anyone know what the problem is?  Thanks,

James

Gautam Mehra

unread,
May 22, 2015, 11:35:09 PM5/22/15
to google-a...@googlegroups.com
yupp..
I am getting the same error

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

ERROR: (gcloud.preview.app.deploy) Server responded with code [400]:

  Bad Request Unexpected HTTP status 400

when I do this

gcloud preview app deploy app.yaml --set-default

on the helloworld app

Ryan (Cloud Platform Support)

unread,
May 25, 2015, 1:14:17 PM5/25/15
to google-a...@googlegroups.com, james.m...@a-cti.com
Salutations!

Are you still seeing this issue? If you are please run the command with the --verbosity debug flag and try in another region. 

Thanks!

James Hutton

unread,
May 26, 2015, 10:57:29 AM5/26/15
to google-a...@googlegroups.com, james.m...@a-cti.com
Hi Ryan

I too have been getting this error. Here is the output from the "--verbosity debug" option, per your request. I have replaced my app ID on the 3rd line with "XXXXX" but it is otherwise verbatim.


DEBUG: Host: appengine.google.com
DEBUG: _Authenticate configuring auth; needs_auth=False
DEBUG: Sending request to https://appengine.google.com/api/vms/prepare?app_id=XXXXXXXXXXX headers={'X-appcfg-api-version': '1', 'content-length': '0', 'Content-Type': 'application/octet-stream'} body=
INFO: Attempting refresh to obtain initial access_token
INFO: Refreshing access_token
DEBUG: Got http error 400.
DEBUG: Unexpected results: {'status': '400', 'alternate-protocol': '443:quic,p=1', 'content-length': '82', 'expires': 'Fri, 01 Jan 1990 00:00:00 GMT', 'server': 'Google Frontend', 'cache-control': 'no-cache', 'date': 'Tue, 26 May 2015 14:49:35 GMT', 'content-type': 'text/plain'}
DEBUG: (gcloud.preview.app.deploy) Server responded with code [400]:

  Bad Request Unexpected HTTP status 400
Traceback (most recent call last):
  File "/home/james/google-cloud-sdk/./lib/googlecloudsdk/calliope/cli.py", line 537, in Execute
    result = args.cmd_func(cli=self, args=args)
  File "/home/james/google-cloud-sdk/./lib/googlecloudsdk/calliope/backend.py", line 1089, in Run
    result = command_instance.Run(args)
  File "/home/james/google-cloud-sdk/lib/googlecloudsdk/appengine/app_commands/deploy.py", line 111, in Run
    client.PrepareVmRuntime()
  File "/home/james/google-cloud-sdk/./lib/googlecloudsdk/appengine/lib/appengine_client.py", line 281, in PrepareVmRuntime
    rpcserver.Send('/api/vms/prepare', app_id=self.project)
  File "/home/james/google-cloud-sdk/./lib/googlecloudsdk/appengine/lib/util.py", line 347, in Send
    response = self._server.Send(*args, **kwargs)
  File "/home/james/google-cloud-sdk/./lib/googlecloudsdk/appengine/lib/external/tools/appengine_rpc_httplib2.py", line 269, in Send
    'Unexpected HTTP status %s' % status)
  File "/home/james/google-cloud-sdk/./lib/googlecloudsdk/appengine/lib/external/tools/appengine_rpc_httplib2.py", line 67, in RaiseHttpError
    raise urllib2.HTTPError(url, response_info.status, msg, response_info, stream)
RPCError: Server responded with code [400]:

  Bad Request Unexpected HTTP status 400
ERROR: (gcloud.preview.app.deploy) Server responded with code [400]:
  Bad Request Unexpected HTTP status 400




Ryan (Cloud Platform Support)

unread,
May 26, 2015, 11:18:15 AM5/26/15
to google-a...@googlegroups.com, james.d...@gmail.com, james.m...@a-cti.com
Where is the instance located?

James Hutton

unread,
May 26, 2015, 12:28:04 PM5/26/15
to google-a...@googlegroups.com, james.d...@gmail.com, james.m...@a-cti.com
I think it is the EU Data Center. But I can't remember for sure. How can I find out?

Ryan (Cloud Platform Support)

unread,
May 26, 2015, 12:35:06 PM5/26/15
to google-a...@googlegroups.com, james.d...@gmail.com, james.d...@gmail.com
If you have deployed it before without issue you can go here and see what zone. If you have not then I need you to confirm you are deploying the Node.js and the command line you used to deploy it.

James Mortensen

unread,
May 26, 2015, 12:52:50 PM5/26/15
to Ryan (Cloud Platform Support), google-a...@googlegroups.com, james.d...@gmail.com
I thought this stuff was supposed to be abstracted so we didn't see the underlying compute instance... as James Hutton mentioned, how can we find out?

Thanks,

James

James Hutton

unread,
May 26, 2015, 12:53:26 PM5/26/15
to google-a...@googlegroups.com, james.d...@gmail.com
Hi Ryan, 

I have never deployed anything to Google successfully. I'm a Google Cloud noob. What I and everyone else on this thread is trying to do is to follow Google's "Hello world" Node JS tutorial here: https://cloud.google.com/nodejs/getting-started/hello-world

The problem is that if you follow the instructions in the tutorial, then you get an error message when you try to deploy. Given that several people are having this problem, it looks like the instructions in the tutorial might be wrong.

I clicked on your link and it started prompting me to create a VM. I don't know whether that's a good or a bad thing.

Ryan (Cloud Platform Support)

unread,
May 26, 2015, 1:23:01 PM5/26/15
to google-a...@googlegroups.com, james.d...@gmail.com
That means you never got a MVM up and running thats all. Is everyone seeing this problem have EU projects? I am trying to reproduce without luck so far following the instructions. I will continue to look into it. If you can confirm that your projects are in the EU it will help.

Ryan (Cloud Platform Support)

unread,
May 26, 2015, 1:52:28 PM5/26/15
to google-a...@googlegroups.com, rbru...@google.com, james.d...@gmail.com
I'm asking this because Managed VM's are currently only available in US projects, so I'm trying to see if there is another issue happening here.

James Mortensen

unread,
May 27, 2015, 5:26:00 AM5/27/15
to google-a...@googlegroups.com, james.d...@gmail.com
I am an American, but I created my test project in India.  Does that matter?  One of my colleagues created one in the USA and he didn't have any problem.  How do we get around this if this is indeed the issue?  

Thanks,
James

James Mortensen

unread,
May 27, 2015, 5:27:31 AM5/27/15
to google-a...@googlegroups.com, james.d...@gmail.com
I hate that Google Groups has no editing capabilities.  I should say that I'm from the United States, since globally America is also the name of a few different continents and not necessarily specific to the United States of America, of which I am from.  Hope this helps clarify and eliminate any ethnocentrism on my part.

James

Ryan (Cloud Platform Support)

unread,
May 27, 2015, 9:23:41 AM5/27/15
to google-a...@googlegroups.com, james.m...@a-cti.com, james.d...@gmail.com
Where in the world the project was created is irrelevant, it's what 'Location' setting was used when you created the project. Go to the original console and check the 'Location' flag. If it says US then you should be able to deploy. If it says EU you need to create a new project. Let me know if you have any issues finding the US/EU flag or still can;t deploy in a US project.

Julien

unread,
May 29, 2015, 3:14:18 AM5/29/15
to google-a...@googlegroups.com, james.m...@a-cti.com, james.d...@gmail.com
I am having the exact same problem from South Africa.

Ryan (Cloud Platform Support)

unread,
May 29, 2015, 9:04:13 AM5/29/15
to google-a...@googlegroups.com, julien...@gmail.com, james.d...@gmail.com, james.m...@a-cti.com
@Julien Is your project in US or EU?

Julien

unread,
May 29, 2015, 12:08:54 PM5/29/15
to google-a...@googlegroups.com, james.m...@a-cti.com, julien...@gmail.com, james.d...@gmail.com
I haven't selected it when I created the project so it should be which ever data center is the default one (US, I assume). Is there a place where I can check it?

Ryan (Cloud Platform Support)

unread,
May 29, 2015, 12:22:58 PM5/29/15
to google-a...@googlegroups.com, julien...@gmail.com, julien...@gmail.com, james.m...@a-cti.com
Go to the original console and look at the location field.

Julien

unread,
May 29, 2015, 12:53:47 PM5/29/15
to google-a...@googlegroups.com, julien...@gmail.com, james.m...@a-cti.com
There is no location field.. (see attachment)
shot.png

Ryan (Cloud Platform Support)

unread,
May 29, 2015, 1:30:55 PM5/29/15
to google-a...@googlegroups.com, julien...@gmail.com, julien...@gmail.com
That shows me you are in a US project. Can you the command and error you see?

Danny Leshem

unread,
May 31, 2015, 7:32:02 AM5/31/15
to google-a...@googlegroups.com, julien...@gmail.com
Hi Ryan,
I have the same issue.

I followed the instruction for a Node.JS managed VM and trying to deploy your 1-hello-world example to a new (never deployed) project called "zipcodes-prod" (the project shows the US location).

Here's what happens in Cygwin, but I also tried in the Google Cloud SDK Shell in Windows, and in a different computer that runs Mac OS.

The command I'm running:
gcloud --verbosity debug preview app deploy app.yaml --set-default

Output:
DEBUG: Running gcloud.preview.app.deploy with Namespace(__calliope_internal_deepest_parser=ArgumentParser(prog='gcloud.preview.app.deploy', usage=None, description="*(BETA)* This command is used to deploy both code and configuration to the App Engine\nserver.  As an input it takes one or more ``DEPLOYABLES'' that should be\nuploaded.  A ``DEPLOYABLE'' can be a module's .yaml file or a configuration's\n.yaml file.", version=None, formatter_class=<class 'argparse.HelpFormatter'>, conflict_handler='error', add_help=False), cmd_func=<bound method Command.Run of <googlecloudsdk.calliope.backend.Command object at 0xff3d444c>>, command_path=['gcloud', 'preview', 'app', 'deploy'], deployables=['app.yaml'], document=None, env_vars=None, force=False, format=None, h=None, help=None, http_timeout=None, log_http=None, markdown=None, project=None, quiet=None, remote=False, server=None, set_default=True, trace_token=None, user_output_enabled=None, verbosity='debug', version=None).
INFO: Refreshing access_token
You are about to deploy the following modules:
 - zipcodes-prod/default/20150531t142537  From: [/cygdrive/c/Projects/zipcodes/nodejs-getting-started.git/app.yaml]
Do you want to continue (Y/n)?  Y

DEBUG: _Authenticate configuring auth; needs_auth=False
DEBUG: Sending request to https://appengine.google.com/api/vms/prepare?app_id=zipcodes-prod headers={'X-appcfg-api-version': '1', 'content-length': '0', 'Content-Type': 'application/octet-stream'} body=
INFO: Attempting refresh to obtain initial access_token
INFO: Refreshing access_token
DEBUG: Got http error 400.
DEBUG: Unexpected results: {'status': '400', 'alternate-protocol': '443:quic,p=1', 'content-length': '75', 'expires': 'Fri, 01 Jan 1990 00:00:00 GMT', 'server': 'Google Frontend', 'cache-control': 'no-cache', 'date': 'Sun, 31 May 2015 11:25:53 GMT', 'content-type': 'text/plain'}
DEBUG: (gcloud.preview.app.deploy) Server responded with code [400]:
  Bad Request Unexpected HTTP status 400
Traceback (most recent call last):
  File "/home/dannyl/google-cloud-sdk/./lib/googlecloudsdk/calliope/cli.py", line 537, in Execute
    result = args.cmd_func(cli=self, args=args)
  File "/home/dannyl/google-cloud-sdk/./lib/googlecloudsdk/calliope/backend.py", line 1089, in Run
    result = command_instance.Run(args)
  File "/home/dannyl/google-cloud-sdk/lib/googlecloudsdk/appengine/app_commands/deploy.py", line 111, in Run
    client.PrepareVmRuntime()
  File "/home/dannyl/google-cloud-sdk/./lib/googlecloudsdk/appengine/lib/appengine_client.py", line 281, in PrepareVmRuntime
    rpcserver.Send('/api/vms/prepare', app_id=self.project)
  File "/home/dannyl/google-cloud-sdk/./lib/googlecloudsdk/appengine/lib/util.py", line 347, in Send
    response = self._server.Send(*args, **kwargs)
  File "/home/dannyl/google-cloud-sdk/./lib/googlecloudsdk/appengine/lib/external/tools/appengine_rpc_httplib2.py", line 269, in Send
    'Unexpected HTTP status %s' % status)
  File "/home/dannyl/google-cloud-sdk/./lib/googlecloudsdk/appengine/lib/external/tools/appengine_rpc_httplib2.py", line 67, in RaiseHttpError
    raise urllib2.HTTPError(url, response_info.status, msg, response_info, stream)
RPCError: Server responded with code [400]:
  Bad Request Unexpected HTTP status 400
ERROR: (gcloud.preview.app.deploy) Server responded with code [400]:
  Bad Request Unexpected HTTP status 400

I'm using my Wix.com account, which is a Google Cloud Premier Account. Let me know if you need further information.

Best,
Danny

Julien

unread,
Jun 1, 2015, 8:05:04 AM6/1/15
to google-a...@googlegroups.com, julien...@gmail.com
Last week I was getting the following:
gcloud preview app deploy app.yaml --set-default
You are about to deploy the following modules:
 - academic-torch-95915/default/20150529t102149  From: [/home/julien/1-hello-world/app.yaml]
Do you want to continue (Y/n)?  y

ERROR: (gcloud.preview.app.deploy) Server responded with code [400]:
  Bad Request Unexpected HTTP status 400


But since today I am getting this:
gcloud --verbosity debug preview app deploy app.yaml --set-default
DEBUG: Running gcloud.preview.app.deploy with Namespace(__calliope_internal_deepest_parser=ArgumentParser(prog='gcloud.preview.app.deploy', usage=None, description="*(BETA)* This command is used to deploy both code and configuration to the App Engine\nserver.  As an input it takes one or more ``DEPLOYABLES'' that should be\nuploaded.  A ``DEPLOYABLE'' can be a module's .yaml file or a configuration's\n.yaml file.", version=None, formatter_class=<class 'argparse.HelpFormatter'>, conflict_handler='error', add_help=False), cmd_func=<bound method Command.Run of <googlecloudsdk.calliope.backend.Command object at 0x7fcce2105d90>>, command_path=['gcloud', 'preview', 'app', 'deploy'], deployables=['app.yaml'], document=None, env_vars=None, force=False, format=None, h=None, help=None, http_timeout=None, log_http=None, markdown=None, project=None, quiet=None, remote=False, server=None, set_default=True, trace_token=None, user_output_enabled=None, verbosity='debug', version=None).
You are about to deploy the following modules:
 - academic-torch-95915/default/20150601t140217  From: [/home/julien/1-hello-world/app.yaml]
Do you want to continue (Y/n)?  Y

DEBUG: _Authenticate configuring auth; needs_auth=False
DEBUG: Sending request to https://appengine.google.com/api/vms/prepare?app_id=academic-torch-95915 headers={'X-appcfg-api-version': '1', 'content-length': '0', 'Content-Type': 'application/octet-stream'} body=
INFO: Attempting refresh to obtain initial access_token
INFO: Refreshing access_token
DEBUG: Got response: {bucket: vm-containers.academic-torch-95915.appspot.com, path: /containers}

INFO: Refreshing access_token
DEBUG: Detected docker environment variables: DOCKER_HOST=None, DOCKER_CERT_PATH=None, DOCKER_TLS_VERIFY=None
WARNING: Found a stale /var/run/docker.sock, did you forget to start your docker daemon?
DEBUG: (gcloud.preview.app.deploy) Couldn't connect to the docker daemon.
Please check if the environment variables DOCKER_HOST, DOCKER_CERT_PATH and DOCKER_TLS_VERIFY are set correctly. If you are using boot2docker, you can set them up by executing the commands that are shown by:
boot2docker shellinit
Traceback (most recent call last):
  File "/home/julien/Documents/tasks/googleCloud/google-cloud-sdk/./lib/googlecloudsdk/calliope/cli.py", line 537, in Execute
    result = args.cmd_func(cli=self, args=args)
  File "/home/julien/Documents/tasks/googleCloud/google-cloud-sdk/./lib/googlecloudsdk/calliope/backend.py", line 1089, in Run
    result = command_instance.Run(args)
  File "/home/julien/Documents/tasks/googleCloud/google-cloud-sdk/lib/googlecloudsdk/appengine/app_commands/deploy.py", line 115, in Run
    timeout=config.DOCKER_D_REQUEST_TIMEOUT)
  File "/home/julien/Documents/tasks/googleCloud/google-cloud-sdk/./lib/googlecloudsdk/appengine/lib/docker/containers.py", line 282, in NewDockerClient
    client = NewDockerClientNoCheck(**kwargs)
  File "/home/julien/Documents/tasks/googleCloud/google-cloud-sdk/./lib/googlecloudsdk/appengine/lib/docker/containers.py", line 265, in NewDockerClientNoCheck
    raise DockerDaemonConnectionError(DOCKER_CONNECTION_ERROR)
DockerDaemonConnectionError: Couldn't connect to the docker daemon.
Please check if the environment variables DOCKER_HOST, DOCKER_CERT_PATH and DOCKER_TLS_VERIFY are set correctly. If you are using boot2docker, you can set them up by executing the commands that are shown by:
boot2docker shellinit
ERROR: (gcloud.preview.app.deploy) Couldn't connect to the docker daemon.
Please check if the environment variables DOCKER_HOST, DOCKER_CERT_PATH and DOCKER_TLS_VERIFY are set correctly. If you are using boot2docker, you can set them up by executing the commands that are shown by:
boot2docker shellinit

Ryan (Cloud Platform Support)

unread,
Jun 1, 2015, 3:12:55 PM6/1/15
to google-a...@googlegroups.com, julien...@gmail.com

Danny Leshem

unread,
Jun 2, 2015, 9:25:07 AM6/2/15
to google-a...@googlegroups.com, julien...@gmail.com
Apparently the issue (at least in our case) was that billing was not enabled for the GCP project.

Our bad! (though it would be helpful if the error message was more informative)

Ryan (Cloud Platform Support)

unread,
Jun 2, 2015, 10:35:10 AM6/2/15
to google-a...@googlegroups.com, dle...@gmail.com, julien...@gmail.com
Looks like most of the issues have been resolved. I took away that the error messages should be clearer. Please star this PIT to add your voice to the thread.

Julien

unread,
Jun 4, 2015, 12:52:31 PM6/4/15
to google-a...@googlegroups.com, dle...@gmail.com, julien...@gmail.com
Thanks a lot for the help Ryan. 
Even though it is supposed to be an optional configuration, I had to do the following to fix the problem (from http://docs.docker.com/installation/ubuntulinux/):

To create the docker group and add your user:

  1. Log into Ubuntu as a user with sudo privileges.

    This procedure assumes you log in as the ubuntu user.

  2. Create the docker group and add your user.

    $ sudo usermod -aG docker ubuntu
  3. Log out and log back in.

    This ensures your user is running with the correct permissions.

  4. Verify your work by running docker without sudo.

    $ docker run hello-world

Ryan (Cloud Platform Support)

unread,
Jun 4, 2015, 12:55:44 PM6/4/15
to google-a...@googlegroups.com, julien...@gmail.com, dle...@gmail.com
I'm glad that fixed the issue!

Seth Thompson

unread,
Jun 5, 2015, 5:11:59 PM6/5/15
to google-a...@googlegroups.com, julien...@gmail.com, dle...@gmail.com
Hi all,

We just submitted a fix for the opaque 400 error messages.  Now, gcloud will return the full body of the 400 error which should give you a bit more diagnostic information about why the deploy was failing (for example, by noting that billing is not enabled).

The change will be shipped in the Cloud SDK release on June 17.

Sorry for the additional debugging time this caused.

Cheers,
Seth
Cloud SDK Team

László Borsos

unread,
Jun 8, 2015, 1:10:43 AM6/8/15
to google-a...@googlegroups.com, dle...@gmail.com, julien...@gmail.com
I enabled billing, but I still get the error on deploy. I cannot determine the location for my project. The app runs fine locally.

László Borsos

unread,
Jun 8, 2015, 1:39:39 AM6/8/15
to google-a...@googlegroups.com
Ultimately it succeeded after re-running

gcloud auth login

It may be needed again after billing is enabled, or I simply got lucky.

Anthony DeFrancesco

unread,
Jun 13, 2015, 12:52:58 PM6/13/15
to google-a...@googlegroups.com
I am running into the same issue trying to update my app engine application, its a java app. I have billing enabled and related into the tool using cloud auth login and still no luck.

The app is hosted in the US

Tommy Maloney

unread,
Jun 14, 2015, 3:08:21 PM6/14/15
to google-a...@googlegroups.com

Ryan (Cloud Platform Support)

unread,
Jun 15, 2015, 10:28:43 AM6/15/15
to google-a...@googlegroups.com, Anthony DeFrancesco
@Anthony

Make sure you do the extra steps for Java

@ Tommy

Look like you are running PHP. Can you deploy one of the Standard Runtimes to make sure it's not an issue with the PHP.

@Both

Revoke and re-do your auth, double check your Billing and try deploying the basic Python project. 

Anthony DeFrancesco

unread,
Jun 15, 2015, 12:24:39 PM6/15/15
to google-a...@googlegroups.com
@Ryan
Thank you that was my issue!

--
You received this message because you are subscribed to a topic in the Google Groups "Google App Engine" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-appengine/V5iiwg6nWgA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-appengi...@googlegroups.com.
To post to this group, send email to google-a...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/ef09e523-d79c-4f13-9595-96999e212d22%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--

Anthony DeFrancesco

Ryan (Cloud Platform Support)

unread,
Jun 15, 2015, 12:44:10 PM6/15/15
to google-a...@googlegroups.com, Anthony DeFrancesco
My pleasure! Happy Coding! 


On Monday, June 15, 2015 at 12:24:39 PM UTC-4, Anthony DeFrancesco wrote:
@Ryan
Thank you that was my issue!

On Mon, Jun 15, 2015 at 10:28 AM Ryan (Cloud Platform Support) <rbru...@google.com> wrote:
@Anthony

Make sure you do the extra steps for Java

@ Tommy

Look like you are running PHP. Can you deploy one of the Standard Runtimes to make sure it's not an issue with the PHP.

@Both

Revoke and re-do your auth, double check your Billing and try deploying the basic Python project. 


On Saturday, June 13, 2015 at 12:52:58 PM UTC-4, Anthony DeFrancesco wrote:
I am running into the same issue trying to update my app engine application, its a java app. I have billing enabled and related into the tool using cloud auth login and still no luck.

The app is hosted in the US

--
You received this message because you are subscribed to a topic in the Google Groups "Google App Engine" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-appengine/V5iiwg6nWgA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-appengine+unsubscribe@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
--

Anthony DeFrancesco

Reply all
Reply to author
Forward
0 new messages