Azure / Azure/static-web-apps-cli
Deploy from terminal shows no error when failing
- Ngôn ngữ chính
- TypeScript
- Star
- 668
- Fork
- 156
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
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.
Hướng dẫn đóng góp
Hướng nghiên cứu
Tái hiện lỗi bằng `swa deploy --env Production` với nội dung lớn hơn 500 MB, sau đó chạy lại với `--verbose=silly` để so sánh đầu ra hiển thị với chi tiết từ chối của máy chủ. Theo dõi cách lệnh deploy xử lý `BadRequest` bị từ chối; hoàn thành khi một lần chạy bình thường báo cáo rõ ràng rằng deployment đã thất bại và bao gồm lý do từ máy chủ.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- azure, typescript
- Lĩnh vực
- cli, cloud
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100