Azure / Azure/static-web-apps-cli
Deploy from terminal shows no error when failing
- 主要言語
- TypeScript
- スター
- 668
- フォーク
- 156
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
Running `swa --version` result:
1.1.6
**Are you accessing the CLI from the default port `:4280` ?**
- [ ] No, I am using a different port number (`--port`) and accessing the CLI from that port
- [ ] Yes, I am accessing the CLI from port `:4280`
None of the above, we think. We're running CLI from windows terminal and we're not passing any port argument. And not port argument is shown in the output.
> Make sure you are accessing the URL printed in the console when running `swa start`!
**ℹ️ NOTE: Make sure to enable debug logs when running any `swa` commands using `--verbose=silly`**
**Describe the bug**
In a scenario when deploy command fails, and this is due to a rejected request with code `BadRequest`, CLI simply terminates midway, without any error message.
In our specific case, failure was due to the size of app content being too large.
**To Reproduce**
Steps to reproduce the behavior:
1. Create a dummy web site and configure it to deploy it through swa
2. In public site directory copy dummy contents for more than 500 MB. This is in order to exceed Azure Static Web App allowed content size and let deploy operation fail
3. From terminal run swa command to deploy site: `swa deploy --env Production`
**Expected behavior**
Console output should show an error regarding the request rejected by server and the reason for it. And anyway it should be explicit that operation failed.
**Actual behavior**
Console output shows no error. swa execution just stops midway, and one may think that operation was successful. Here's the final part of the output:
```sh
Deploying to environment: Production
Deploying project to Azure Static Web Apps...
```
Only by running the deploy command with `-V silly` argument, we were able to figure out what was happening. Here's the final part of the output:
```sh
ℹ The content server has rejected the request with: BadRequest
ℹ Reason: The size of the app content was too large. The limit for this Static Web App is 524288000 bytes.
ℹ For further information, please visit the Azure Static Web Apps documentation at https://docs.microsoft.com/en-us/azure/static-web-apps/
ℹ If you believe this behavior is unexpected, please raise a GitHub issue at https://github.com/azure/static-web-apps/issues/
```
**Screenshots**
Not needed
**Desktop (please complete the following information):**
- OS: Windows
- Version: 11 23H2
**Additional context**
We also checked issues #781 and #783 but they do not seem a clone of this one.
コントリビューションガイド
調査の方向性
500 MBを超えるコンテンツを使用して `swa deploy --env Production` で失敗を再現し、その後 `--verbose=silly` を付けて再実行して、表示される出力とサーバーによる拒否の詳細を比較します。deploy コマンドが拒否された `BadRequest` をどのように処理するかを追跡します。通常の実行でデプロイに失敗したことが明示的に報告され、サーバーの理由が含まれていれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- azure, typescript
- 領域
- cli, cloud
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100