firebase部署 - 意外错误502错误和'无法创建属性'错误'在字符串'

时间:2018-04-30 18:29:46

标签: javascript firebase google-cloud-functions

我正在尝试将web-app部署到以前有效的firebase托管。我最近对该应用程序所做的更改是向firebase.json文件添加新的云功能和重写规则。该应用程序成功部署在"所有功能已成功部署"然后,步骤会向我显示'意外错误' 消息。我已尝试删除最新添加但仍出现错误。我也尝试更新到最新版本的Node并回滚到以前的版本无济于事。应用程序和功能使用' firebase服务'

重写所有工作而不会出错

我看到的两个错误是502错误,'无法创建属性错误'在字符串' ,但我不知道是什么导致这些错误,因为它们似乎只是在部署期间发生。我也无法在网上找到可行的解决方案。

我已将firebase-debug.log附加到最新部署以及我的firebase.json文件中,并附有我写过的重写规则。

我正在运行Windows 10 64位和Node v6.14.1

任何帮助将不胜感激!谢谢!

firebase.json

"database": {
    "rules": "database.rules.json"
  },
  "functions": {
    "predeploy": [
      "npm --prefix \"$RESOURCE_DIR\" run lint"
    ]
  },
  "hosting": {
    "public": "public",
    "rewrites" : [ {
        "source": "/inventory/**", "function": "loadItemPage"
      }, {
        "source": "/authenticate", "function": "loadAuthPage"
      }],
    "ignore": [
      "firebase.json",
      "**/.*",
      "**/node_modules/**"
    ]
  },
  "storage": {
    "rules": "storage.rules"
  }
}

firebase-debug.log(在错误之前开始)

[info] +  functions: all functions deployed successfully!
[debug] [2018-04-30T18:17:17.630Z] >>> HTTP REQUEST POST https://deploy.firebase.com/v1/projects/oldstrum-9ac64/releases { database: { rulesString: '{\r\n  "rules": {\r\n    ".read": "auth != null",\r\n    ".write": "auth != null"\r\n  }\r\n}' },
  storage: { rules: [ [Object] ] },
  hosting: 
   { public: 'public',
     rewrites: [ [Object], [Object] ],
     ignore: [ 'firebase.json', '**/.*', '**/node_modules/**' ],
     version: '-LBMlAb1hoCrTbJ8yJUC',
     prefix: '-LBMlAb1hoCrTbJ8yJUC/',
     manifest: [] } } 
 Mon Apr 30 2018 11:17:17 GMT-0700 (Pacific Daylight Time)
[debug] [2018-04-30T18:17:25.114Z] <<< HTTP RESPONSE 502
[debug] [2018-04-30T18:17:25.114Z] <<< HTTP RESPONSE BODY <html>
<head><title>502 Bad Gateway</title></head>
<body bgcolor="white">
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx</center>
</body>
</html>

[debug] [2018-04-30T18:17:25.115Z] TypeError: Cannot create property 'error' on string '<html>
<head><title>502 Bad Gateway</title></head>
<body bgcolor="white">
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx</center>
</body>
</html>
'
    at module.exports (C:\Users\Jesse Lee Kuras\AppData\Roaming\npm\node_modules\firebase-tools\lib\responseToError.js:11:16)
    at Request._callback (C:\Users\Jesse Lee Kuras\AppData\Roaming\npm\node_modules\firebase-tools\lib\api.js:39:25)
    at Request.self.callback (C:\Users\Jesse Lee Kuras\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\request\request.js:188:22)
    at emitTwo (events.js:106:13)
    at Request.emit (events.js:191:7)
    at Request.<anonymous> (C:\Users\Jesse Lee Kuras\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\request\request.js:1171:10)
    at emitOne (events.js:96:13)
    at Request.emit (events.js:188:7)
    at IncomingMessage.<anonymous> (C:\Users\Jesse Lee Kuras\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\request\request.js:1091:12)
    at IncomingMessage.g (events.js:292:16)
[error] 
[error] Error: An unexpected error has occurred.

0 个答案:

没有答案