本文介绍了灰烬AWS部署失败-CredentialsError&精神放松的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

难以将ember-cli-deploy插件成功部署到我们的AWS开发环境中.

Having trouble getting the ember-cli-deploy addon to deploy successfully to our AWS development environment.

管道似乎失败,从而导致以下两个错误之一:

The pipeline seems to fail resulting in one of two errors:

...
- build ok
|
+- didBuild
|
+- willPrepare
|
+- prepare
|  |
|  +- revision-data
- creating revision data using `version-commit`
- generated revision data for revision: `0.1.9+4a4f79a3`
|
+- didPrepare
|
+- fetchInitialRevisions
|  |
|  +- s3-index
|
+- didFail
CredentialsError: Missing credentials in config
CredentialsError: Missing credentials in config
    at ClientRequest.<anonymous> (/Users/certus/Desktop/branz-web/node_modules/aws-sdk/lib/http/node.js:83:34)
    at Object.onceWrapper (events.js:293:19)
    at emitNone (events.js:86:13)
    at ClientRequest.emit (events.js:188:7)
    at Socket.emitTimeout (_http_client.js:679:10)
    at Object.onceWrapper (events.js:293:19)
    at emitNone (events.js:86:13)
    at Socket.emit (events.js:188:7)
    at Socket._onTimeout (net.js:352:8)
|
Pipeline aborted

或者:

...
- build ok
|
+- didBuild
|
+- willPrepare
|
+- prepare
|  |
|  +- revision-data
- creating revision data using `version-commit`
- generated revision data for revision: `0.1.9+4a4f79a3`
|
+- didPrepare
|
+- fetchInitialRevisions
|  |
|  +- s3-index
events.js:163
      throw er; // Unhandled 'error' event
      ^

Error: connect EHOSTUNREACH 169.254.169.254:80 - Local (192.168.20.110:64572)
    at Object.exports._errnoException (util.js:1050:11)
    at exports._exceptionWithHostPort (util.js:1073:20)
    at internalConnect (net.js:889:16)
    at lookupAndConnect (net.js:977:5)
    at Socket.realConnect (net.js:945:5)
    at Agent.connect [as createConnection] (net.js:77:22)
    at Agent.createSocket (_http_agent.js:195:26)
    at Agent.addRequest (_http_agent.js:157:10)
    at new ClientRequest (_http_client.js:212:16)
    at Object.request (http.js:26:10)

根据ember-cli-deploy 文档,放在名为.env.deploy.develop的项目根目录中的文件中,其中包含AWS密钥和机密:

The AWS keys are stored, as per the ember-cli-deploy docs, in a file at the root of the project called .env.deploy.develop containing the AWS key and secrets:

AWS_KEY​=ABC..
AWS_SECRET​=ABC…

我相信构建设置没有问题,因为在我之前已经广泛使用了构建设置,但是,假设密钥和机密正确,那么我的另一端可能出什么问题了?

I am confident that there is nothing wrong with the build setup, as it was used extensively before me, however, what else could be going wrong on my end assuming the key and secret are correct?

我在其他地方读到,可用内存可能会起到一定的作用;因此,在尝试部署之前,我关闭了大多数正在运行的应用程序.在重新安装之前,还清除了node_modules并清除了npm缓存.但是,无济于事.

I have read elsewhere that memory available could play a factor; accordingly, I closed down most of the apps running before attempting to deploy. Have also cleared node_modules and cleared the npm cache before reinstalling. However, to no avail.

任何建议都将受到欢迎.

Any suggestions would be most welcome.

  • npm-v4.2.0
  • 节点-v7.10.1
  • ember-cli-v2.13.0
  • ember-cli-deploy-v1.0.2

推荐答案

好吧,进一步研究看来,问题在于该构建似乎无法读取包含AWS Key和Secret的.env文件,因为遇到第一个错误.

Ok, looking into this further, it seems that the issue is that the build can't seem to read the .env files containing the AWS key and secret as per the first error.

通过将机密和密钥硬编码到/config/deploy.js文件中来代替process.env.AWS_KEYprocess.env.AWS_SECRET变量,从而证实了这一点.

This was confirmed by hardcoding the secret and key into the /config/deploy.js file in replacement of the process.env.AWS_KEY and process.env.AWS_SECRET variables.

由于此问题不再与该问题的范围相关,因此我将关闭此问题,并.

Since this issue no longer relates the scope of this question, I will close this question and open another.

这篇关于灰烬AWS部署失败-CredentialsError&amp;精神放松的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 20:39