ERR_TOO_MANY_REDIRECTS = a lot of HTTP 307 responses when I switch from "vm: true" to "env: flex"

280 views
Skip to first unread message

Fouad Almalki

unread,
Nov 20, 2016, 6:00:52 AM11/20/16
to Google Cloud Endpoints
I switched to "env: flex" and when I try to access the endpoints v2 APIs I got ERR_TOO_MANY_REDIRECTS in chrome and the logs have a lot of HTTP 307 responses:

structPayload: {
method: "GET" 
latencySeconds: "0.000" 
referer: "-" 
host: "-" 
user: "-" 
code: "307" 
remote: "***.***.***.***" 
agent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.52 Safari/537.36,gzip(gfe)" 
path: "/_ah/api/userAPI/v1/echo?message=abc" 
size: "180" 

Sepehr Ebrahimzadeh

unread,
Nov 20, 2016, 1:27:47 PM11/20/16
to Fouad Almalki, Google Cloud Endpoints
Hi Fouad,
This is because of a change in the domain name for GAE Flex when switching from "vm: true" to "env: flex" (which is currently in Beta).

Please see here for more information:

Thanks,
Sep


--
You received this message because you are subscribed to the Google Groups "Google Cloud Endpoints" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-endpoints+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-endpoints/f8747fba-8560-4a00-8dba-3d7fb8282153%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Fouad Almalki

unread,
Nov 20, 2016, 1:37:14 PM11/20/16
to Google Cloud Endpoints, engineer...@gmail.com
Great. Now, I changed all appspot.com to appspot-preview.com. However, when I try to invoke the following command:

gcloud beta service-management deploy swagger.yaml

I got the following error:

ERROR: (gcloud.beta.service-management.deploy) PERMISSION_DENIED: Ownership for domain name 'backend-dot-****-test.appspot-preview.com' on project '****-test' cannot be verified.

Sepehr Ebrahimzadeh

unread,
Nov 20, 2016, 5:54:59 PM11/20/16
to Fouad Almalki, Google Cloud Endpoints

That makes sense Fouad. I should have been clearer in my initial email:

The host field in your swagger open API specifications does not need to be updated. You can continue to use the "myapi.myproject.appspot.com" name which is your Endpoints service's identifier regardless of whether you choose to host your backends on GAE, GCE or GKE.

Since your are using GAE, a DNS name in the form of "my-gae-service.myproject.appspot.com" (and now *.appspot-preview.com for env:flex) is automatically created for the backends that you deploy to GAE. The "my-gae-service" part comes from your app.yaml's optional "service" field. This DNS name is separate from the Endpoints service name in the swagger API specification.

I also recognize that our documentation needs to clarify this separation of Endpoints service name vs GAE DNS name. We are actively working on making this clearer both in documentation and in the tooling.


To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-endpoints+unsubscri...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google Cloud Endpoints" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-endpoints+unsub...@googlegroups.com.

Fouad Almalki

unread,
Nov 21, 2016, 5:32:44 AM11/21/16
to Google Cloud Endpoints, engineer...@gmail.com
I used backend-api.****-test.appspot.com for the "host" in swagger.json, however,

backend-api.****-test.appspot.com/_ah/api/userAPI/v1/echo?message=abc returns HTTP 404

backend.****-test.appspot.com/_ah/api/userAPI/v1/echo?message=abc -> the same too many redirects error.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-endpoints+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-endpoints/f8747fba-8560-4a00-8dba-3d7fb8282153%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Fouad Almalki

unread,
Nov 21, 2016, 5:49:30 AM11/21/16
to Google Cloud Endpoints
To add more info regarding this issue,



When I hit 1-dot-backend-dot-****-test.appspot-preview.com/_ah/api/userAPI/v1/echo?message=abc, it redirects me to 1-dot-backend-dot-****-test.appspot-preview.com/_ah/api/userAPI/v1/echo?message=abc, so it's infinite redirecting loop.

Sepehr Ebrahimzadeh

unread,
Nov 21, 2016, 2:07:58 PM11/21/16
to Fouad Almalki, Google Cloud Endpoints
Hi Fouad, I'll reach out to you privately to get more debug information to better understand what's causing this issue.

--
You received this message because you are subscribed to the Google Groups "Google Cloud Endpoints" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-endpoints+unsub...@googlegroups.com.

Fouad Almalki

unread,
Dec 6, 2016, 6:41:14 AM12/6/16
to Google Cloud Endpoints
It seems that Google has fixed this issue. It's working just fine now.


On Sunday, November 20, 2016 at 2:00:52 PM UTC+3, Fouad Almalki wrote:

Jason Allor

unread,
Dec 6, 2016, 3:07:15 PM12/6/16
to Fouad Almalki, Google Cloud Endpoints
Great! Thanks for confirming Fouad.

--
You received this message because you are subscribed to the Google Groups "Google Cloud Endpoints" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-endpoints+unsub...@googlegroups.com.

Fouad Almalki

unread,
Dec 10, 2016, 4:35:20 AM12/10/16
to Google Cloud Endpoints
It is happening again now. The old version I deployed earlier is working fine. However, any new deployment will have redirect issues :(


On Sunday, November 20, 2016 at 2:00:52 PM UTC+3, Fouad Almalki wrote:

Sepehr Ebrahimzadeh

unread,
Dec 11, 2016, 11:00:57 PM12/11/16
to Google Cloud Endpoints
Hi Fouad, I've reached out to you on the other email thread to get more debug information again to help the GAE Flex team investigate this.

Fouad Almalki

unread,
Dec 14, 2016, 11:00:55 AM12/14/16
to Google Cloud Endpoints
Thanks Sepehr for the help.

For anyone facing this issue, just replace the base path "/_ah/api/" with anything else and it will work :)
Reply all
Reply to author
Forward
0 new messages