Azure / Azure/static-web-apps-cli

Deploy from terminal shows no error when failing

Abierto
#787 2 comentarios 2 reacciones 0 asignados Ver en GitHub
command: deploy priority: medium (P1) scope: deploy-client type: bug version: ga
Lenguaje dominante
TypeScript
Estrellas
668
Forks
156
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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.

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Reproduce el fallo con `swa deploy --env Production` usando contenido de más de 500 MB y vuelve a ejecutarlo con `--verbose=silly` para comparar la salida visible con los detalles del rechazo del servidor. Rastrea cómo gestiona el comando de deploy el `BadRequest` rechazado; se considera terminado cuando una ejecución normal informa explícitamente de que el deployment ha fallado e incluye el motivo del servidor.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
azure, typescript
Área
cli, cloud
Tipo de issue
Error
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.