Google 地理编码 API 返回 500 内部服务器错误

Google Geocoding API returning 500 Internal Server Error

让我先说明一下:我不是开发人员。我目前正在使用 Mulesoft 来集成多个系统(最初由外包开发人员开发的应用程序)。该应用程序的一部分是合并可能跨系统通用的记录。为此,我使用了相关地址的记录名称和地理编码。直到上周,这一切都很好。现在,当这部分应用程序运行时,我收到错误消息。来自失败的特定调用的调试日志是:

[2016-10-11 16:02:06.163] DEBUG  com.ning.http.client.providers.grizzly.AsyncHttpClientFilter [[tbosa-rpm].DefaultSftpConnector.receiver.01]: (t:null) REQUEST: HttpRequestPacket ( method=GET
url=/maps/api/geocode/json
query=key=[REMOVED]&address=%[REMOVED]%20[REMOVED]%20[REMOVED]%2CSPRING%20BRANCH%2CTX%22
protocol=HTTP/1.1
content-length=-1
headers=[
MULE_CORRELATION_SEQUENCE=969
MULE_CORRELATION_ID=bd4249f0-8fcb-11e6-9620-12fd3e455356
MULE_CORRELATION_GROUP_SIZE=4375
Host=maps.googleapis.com:443
User-Agent=AHC/1.0
Connection=keep-alive
Accept=*/*]
)
[2016-10-11 16:02:06.164] DEBUG org.mule.module.http.internal.HttpMessageLogger [[tbosa-rpm].DefaultSftpConnector.receiver.01]: (t:null) REQUESTER
GET /maps/api/geocode/json?key=[REMOVED]&address=%[REMOVED]%20[REMOVED]%20[REMOVED]%2CSPRING%20BRANCH%2CTX%22 HTTP/1.1

MULE_CORRELATION_SEQUENCE: 969

MULE_CORRELATION_ID: bd4249f0-8fcb-11e6-9620-12fd3e455356

MULE_CORRELATION_GROUP_SIZE: 4375

Host: maps.googleapis.com:443

User-Agent: AHC/1.0

Connection: keep-alive

Accept: */*

Content-Type: application/json; charset=UTF-8


[2016-10-11 16:02:07.684] DEBUG org.mule.module.http.internal.HttpMessageLogger [[tbosa-rpm].http.requester.GeocoderRequest.worker(1)]: (t:null) REQUESTER
HTTP/1.1 500 Internal Server Error

Content-Type: application/json; charset=UTF-8

Date: Tue, 11 Oct 2016 16:02:07 GMT

Pragma: no-cache

Expires: Fri, 01 Jan 1990 00:00:00 GMT

Cache-Control: no-cache, must-revalidate

Access-Control-Allow-Origin: *

Server: mafe

X-XSS-Protection: 1; mode=block

X-Frame-Options: SAMEORIGIN

Alt-Svc: quic=":443"; ma=2592000; v="36,35,34,33,32"

Accept-Ranges: none

Vary: Accept-Language,Accept-Encoding

Transfer-Encoding: chunked

35

{
"results" : [],
"status" : "UNKNOWN_ERROR"
}


0

[2016-10-11 16:02:07.684] DEBUG com.ning.http.client.providers.grizzly.AhcEventFilter [[tbosa-rpm].http.requester.GeocoderRequest.worker(1)]: (t:null) RESPONSE: HttpResponsePacket (
status=500
reason=Internal Server Error
protocol=HTTP/1.1
content-length=-1
committed=false
headers=[
content-type=application/json; charset=UTF-8
date=Tue, 11 Oct 2016 16:02:07 GMT
pragma=no-cache
expires=Fri, 01 Jan 1990 00:00:00 GMT
cache-control=no-cache, must-revalidate
access-control-allow-origin=*
server=mafe
x-xss-protection=1; mode=block
x-frame-options=SAMEORIGIN
alt-svc=quic=":443"; ma=2592000; v="36,35,34,33,32"
accept-ranges=none
vary=Accept-Language,Accept-Encoding
transfer-encoding=chunked]
)

问题似乎不在于地理编码 API 本身,因为我可以毫无问题地手动调用同一地址。连接受到限制,因此我们不应该遇到每秒请求的任何限制。这是管理 API 调用的应用程序中的一段代码:

<flow name="rpm-geocode-lookup" processingStrategy="synchronous">
    <set-payload value="#[payload.addressLine1],#[payload.city],#[payload.state]" doc:name="Set Location"/>
    <ee:cache cachingStrategy-ref="GeocoderCachingStrategy" doc:name="Geocoder Cache">
        <json:object-to-json-transformer doc:name="Object to JSON"/>
        <logger level="DEBUG" category="com.tbosa.esb.rpm" message="Making call to Geocoder for #[payload]" doc:name="Not Cached"/>
        <http:request config-ref="GeocoderRequest" path="/geocode/json" method="GET" doc:name="Geocoder Request">
            <http:request-builder>
                <http:query-param paramName="key" value="${geocoder.key}"/>
                <http:query-param paramName="address" value="#[payload]"/>
            </http:request-builder>
        </http:request>
        <json:json-to-object-transformer returnClass="java.util.Map" doc:name="JSON to Object"/>
        <choice doc:name="Choice">
            <when expression="#[payload.status == 'OK' || payload.results.size() &gt; 0]">
                <set-payload value="#[new java.lang.String(payload.results[0].geometry.location.lat) + payload.results[0].geometry.location.lng]" doc:name="Latitude+Longitude"/>
            </when>
            <otherwise>
                <logger message="Geocoder did not return any results. Result: #[payload]" level="WARN" category="com.tbosa.esb.rpm" doc:name="Logger"/>
                <set-payload value="''" doc:name="Blank Value"/>
            </otherwise>
        </choice>
        <expression-component doc:name="Expression">Thread.sleep(${geocoder.throttle.delay});</expression-component>
    </ee:cache>
    <exception-strategy ref="EmailExceptionStrategy" doc:name="Exceptions"/>        
</flow>

应用程序没有改变。我们已经 运行 成功使用了 9 个月,所以我不确定问题出在哪里。老实说,我倾向于 Mulesoft 的问题,但他们试图告诉我这是 API 的问题。想法?

500 错误表示在处理请求期间 Google 端发生错误。您是否在短暂延迟后重试请求?

尝试找出哪个 Google IP 地址访问了您的应用程序。您可以在执行应用程序的计算机上使用 traceroute maps.googleapis.comping maps.googleapis.com

如果 500 错误仍然存​​在,我建议在 public 问题跟踪器中提交问题,其中包含 traceroute 和 ping 的结果、演示该问题的示例 HTTP 请求、您的 public IP 地址和您的项目编号.

https://code.google.com/p/gmaps-api-issues/

希望对您有所帮助!