0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Firebase Hosting への Next.js デプロイでHTTP409エラー

Posted at

現象

既存の Next.js アプリを Firebase Hosting に firebase deploy でデプロイしようとしたところ、下記の順で失敗しました。

  1. 初回のデプロイでタイムアウト
  2. もう一度デプロイしたところエラー(HTTP 409)となり失敗した
HTTP Error: 409, Could not create Cloud Run service ssr[PROJECT]. A Cloud Run service with this name already exists. 
Please redeploy the function with a different name.

訳:「ssr[PROJECT]という Cloud Run サービスを作成できませんでした。同名の Cloud Run サービスがすでに存在します。名前を変えて再度デプロイしてください。」

解決

1. Firebase Function を確認

Firebase コンソールで function を確認してみたところ、デプロイが完了したような表示でした。

(ここで力尽きて一晩置く)

翌朝見てみると関数が消えて空の状態に。

2. Cloud Console で Cloud Run を確認

メッセージに Cloud Run とあるので、素直に Cloud Run を確認します。
Cloud Run は firebase ではなく GCP のコンソールから確認します。
https://console.cloud.google.com/

左上の「≡」ボタンから Cloud Run を選択すると、登録済みの関数が一覧されます。
この中に、上記エラーメッセージと同名の関数があるので、これを削除しました。
この状態で再度firebase deployを行うと、今度はデプロイに成功しました。

環境

  • Windows 10 Pro
  • node v18.14.2
  • firebase CLI v11.24.0
  • firebase (package.json) "^9.17.2"
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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?