2017-12-30 46 views
0

Google Cloud機能用にGitHub auto-deployerをインストールしましたが、私の機能をGitHubリポジトリにプッシュすると、抽象的なエラーメッセージ"The request has errors"が詳細を記述します。特にここで何がうまくいかないのでしょうか?Google Cloud機能GitHubの自動デプロイヤーによると、リクエストにエラーがあります

E  githubAutoDeployer [CODE] 2017-12-30 19:19:37.362 
Failed to create function projects/[MY_BUCKET]/locations/us-central/functions/[MY_FUNCTION] { Error: The request has errors 
at Request._callback (/user_code/node_modules/googleapis/node_modules/google-auth-library/lib/transporters.js:85:15) 
at Request.self.callback (/user_code/node_modules/googleapis/node_modules/request/request.js:186:22) 
at emitTwo (events.js:106:13) 
at Request.emit (events.js:191:7) 
at Request.<anonymous> (/user_code/node_modules/googleapis/node_modules/request/request.js:1163:10) 
at emitOne (events.js:96:13) 
at Request.emit (events.js:188:7) 
at IncomingMessage.<anonymous> (/user_code/node_modules/googleapis/node_modules/request/request.js:1085:12) 
at IncomingMessage.g (events.js:292:16) 
at emitNone (events.js:91:20) 
code: 400, 
errors: 
[ { message: 'The request has errors',                
    domain: 'global',           
    reason: 'badRequest' } ] } 
E  githubAutoDeployer [CODE] 2017-12-30 19:19:37.363 Error: The request has errors 
at Request._callback (/user_code/node_modules/googleapis/node_modules/google-auth-library/lib/transporters.js:85:15) 
at Request.self.callback (/user_code/node_modules/googleapis/node_modules/request/request.js:186:22) 
at emitTwo (events.js:106:13) 
at Request.emit (events.js:191:7) 
at Request.<anonymous> (/user_code/node_modules/googleapis/node_modules/request/request.js:1163:10) 
at emitOne (events.js:96:13) 
at Request.emit (events.js:188:7) 
at IncomingMessage.<anonymous> (/user_code/node_modules/googleapis/node_modules/request/request.js:1085:12) 
at IncomingMessage.g (events.js:292:16) 
at emitNone (events.js:91:20) 
D  githubAutoDeployer [CODE] 2017-12-30 19:19:37.365 
Function execution took 2319 ms, finished with status code: 500 

UPDATEスタックトレースでgoogle-auth-libraryの言及は、私は何かが私の資格情報を使用して間違っていることを考えさせられました。しかしgcloud auth listからの出力は大丈夫表示されます:おそらく少し型破りで何

Credentialed Accounts 
ACTIVE ACCOUNT 
*  [MY_ID]@gmail.com 

UPDATE、私は私のconfig.json"path":"",を持っているということです。しかし私のindex.jsは私のリポジトリの一番上に直接存在するので、指定するパスはありません。

UPDATEThis Googleクラウド機能からエラーがgithubAutoDeployerによって渡される場合(アップストリームサーバー用、残念ながらソースコードは明らかに使用できません)です:

gcf.projects.locations.functions.create({ resource, location }, (err, operation) => { 
    if (err && err.errors && err.errors[0] && err.errors[0].reason === 'alreadyExists') { 
    // ... 
    } else if (err) { 
    console.error(`Failed to create function ${resource.name}`, err); 
    reject(err); 
    } 

答えて

0

トラブルは、私が"location" : "us-central"を指定されたことでしたus-central1supports Google Cloud Functions)の代わりにconfig.jsonです。

Google Cloud Functions API(サービスアカウントとアクセストークンなどを取得した後)に生のPOSTリクエストを送信したことがわかりました。このレベルではAPIは、明確なエラー表示を返します。

"fieldViolations": [ 
    { 
    "field": "region", 
    "description": "region us-central is not supported." 
    } 
] 

githubAutoDeployerが同じ電話をしようとしたときに明らかにし、残念ながら、これは、ログファイルのいずれかを入力しません。

関連する問題