LoginSignup
0
0

More than 5 years have passed since last update.

Cloud Functions(Python)でcopy.pyが含まれているとデプロイに失敗する

Posted at

概要

表題どおり。

再現方法

GCPのプロジェクト、Cloud Functionsやgcloud コマンドが利用できる前提です。

> cat <<EOF > main.py
def hoge(request):
  return 'hoge!'
EOF

> touch copy.py

> gcloud functions deploy hoge --runtime=python37 --trigger-http

Deploying function (may take a while - up to 2 minutes)...failed.
ERROR: (gcloud.functions.deploy) OperationError: code=3, message=Function load error: Error: cannot communicate with function.

調査

コマンド的な名前のファイルが含まれていると駄目なのかなと他にもそれらしきファイル名にして試してみました。

ファイル名 結果
copy.py
move.py
deepcopy.py
setup.py

うーん。copy.py 以外はいけるっぽい。

copy.pysrc/copy.py に移動してデプロイしてみると、デプロイも関数実行も問題なし。

なぞです。

まとめ

copy.py ってファイル名をつけてデプロイしなければ問題はありません。
原因がわからないままだと、もやもやするので、gcloud feadback コマンドからIssue登録しておきました。

(要Googleアカウントでログイン)
https://issuetracker.google.com/issues/117237035

さっそくコメントをいただき、不具合の再現ができたので、Cloud Functionsの開発チームへ共有するとのことです^^

Thank you for this detailed bug report. I was able to reproduce the reported behavior on my end. Your bug request is forwarded to the Google Cloud Functions team to be investigated. However, I cannot offer you with an ETA for its resolution at this time.

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0