跳转到主内容

返回REST调用并显示HTTP 502错误

Views:
26
Visibility:
Public
Votes:
0
Category:
ontap-9
Specialty:
core<a>2009230594</a>
Last Updated:

适用场景

  • ONTAP 9
  • /API/SnapMirror的REST修补程序

问题描述

  • PATCH 对SnapMirror执行REST API调用 <relationship-id> 以尝试 quiesce 建立关系。传递指定 return_timeout 的后、ONTAP 将返回 HTTP/502 错误、而不是预期 HTTP/200HTTP/202
> curl -ik -s -u <username>:<password> -X PATCH "https://<cluster_mgmt_lif>/api/snapmirror/relationships/<relationship-id>?failover=false&force-failover=false&force=false&failback=false&return_timeout=120" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \"state\": \"paused\"}"
HTTP/1.1 502 Proxy Error
Date: Wed, 03 Aug 2022 10:13:41 GMT
Server: Apache
X-Content-Type-Options: nosniff
Cache-Control: no-cache,no-store,must-revalidate
Content-Length: 341
Content-Type: text/html; charset=iso-8859-1

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>502 Proxy Error</title>
</head><body>
<h1>Proxy Error</h1>
<p>The proxy server received an invalid
response from an upstream server.<br />
The proxy server could not handle the request<p>Reason: <strong>Error reading from remote server</strong></p></p>
</body></html>
注意: 在上面的示例中、命令的执行 10:11:41 时间为 return_timeout 120秒(这是ONTAP REST支持的最大值)
  • apache_access.log 显示 HTTP/502 错误、但在周围日志条目的上下文中、延迟时间为 5min + return_timeout

[Wed Aug 03 10:18:38.554471 2022 +0000] "POST /servlets/netapp.servlets.admin.XMLrequest_filer HTTP/1.0" 200 190360 1537002 - 0 - 127.0.0.1 name-mapping-get-iter
[Wed Aug 03 10:13:41.088515 2022 +0000] "PATCH /api/snapmirror/relationships/<relationship-id>?failover=false&force-failover=false&force=false&failback=false&return_timeout=120 HTTP/1.1"502 341 300034196 - 0 + 127.0.0.1 -
[Wed Aug 03 10:18:40.333797 2022 +0000] "POST /servlets/netapp.servlets.admin.XMLrequest_filer HTTP/1.0" 200 191798 1701289 - 0 - 127.0.0.1 name-mapping-get-iter

  • audit.log 显示长时间后成功返回 return_timeout 的请求以及 HTTP/502 错误:

Wed Aug 03 2022 10:13:41 +00:00 [kern_audit:info:2561] 8503e80000a75342 :: <cluster_name>:http :: <REST-client-IP-address>:53495 :: <cluster_name>:<user_name> :: PATCH /api/snapmirror/relationships/<relationship-id>?failover=false&force-failover=false&force=false&failback=false&return_timeout=120 : { "state": "paused"} :: Pending
Wed Aug 03 2022 10:13:41 +00:00 [kern_audit:info:3229] 8503e80000a75342 :: <cluster_name>:http :: <REST-client-IP-address>:53495 :: <cluster_name>:<user_name> :: PATCH /api/snapmirror/relationships/<relationship-id>?failover=false&force-failover=false&force=false&failback=false&return_timeout=120 HTTP/1.1 :: Error: 502 Proxy Error
Wed Aug 03 2022 11:14:39 +00:00 [kern_audit:info:2561] 8503e80000a75342 :: <cluster_name>:http :: <REST-client-IP-address>:53495 :: <cluster_name>:<user_name> :: PATCH /api/snapmirror/relationships/<relationship-id>?failover=false&force-failover=false&force=false&failback=false&return_timeout=120 : { "state": "paused"} :: Success:

  • apache_error.log127.0.0.1:936 原始请求超时5分钟后报告REST API服务超时:
[Wed Aug 03 10:18:41.122493 2022 +0000] [proxy_http:error] [pid 12297:tid 34379805440] (70007)The timeout specified has expired: [client <REST-client-IP-address>:53495] AH01102: error reading status line from remote server 127.0.0.1:936
[Wed Aug 03 10:18:41.122529 2022 +0000] [proxy:error] [pid 12297:tid 34379805440] [client <REST-client-IP-address>:53495] AH00898: Error reading from remote server returned by /api/snapmirror/relationships/<relationship-id>
 
  • mgwd.logZSM 会在之后显示错误 return_timeout、并 snapmirror_relationship_rest 在之后成功返回:
Wed Aug 03 2022 10:13:41 +00:00 [kern_mgwd:info:2561] ZSM: parse error=Document is empty  {na_zapi_get_elem_from_raw_xml:1009}
Wed Aug 03 2022 11:13:30 +00:00 [kern_mgwd:info:2561]    snapmirror_relationship_rest.get_imp() returns: success (latency: 961.568391s) [<relationship-id>,<source_vserver>:<source_volume>,-,-,-,-,-,-,-,<destination_vserver>:<volume>,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,/api/snapmirror/relationships/<relationship-id>/,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-] (memory: -7188440 net, 7902568 max, 2199422456 allocated, 2206610896 freed, 14421787 allocations)
 

 

Sign in to view the entire content of this KB article.

New to NetApp?

Learn more about our award-winning Support

NetApp provides no representations or warranties regarding the accuracy or reliability or serviceability of any information or recommendations provided in this publication or with respect to any results that may be obtained by the use of the information or observance of any recommendations provided herein. The information in this document is distributed AS IS and the use of this information or the implementation of any recommendations or techniques herein is a customer's responsibility and depends on the customer's ability to evaluate and integrate them into the customer's operational environment. This document and the information contained herein may be used solely in connection with the NetApp products discussed in this document.