LoginSignup
0
0

More than 1 year has passed since last update.

CloudFunctionsをdeploy時、OperationError: code=3が表示される場合

Posted at

言語はPythonです。

エラー内容

ERROR: (gcloud.functions.deploy) OperationError: code=3, message=Function
failed on loading user code. Error message: Please examine your function
logs to see the error cause:
https://cloud.google.com/functions/docs/monitoring/logging#viewing_logs

公式の回答はこちらなのですが

Cloud Functions のトラブルシューティング | Google Cloud Functions に関するドキュメント

ここに書いてあるとおりにやっても駄目な場合

エントリ ポイントが正しく指定されていてもエラーになっている場合の対処方法

私の場合、原因は100%requirements.txtの内容が不足してました。

これが良い方法かわかりませんが、一度、全部pip uninstallして、requirements.txtをinstallすると、問題箇所がわかり、それをrequirements.txtに追加して直りました。

一旦、全部uninstallして

venv/bin/python venv/bin/pip freeze | xargs venv/bin/pip uninstall -y

全部入れてみる

venv/bin/python venv/bin/pip -r requirements.txt

この後、問題箇所がわかるので、requirements.txtに追加する。

でもこれはかなり強引な方法なので、自信がない人はやらないほうがいいです。よくわかってる人と一緒にやってみてください。

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