Azure / Azure/static-web-apps-cli

Deploy from terminal shows no error when failing

Offen
#787 2 Kommentare 2 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
command: deploy priority: medium (P1) scope: deploy-client type: bug version: ga
Vorherrschende Sprache
TypeScript
Sterne
668
Forks
156
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Reproduziere den Fehler mit `swa deploy --env Production` unter Verwendung von Inhalten mit einer Größe von mehr als 500 MB und führe den Befehl anschließend erneut mit `--verbose=silly` aus, um die sichtbare Ausgabe mit den Details der Ablehnung durch den Server zu vergleichen. Verfolge, wie der Deploy-Befehl mit dem abgelehnten `BadRequest` umgeht. Erledigt ist die Aufgabe, wenn ein normaler Lauf ausdrücklich meldet, dass das Deployment fehlgeschlagen ist, und den Grund des Servers enthält.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
azure, typescript
Bereich
cli, cloud
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.