【发布时间】:2018-03-16 22:54:35
【问题描述】:
当我在主插槽上运行 HTTP 触发函数应用程序时,我收到以下错误消息:
Status: 502 Bad Gateway
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<title>502 - Web server received an invalid response while acting as a gateway or proxy server.</title>
<style type="text/css">
<!--
body{margin:0;font-size:.7em;font-family:Verdana, Arial, Helvetica, sans-serif;background:#EEEEEE;}
fieldset{padding:0 15px 10px 15px;}
h1{font-size:2.4em;margin:0;color:#FFF;}
h2{font-size:1.7em;margin:0;color:#CC0000;}
h3{font-size:1.2em;margin:10px 0 0 0;color:#000000;}
#header{width:96%;margin:0 0 0 0;padding:6px 2% 6px 2%;font-family:"trebuchet MS", Verdana, sans-serif;color:#FFF;
background-color:#555555;}
#content{margin:0 0 0 2%;position:relative;}
.content-container{background:#FFF;width:96%;margin-top:8px;padding:10px;position:relative;}
-->
</style>
</head>
<body>
<div id="header"><h1>Server Error</h1></div>
<div id="content">
<div class="content-container"><fieldset>
<h2>502 - Web server received an invalid response while acting as a gateway or proxy server.</h2>
<h3>There is a problem with the page you are looking for, and it cannot be displayed. When the Web server (while acting as a gateway or proxy) contacted the upstream content server, it received an invalid response from the content server.</h3>
</fieldset></div>
</div>
</body>
</html>
但是当我尝试使用完全相同的代码创建一个新的插槽和函数应用程序时,它可以正常工作而不会出现上述错误。似乎我们的主插槽配置存在问题,但我找不到任何资源来指向它。
还有其他人遇到过这个问题吗?你怎么修好它的?
【问题讨论】:
-
您是否在主插槽上设置了授权?在某些情况下,当配置错误时,可能会导致这种情况。您能否直接或indirectly 分享您的函数应用名称(即app 名称,而不是函数名称!)?这将有助于我们进行调查。
-
嗨@david,感谢您的回复。我们遇到问题的函数应用名称 2017-10-06T04:11:48.364 Function completed (Success, Id=94059cd4-e16d-4305-826b-fc107b538e81, Duration=825ms) 我不是确定授权设置,但如果有帮助,我可以更改函数应用的应用程序设置。
-
这些错误取决于函数正在执行的功能类型,可能是某些数据库操作可能需要很长时间才能响应..如果使用 at oll,您还可以检查数据库连接字符串。
-
@astro 调用是为了测试插槽而不是主插槽,对吧?请注意它是否相关,但我确实在与
addProductOC函数相关的日志中看到错误:TypeError: Cannot read property '1' of undefined在第 101 行(大约在您共享的调用时间)。 -
@MitinDixit 谢谢!我们正在运行的函数是一个 HTTP 触发函数,它仅充当调用另一个 3rd 方 API 的网关。没有数据库调用或任何长时间运行的计算。我创建的测试槽在主槽中运行的代码完全相同。
标签: azure azure-functions