GCPデプロイ時にERROR: gcloud crashed (UnicodeEncodeError): 'ascii' codec can't encode characters in position 1267-1299: ordinal not in range(128)と出たときの対処方法
Google Cloud Platform(GCP)のAPP Engineにデプロイしようとした際にエラーが出たのでその対処法メモです。
環境
- Windows10 64bit 1903
エラー内容
Beginning deployment of service [default]...
Building and pushing image for service [default]
ERROR: gcloud crashed (UnicodeEncodeError): 'ascii' codec can't encode characters in position 1267-1299: ordinal not in range(128)
If you would like to report this issue, please run the following command: gcloud feedback
To check gcloud for common problems, please run the following command: gcloud info --run-diagnostics
このようなエラーが発生。
原因
'ascii' codecあたりから文字エンコード周りで悪さをしていると判断しました。
Windows環境でPowershellを使用するとasciiを使用してしまうみたいです。
解決方法
結論から言うとWSL経由でDeployしました。
WindowsからDeployできないかと模索し、CHCP コマンドでコンソールの文字コードを変更してみたりしたのですがUTF-8に変更しても改善されなかったためあきらめました。
そこで、Linux環境であるWSLを使用してデプロイしてみたところ難なく成功。
Windowsで開発すると似たようなエラーに出くわすのでWSLは入れておいた方が無難かも。。。