pwa-builder / PWABuilder

The simplest way to create progressive web apps across platforms and devices. Start here. This repo is home to several projects in the PWABuilder family of tools.
https://docs.pwabuilder.com
Other
2.66k stars 279 forks source link

[BUG] Generating package for iOS with 500 error code and extra logs #4598

Closed dkildar closed 7 months ago

dkildar commented 7 months ago

What happened?

I just wanted to generate an iOS package and got some strange error(see screenshot)

Screenshot 2024-01-05 at 02 36 48

I extracted it from dev tools and there are interesting log lines with filenames and full stack trace.

Status code: 500. System.Net.Http.HttpRequestException: Response status code does not indicate success: 415 (Unsupported Media Type).
 at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
 at Microsoft.PWABuilder.IOS.Web.Services.ImageGenerator.CreateIOSImagesZip(Byte[] image, Double padding, String backgroundColor) in D:\a\pwabuilder-ios\pwabuilder-ios\Microsoft.PWABuilder.IOS.Web\Services\ImageGenerator.cs:line 144
 at Microsoft.PWABuilder.IOS.Web.Services.ImageGenerator.InvokePwabuilderImageGeneratorService(Validated options, WebAppManifestContext webManifest) in D:\a\pwabuilder-ios\pwabuilder-ios\Microsoft.PWABuilder.IOS.Web\Services\ImageGenerator.cs:line 67
 at Microsoft.PWABuilder.IOS.Web.Services.ImageGenerator.Generate(Validated options, WebAppManifestContext manifest, String outputDirectory) in D:\a\pwabuilder-ios\pwabuilder-ios\Microsoft.PWABuilder.IOS.Web\Services\ImageGenerator.cs:line 60
 at Microsoft.PWABuilder.IOS.Web.Services.IOSPackageCreator.Create(Validated options) in D:\a\pwabuilder-ios\pwabuilder-ios\Microsoft.PWABuilder.IOS.Web\Services\IOSPackageCreator.cs:line 69
 at Microsoft.PWABuilder.IOS.Web.Controllers.PackagesController.Create(IOSAppPackageOptions options) in D:\a\pwabuilder-ios\pwabuilder-ios\Microsoft.PWABuilder.IOS.Web\Controllers\PackagesController.cs:line 55
 at lambda_method4(Closure, Object)
 at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfActionResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
 at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
 at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
 at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
 at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
 at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
 at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
 at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
 at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
 at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
 at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
 at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)

 HEADERS
 =======
 Accept: */*
 Accept-Encoding: gzip, deflate, br
 Accept-Language: en-US,en;q=0.9
 Content-Length: 1490
 Content-Type: application/json
 Host: pwabuilder-ios.azurewebsites.net
 Max-Forwards: 10
 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Safari/605.1.15
 Origin: https://www.pwabuilder.com
 Sec-Fetch-Site: cross-site
 Sec-Fetch-Mode: cors
 platform-identifier: PWABuilder
 correlation-id: c58f64c4-7b37-478e-82a9-58172bbd7b4c
 platform-identifier-version: 1.0.0
 Sec-Fetch-Dest: empty
 X-ARR-LOG-ID: adaf5bc1-eb19-43ed-a86c-c369e185a0cb
 CLIENT-IP: 212.112.126.242:64107
 DISGUISED-HOST: pwabuilder-ios.azurewebsites.net
 X-SITE-DEPLOYMENT-ID: pwabuilder-ios__82a9
 WAS-DEFAULT-HOSTNAME: pwabuilder-ios.azurewebsites.net
 X-Forwarded-Proto: https
 X-AppService-Proto: https
 X-ARR-SSL: 2048|256|CN=Microsoft Azure TLS Issuing CA 01, O=Microsoft Corporation, C=US|CN=*.azurewebsites.net, O=Microsoft Corporation, L=Redmond, S=WA, C=US
 X-Forwarded-TlsVersion: 1.3
 X-Forwarded-For: 212.112.126.242:64107
 X-Original-URL: /packages/create
 X-WAWS-Unencoded-URL: /packages/create

How do we reproduce the behavior?

  1. Go to https://www.pwabuilder.com/reportcard?site=https://app.soul-dating.com
  2. Generate iOS package

What do you expect to happen?

I suppose it should return 415 directly instead of 500 and full stack trace

What environment were you using?

MacOS latest, Safari latest

Additional context

No response

Jaylyn-Barbee commented 7 months ago

This is happening because under "All Settings" you have an image with type svg and the iOS service doesn't know how to handle those. I work around for now would be switching that reference to a PNG. image