GAE: API serving not allowed for this application - google-app-engine

I am attempting to follow the tutorial at: http://www.youtube.com/watch?v=v9TG7OzsZqQ
My Cloud Endpoint REST API works well on my local development machine, but when I deploy to App Engine, I receive errors in my Admin Log that "API serving not allowed for this application".
Is this a paid feature that I must enable billing to receive? If not, is there documentation that explains this issue and how to fix this error?

To use Endpoints in production you need to be accepted into the trusted tester program. You can apply here. Mention this Stack Overflow post in your request and I'll see if I can expedite approval.

Related

Java 11 app running on Google Cloud App Engine fails with 401 error for registering debuggee

I deployed Java 11 app on Google Cloud App Engine, and app is running fine, I can see the home page in the browser, but when the app tries to call Microsoft Graph API (the HTTP call is executed by using Microsoft Graph SDK), I am getting runtime failure.
The failure relates to Google debugger, but I didn't even enable debugger. I found information that debugger is enabled by default when Google builds the container image. I have two options - either to figure out why I am getting 401 error for the debugger, and configure debugger properly, or disable debugger completely.
I tried to find information how to disable Google debugger for container image generation, but didn't find anything helpful. I also tried to find information how to configure debugger properly for app engine, and also was not able to find complete working instructions. Does someone know what I need to configure on App Engine to bypass this error:
java.io.IOException: Server returned HTTP response code: 401 for URL: https://clouddebugger.googleapis.com/v2/controller/debuggees/register
at com.google.devtools.cdbg.debuglets.java.GcpHubClient.registerDebuggee
Assuming your Java app is in an App Engine Standard environment and using the bundled services, then you are still using appengine-web.xml file for app configuration. As stated in GAE standard Issuing HTTP(S) Request documentation:
URL Fetch will handle all outbound requests and cause requests that you send to your VPC network or the client libraries to fail. If any of these scenarios apply to you, make sure that the url-stream-handler field in your configuration is not set to urlfetch.
This scenario includes Google Cloud Debugger Client for Java hence the HTTP error. As a workaround, you can omit the following line in the appengine-web.xml file:
<url-stream-handler>urlfetch</url-stream-handler>

SP implementation using Spring SAML extension with Google App Engine in Java

I try to make a SP hosted on Google app engine, with a third party IdP, and I'm facing multiple problems.
I'm using Spring SAML extension for java. I was able to run the stand alone (not in GAE) demo app, from the official guide http://docs.spring.io/spring-security-saml/docs/1.0.x/reference/html/chapter-quick-start.html using as IdP idp.ssocircle.com.
Now my problem comes whey I tried to integrate this code in my GAE project. When running with GAE I can get to the phase where I'm redirected to do the login on ssocircle.com and from there when I should be redirected back to my page I'm getting this error: "Error 401 Authentication Failed: Error decoding incoming SAML message", and on local GAE server logs I can see this message
"[INFO] Dec 17, 2014 5:21:23 PM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry [INFO] INFO: I/O exception (java.net.SocketException) caught when processing request: Permission denied: Not allowed to issue a socket bind: permission denied."
I was wondering if this is a limitation from GAE regarding sockets: 1) Sockets are available only for paid apps (I don't have a paid app, but could consider this options) 2) You cannot create a listen socket; you can only create outbound sockets. 3) You cannot bind to specific IP addresses or ports. (for me this one sounds like it is my problem).
And whey I tried to deploy on GAE, the app remained in a start-up loop because of other errors regarding "nested exception is java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "modifyThreadGroup")", that sounds like another GAE limitation to me.
At some point I was ready to gave up, because I was thinking that SAML Spring extension can't work with GAE, because of limitations present on GAE. But I see you have the same project running as a demo on GAE (or at least I think it is running on GAE because of the appspot part in domain name). https://saml-federation.appspot.com/saml/discovery?returnIDParam=idp&entityID=saml-federation.appspot.com
I would appreciate if you can give me some hints regarding my problems, and best would be if you could help me with the source code of this demo project (could not find it anywhere), and all configuration that is needed for GAE.
I've created a new repository https://github.com/vschafer/spring-security-saml-gae which includes instructions for deployment of Spring SAML applications on Google Application Engine. It also includes classes helping to avoid issues you're facing (sockets and threads).
In order to use it:
include the jar created from the repo in your project
use the provided org.springframework...StaticFilesystemMetadataProvider for loading of your metadata
in case you are using HTTP-Artifact binding replace bean org.springframework...ArtifactResolutionProfileImpl with org.springframework...google.ArtifactResolutionProfileGAE
Please comment if you spot some mistakes in the documentation or code.

Google App Engine: "The backend is locked down"

I am trying to test out the Google App Engine. I have created an appspot domain, downloaded the sample project and put in all credentials required. I have also enabled Google Cloud Messaging for Android.
When I hit the send button (in the samples GuestBookActivity), I get the message:
"The backend is locked down. The administrator can change the authentication/authorization settings on [my appspot domain]".
Does anyone know about this issue and how to resolve it?
As #Peter Knego said, see point 8 here: https://developers.google.com/cloud/samples/mbs/deploy_backend
I had forgot to open my server for development use.

SSL Error using custom domain with Google App Engine

I followed the steps detailed here to use a custom domain with google app engine.
I'm the admin of the Google Apps account
I'm the owner of the Google App Engine account
I've added the domain to my Google Apps account through my App Engine account
I see my App Engine app in my Google Apps account
I set the CNAME "test" to point to ghs.googlehosted.com
I added the web address under my Google Apps account and it says "Your users can access my-app-id at: test.mydomain.com
Now when I go to http://test.mydomain.com, it redirects to https://test.mydomain.com and I get an SSL connection error (Unable to make a secure connection to the server.)
I called Google Apps customer support because I have a paid business account, but the customer service guy said that this falls under App Engine support and he was not trained in this issue.
Help!
If you've done everything correctly, you should be able to access your site at http://test.mydomain.com. It sounds from the error you're getting that you're attempting to access it at https://test.mydomain.com (https as opposed to http).
If you want to access your app over SSL at your custom domain, you have more setup to do, as documented here: SSL for a Custom Domain. The steps necessary are many and subject to change; that link is the official source of current information on the matter.
Update: From your updated information, it sounds like you may have secure: always set in your app.yaml, or the Java-configuration equivalent of this setting. It would be helpful if you posted your configuration file.
Also note that it takes several minutes for Google to add a certificate on a domain you recently imported (it may require time for DNS configuration to spread). I personally didn't need to add any secure: configuration, it just worked after some time.

urlfetch.fetch() from Google App Engine not showing up in Fiddler2

I'm testing a Google App Engine app on my Windows machine, running locally on localhost:8084. Fiddler2 shows all my activity when I navigate around my app, but when requesting an external url with urlfetch.fetch() it doesn't show up in Fiddler at all, even when using an http, not an https address, and with a successful status code 200 in the response.
What do I need to do to get the urlfetch.fetch() request from Google App Engine to show up in Fiddler2?
My understanding is that Fiddler2 runs as an HTTP proxy; browser requests go through this proxy instead of directly to the internet resource. This allows Fiddler2 to capture information about the request and the response.
According to the Fiddler2 docs, "You can configure any application which accepts a HTTP Proxy to run through Fiddler so you can debug its traffic". So I think you would need to change the URLFetch API call to use a proxy, supplying the Fiddler URL and port. However, the URLFetch documentation doesn't specify exactly how to do this. You might be able to use urllib2 as specified in this question.
Irussell is generally right, but I'd like to make the answer more specific.
As proxies aren’t supported within Google AppEngine production environment, it’s not directly supported by development engine either. It seems that the only way to overcome this limitation is to modify the code of AppEngine development server.
You'll have to modify the urlfetch_stub.py file, by adding the following lines:
connection = connection_class('127.0.0.1', 8888)
and
full_path = protocol + "://" + host + full_path
You may find the detailed explanation in my blog post Use Fiddler to debug urlfetch requests in Google AppEngine

Resources