I use Google Cloud Endpoints for my application. Whenever I hit the application root, it gives an error. The console says:
Importing endpoints from google.appengine.ext is deprecated and will be removed. Add the endpoints library to app.yaml, then endpoints can be imported simply with "import endpoints".
There is no mention of this in the documentation and I believe I am doing this correctly.
I tried adding endpoints to the library section of app.yaml, but the deployment failed saying that it wasn't a valid library. When I look in the instance page, it says that my instances are running on App Engine 1.8.5, which is a pre-release version that hasn't even come out yet!
Is this a Google problem or something with my code?
The message you're seeing is a warning, not an error. Endpoints running on Python 2.7 will continue to work without code changes.
However, you may also be seeing an error if you're trying to run Endpoints on Python 2.5. This will no longer work, and unfortunately was not well communicated prior to the release. To resume use of Endpoints, you'll need to update your application to Python 2.7.
Related
I was in process of deploying my flask web app using google app engine and for achieving this step, I followed the below steps
Creating the code for the application (Web Based)
Creating a lib folder where all the packages are installed using the requirements.txt file
Created appengine_config.py where the lib folder is added.
Created the file app.yaml to test the application on the local system before deploying on the google app engine.
I was successful in these 4 steps. After the completion of these steps,
I run the below command
/usr/lib/google-cloud-sdk/bin/dev_appserver.py --admin_port=9000 --port=9999 app.yaml
As a result, I found the google app engine is running successfully on the local server. Please see the screenshot for this from here but when I tried to run the code at port 9999 on local server, I got the below error
import multiprocessing
File "/usr/lib/python2.7/multiprocessing/__init__.py", line 65, in <module>
from multiprocessing.util import SUBDEBUG, SUBWARNING
File "/usr/lib/python2.7/multiprocessing/util.py", line 41, in <module>
from subprocess import _args_from_interpreter_flags
ImportError: cannot import name _args_from_interpreter_flags
To resolve this error, I searched on the internet about this error and came up with the below conclusion
"You can't use multiprocessing on appengine. Multiprocessing is for
creating and coordinating sub processes for parallelism.
That is not an option on appengine. Appengine has other facilities like
async methods, task queues and backends (which can use traditional
threading)."
From my research on internet, above error is caused by multiprocessing and subprocess.py and google cloud engine does not support this.
My worry is if this is exactly the same as I understand then what is the way to tackle this as this would not let the code to be deployed on the google cloud engine.
Any ideas or solution is highly appreciated.
The conclusion that you have reached is absolutely correct in regards to App Engine Standard, which you seem to be using (based on the error that you are getting).
Due to how it’s implemented, App Engine Standard does not allow for multiprocessing. You can also check this Google Groups post for additional background.
Alternatively, you can use the Python runtime with App Engine Flex. That runtime uses Gunicorn, which uses workers to handle requests. With App Engine Flex, you will be able to configure the number of CPU cores for your application.
Keep in mind that App Engine Flex will incur costs based on usage rather than instance hours.
I'm getting a 404 error when trying to access an API in a non-default app engine deployment.
I have a deployed Cloud Endpoint (first version and not Cloud Framework) service with an app engine version of 1 and API version of 1. This is successfully deployed and accessible as the default version - http://{project-id}.appspot.com/_ah/api/{name}/v1/{relative-path}.
I also have a second deployment using Cloud Framework with an app engine version of 2 and API version of 2. I did this by first generating and deploying an API config file with the hostname {project-id}.appspot.com. I then deployed the new service under a version 2. Checking the AppEngine UI console shows the two different versions deployed with v1 as the default version serving all traffic.
The problem though is I cannot access an API on the 2nd version. When I try accessing an API method with the URL http://2-dot-{project-id}.appspot.com/_ah/api/{name}/v2/{relative-path}, I get a 404 error. I don't see any entries in the Log viewer for that request. However when I access the root path, http://2-dot-{project-id}.appspot.com, I also get a 404 but do see an entry in the Log viewer.
When I make v2 the default version by migrating all traffic to it, I can then access all APIs on the 2nd version via the URL http://{project-id}.appspot.com/_ah/api/{name}/v2/{relative-path}. I don't know why I can't access these APIs when it's the non-default version.
Am I accessing the v2 deployment the wrong way when it's the non-default version? I don't think so because when I make it the default the APIs work. Is it rather something to do with how I deployed the API spec for version 2? Does it for some reason not apply to a non-default 2-{project-id}.appspot.com request.
I tried to deploy new version to app engine. But it keeps saying
vm_check_disk_space.sh and health check logs.
and on web browser it gives me 502 error saying
Error: Server Error
The server encountered a temporary error and could not complete your
request.
Please try again in 30 seconds.
I have tried 4 times trying to deploy but never worked.
I think you can reproduce this by deploying any project to app engine.
I am using Google Cloud SDK 157.0.0
and
tried to deploy service with java and nodejs environment
I received many weird errors like this while deploying months ago with both maven and gradle. Various strange things with app.yaml can cause this as well. Even the example projects provided from google contained strange bugs like this when deployed.
Try one of the test projects that google provides: Google NodeJS bookshelf app
(Hopefully this project has been fixed by now and will deploy correctly!!)
Also, it's possible that an old version can prevent your new code from deploying. Go to your console, and delete/stop all running versions of the service. (I have had issues with old versions becoming stuck, which causes issues with the new deployment becoming the default service).
Recently I've found out App Engine 1.9.1 has a bug which however does not occur in version 1.8.9 and below. I am developing my applications with Eclipse and the Google Plugin for Eclipse. In the Google properties of the project I switched back to 1.8.9. If I work locally I can see that it is using version 1.8.9 (the bug does not occur) however when I deploy to App Engine no matter what I do it will still run on 1.9.1. I even tryed to create a new project/application from scratch, still 1.9.1. I even deleted SDKs 1.9.1 and 1.9.0 from my system but nothing seems to help. What can I do? Thanks.
You don't control the version in production. It runs on Google servers and isn't deployed as part of your app.
Welcome to the cloud world where some parameters slip from your hand no matter how hard you try...
Indeed, you have no control over the AppEngine version that will be used to run your application in production. In fact, if you look carefully in the list of instance on your cloud console, you will see sometimes that some instances use an AppEngine version that is not even publicly available at the moment.
I 'm building an AppEngine application that stores data in Google Cloud Storage. I use the Google Cloud Storage Client (GCS) library as suggested.
My app is working when deployed on AppEngine (reading/writing/listing objects) but I cannot make it work on the development server. The development server keeps returning error 404 and GCS raises NotFoundError. The dev-appserver is supposed to emulate the cloud storage functionality without any specific configurations etc. I see in the log files that the dev server is accepting requests at "/_ah/gcs" yet it seems that there is no handler for that url. I 've tried with version 1.8.5 and 1.8.6. Apart from my app, not even the demo app provided by Google works.
Is there something that I 'm missing here, e.g. a special configuration for the dev-appserver?
Sorry the following change was pushed out too early by mistake. It only works with 1.8.8 SDK. We are streamlining the release process of gcs client to align with SDK. Sorry
https://code.google.com/p/appengine-gcs-client/source/detail?r=125
Without this change, it works on 1.8.7 SDK.