Comments (9)
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.
I'm getting this error all the time as well
from appengine-sidecars-docker.
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.
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.
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.
I also created this issue in the public tracker: https://issuetracker.google.com/u/2/issues/71050584
from appengine-sidecars-docker.
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.
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:
- https://groups.google.com/forum/#!topic/gce-discussion/b7Meu1SkVdU
- https://groups.google.com/forum/#!topic/gce-discussion/SSbAYlkA6I0
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.
The api_proxy sidecar has now been deleted.
from appengine-sidecars-docker.
Related Issues (11)
- Audit Fluentd configuration with wildcards "*" to avoid log duplication HOT 1
- Logrotate config for nginx HOT 1
- Rotate custom logs HOT 1
- Switch from glog to zap.Logger in Opentelemetry Collector HOT 1
- OpenTelemetry Collector is disabled HOT 2
- Error sending VM ready time metrics
- OpenTelemetry Generic OTLP Receiver HOT 1
- Proxy settings for websockets HOT 1
- Logging X-Forwarded-For in jsonPayload HOT 2
- fluentd_logger ruby process using 80% memory and causing instance to restart HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from appengine-sidecars-docker.