LoginSignup
10
2

More than 1 year has passed since last update.

GASでDriveAppクラスを使うと`Exception: We're sorry, a server error occurred. Please wait a bit and try again.`エラーが出る

Posted at

事象

スプレッドシートを指定のフォルダにコピーしようと、DriveAppクラスを使っていたのですが、突然こんなエラーが出ました。
image.png

GASのエディタから該当の関数だけ実行した結果はこうです。
image.png

理由

なんでもGASをGCPと紐づけた際に起こるようです。
自分の前の記事(GASでLINE Bot開発時のログ出力方法)でGCPでログが見れるようにしたことが自分の場合の原因のようです。
GCPと紐づけていないGASで実行した場合、エラーは起きませんでした。

解決策

GCPから以下のページに遷移します。
image.png

検索画面に映るので、「Google Drive API」を検索します。

そこから「有効にする」でこのAPIを有効にします。
image.png

これで解消します!

10
2
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
10
2