Coder Social home page Coder Social logo

internal.flushLog: Flush RPC: service bridge returned HTTP 400 ("App Engine APIs over the Service Bridge are disabled.\nIf they are required, enable them by setting the following to your app.yaml:\n\nbeta_settings:\n enable_app_engine_apis: true\n") about appengine-sidecars-docker HOT 9 CLOSED

googlecloudplatform avatar googlecloudplatform commented on June 24, 2024
internal.flushLog: Flush RPC: service bridge returned HTTP 400 ("App Engine APIs over the Service Bridge are disabled.\nIf they are required, enable them by setting the following to your app.yaml:\n\nbeta_settings:\n enable_app_engine_apis: true\n")

from appengine-sidecars-docker.

Comments (9)

patthehuman avatar patthehuman commented on June 24, 2024 1

What is the status of this? These errors just started flooding my logs. Is this whats causing my server to lag horribly?

from appengine-sidecars-docker.

cnbuff410 avatar cnbuff410 commented on June 24, 2024

I'm getting this error all the time as well

from appengine-sidecars-docker.

mblasi avatar mblasi commented on June 24, 2024

Hi! Any update on this?

I migrated from standard GAE to flexible environment, and faced this issue when trying to do a POST request to a resource outside my app.

Regards,
Matías.

from appengine-sidecars-docker.

Cynocracy avatar Cynocracy commented on June 24, 2024

Hi (and apologies for the late response :)),

This error should only occur when you're attempting to make requests over the compatibility service bridge (this would occur only if you're making HTTP requests to appengine.googleapis.internal). If that's the case, it's likely a library you use (or the runtime itself) is making these requests.

Do you have a repro? It'd be useful to help pin down what could be making these requests on our end.

from appengine-sidecars-docker.

mblasi avatar mblasi commented on June 24, 2024

Thank you Cynocracy!

Here is the code I'm trying to run:

`
func Mp(c *gin.Context) {
ctx := trace.StartSpan(c, "mp.callback")
defer trace.EndSpan(ctx)

defer logger.Flush()

b := bytes.NewBuffer(make([]byte, 0))
reader := io.TeeReader(c.Request.Body, b)

var mpAuth MPAuth
if err := json.NewDecoder(reader).Decode(&mpAuth); err != nil {
	respondWithError(http.StatusInternalServerError, "Couldn't decode token", err, c)
}

c.Request.Body = ioutil.NopCloser(b)

data := url.Values{}
data.Set("client_secret", "TEST-123456789")
data.Add("grant_type", "authorization_code")
data.Add("code", mpAuth.Code)
data.Add("redirect_uri", mpAuth.RedirectUri)

method, err := http.NewRequest(http.MethodPost, "https://api.mercadopago.com/oauth/token", bytes.NewBufferString(data.Encode()))

if err != nil {
	respondWithError(http.StatusInternalServerError, "Error creating MP Post method: ", err, c)
}

method.Header.Add("accept", "application/json")
//method.Header.Add("content-type", "application/x-www-form-urlencoded")
method.Header.Set("Content-Type", "application/x-www-form-urlencoded; param=value")
method.Header.Add("Content-Length", strconv.Itoa(len(data.Encode())))

client := urlfetch.Client(appengine.BackgroundContext())

resp, err := client.Do(method)

if err != nil {
	respondWithError(http.StatusInternalServerError, "Error retrieving MP token", err, c)
} else if resp == nil {
	respondWithError(http.StatusInternalServerError, "Response vacío", errors.New(""), c)
} else {

	defer resp.Body.Close()
	response, _ := ioutil.ReadAll(resp.Body)

	var dat map[string]interface{}
	if err := json.Unmarshal(response, &dat); err != nil {
		respondWithError(http.StatusInternalServerError, "Error unmarshaling data: ", err, c)
	}

	c.JSON(http.StatusOK, dat)
}

}
`

I get the error from the client.Do(method) line.

I dont know if it is the case you pointed out. The real thing is I need to make a post to an external resource... it is an external system implementing oauth2.

Please, let me know if it is enough for you.

Best regards,
Matías.

from appengine-sidecars-docker.

mblasi avatar mblasi commented on June 24, 2024

I also created this issue in the public tracker: https://issuetracker.google.com/u/2/issues/71050584

from appengine-sidecars-docker.

Cynocracy avatar Cynocracy commented on June 24, 2024

Ah, I see the issue:

URLFetch is itself a compatibility API, you should be able to make HTTP requests normally using something idiomatic in the language. For go, I suppose that means the http package https://golang.org/pkg/net/http/

The main differences between Flex and Standard is the lack of these APIs, as well as an easier access to 'external' resources, so it makes sense that there'd be some confusion here. If there are any docs you think should be updated, feel free to link them and I can try to get someone to take a look :)

from appengine-sidecars-docker.

mblasi avatar mblasi commented on June 24, 2024

Thank you very much Cynocracy!
I'll be working on that then...
Regarding the documentation, in my humble opinion it is little confusing about standard and flexible differences, for example, this page: https://cloud.google.com/appengine/docs/flexible/go/migrating says:

URL Fetch

The flexible environment has no sandbox restrictions, so you can use any HTTP library.

In the other hand, this page: https://cloud.google.com/appengine/docs/flexible/go/flexible-for-standard-users says:

Accessing external services

In the standard environment, your application typically accesses services such as Cloud Datastore via the built-in google.appengine APIs. However, in the flexible environment, these APIs are no longer available. Instead, use the Google Cloud client libraries. These client libraries work everywhere, which means that your application is more portable. If needed, applications that run in the flexible environment can usually run on Kubernetes Engine or Compute Engine without heavy modification.

Anyhow, now, it is more clear for me!

I appreciate your support and, I'd like to take advantage of this thread to ask you about one more confusions between standard and flexible flavors: it is about the tracing mechanism.

I started a couple of threads in gce-discussion forum:

Main thread: https://groups.google.com/forum/#!topic/gce-discussion/1INCUtvc300
Two smaller questions:

The main thread, despite of it is working for me now, it focuses on the confusing documentation, pleaste take a look on my posts.
I'm still waiting for a clearer documentation about stackdriver an app engine...

Thanks again!
Matías.

from appengine-sidecars-docker.

Sanrag avatar Sanrag commented on June 24, 2024

The api_proxy sidecar has now been deleted.

from appengine-sidecars-docker.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.