proto: required field "{Unknown}" not set

719 views
Skip to first unread message

Drew Wells

unread,
Sep 30, 2015, 12:52:25 AM9/30/15
to google-appengine-go
I'm getting weird errors when attempting to make urlfetch calls out to third party services. Most disturbing is these errors show up raw in http responses and are invisible to my go app. When I deploy my app to a server, these calls work fine.

ERROR    2015-09-30 04:52:04,694 api_server.py:253] Exception while handling service_name: "urlfetch"
method: "Fetch"
request: "\010\001\0223https://fitkiq.test.makeplans.net/api/v1/resources/\033\"\nUser-Agent*&https://github.com/drewwells/makeplans\034\033\"\014Content-Type*\020application/json\034\033\"\006Accept*\020application/json\034\033\"\015Authorization*2Basic\0348\000H\000"
request_id: "gUCIIHqvsE"

Traceback (most recent call last):
  File "/opt/go_appengine/google/appengine/tools/devappserver2/api_server.py", line 228, in _handle_POST
    api_response = _execute_request(request).Encode()
  File "/opt/go_appengine/google/appengine/tools/devappserver2/api_server.py", line 186, in _execute_request
    make_request()
  File "/opt/go_appengine/google/appengine/tools/devappserver2/api_server.py", line 181, in make_request
    request_id)
  File "/opt/go_appengine/google/appengine/api/apiproxy_stub.py", line 131, in MakeSyncCall
    method(request, response)
  File "/opt/go_appengine/google/appengine/api/urlfetch_stub.py", line 236, in _Dynamic_Fetch
    validate_certificate=validate_certificate)
  File "/opt/go_appengine/google/appengine/api/urlfetch_stub.py", line 431, in _RetrieveURL
    connection.request(method, full_path, payload, adjusted_headers)
  File "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1053, in request
    self._send_request(method, url, body, headers)
  File "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1093, in _send_request
    self.endheaders(body)
  File "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1049, in endheaders
    self._send_output(message_body)
  File "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 893, in _send_output
    self.send(msg)
  File "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 855, in send
    self.connect()
  File "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1274, in connect
    server_hostname=server_hostname)
  File "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 352, in wrap_socket
    _context=self)
  File "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 579, in __init__
    self.do_handshake()
  File "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 816, in do_handshake
    match_hostname(self.getpeercert(), self.server_hostname)
  File "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 271, in match_hostname
    % (hostname, ', '.join(map(repr, dnsnames))))
CertificateError: hostname 'fitkiq.test.makeplans.net' doesn't match either of '*.herokuapp.com', 'herokuapp.com'

Drew Wells

unread,
Sep 30, 2015, 12:53:11 AM9/30/15
to google-appengine-go
The cert error shouldn't be happening, I have disabled cert checking by doing this:

getHTTPCli = func(r *http.Request) *http.Client {
ctx := appengine.NewContext(r)
return &http.Client{
Transport: &urlfetch.Transport{
Context: ctx,
AllowInvalidServerCertificate: true,

Christopher Hesse

unread,
Sep 30, 2015, 1:14:30 AM9/30/15
to google-appengine-go
If the cert thing didn't fix your issue, you could try using the socket API instead: https://gist.github.com/christopherhesse/f33fb2f0b1441c5d1175

I had to use it to do DELETE requests with a body, and it seems to work fine.

Drew Wells

unread,
Sep 30, 2015, 2:05:59 AM9/30/15
to Christopher Hesse, google-appengine-go
Hmm, good to know. 

I don't think that is my problem, if I set AllowInvalidServerCertificate to false there is a different error shown in the response. Also, the dev tools don't stack trace.

API error 6 (urlfetch: SSL_CERTIFICATE_ERROR): Host fitkiq.test.makeplans.net returned an invalid certificate (hostname mismatch)

setting it back to true... dev tools stacktrace and weird error in response
Get https://fitkiq.test.makeplans.net/api/v1/bookings: proto: required field "{Unknown}" not set

--
You received this message because you are subscribed to a topic in the Google Groups "google-appengine-go" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-appengine-go/rZAnPGwj528/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-appengin...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

David Symonds

unread,
Sep 30, 2015, 3:42:05 AM9/30/15
to Drew Wells, google-appengine-go
Those errors certainly shouldn't be appearing in the urlfetch body
like that. Could you file an issue?

Drew Wells

unread,
Sep 30, 2015, 11:27:35 AM9/30/15
to google-appengine-go, drew.w...@gmail.com
Okay, I'll simplify my example and send it in

Drew Wells

unread,
Oct 7, 2015, 7:37:33 PM10/7/15
to google-appengine-go


On Tuesday, September 29, 2015 at 11:52:25 PM UTC-5, Drew Wells wrote:
Reply all
Reply to author
Forward
0 new messages