Unhandled exception in request pipeline: System.Net.Http.HttpRequestException: Connection refused
infact opened this issue · 5 comments
I was trying to run sample code(:v2functions/blob-trigger-watermark-blob-out-binding)
after uploading the image,I see this error pasted below.
I am getting error :
�[41m�[30mfail�[39m�[22m�[49m: Middleware[0]
2020-09-17T17:20:29.688239244Z: [INFO] Unhandled exception in request pipeline: System.Net.Http.HttpRequestException: Connection refused
2020-09-17T17:20:29.688247643Z: [INFO] ---> System.Net.Sockets.SocketException (111): Connection refused
2020-09-17T17:20:29.690374430Z: [INFO] at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)
2020-09-17T17:20:29.690390930Z: [INFO] --- End of inner exception stack trace ---
2020-09-17T17:20:29.690396930Z: [INFO] at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)
2020-09-17T17:20:29.690784128Z: [INFO] at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean allowHttp2, CancellationToken cancellationToken)
2020-09-17T17:20:29.690797528Z: [INFO] at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)
2020-09-17T17:20:29.690802928Z: [INFO] at System.Net.Http.HttpConnectionPool.GetHttpConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)
2020-09-17T17:20:29.690807628Z: [INFO] at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken)
2020-09-17T17:20:29.690812228Z: [INFO] at System.Net.Http.DiagnosticsHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
2020-09-17T17:20:29.690817228Z: [INFO] at System.Net.Http.HttpClient.FinishSendAsyncUnbuffered(Task1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts) 2020-09-17T17:20:29.690822128Z: [INFO] at Microsoft.Azure.AppService.MiddlewareShim.Startup.ForwardRequestAsync(HttpContext context) in /EasyAuth/Middleware.Host/Startup.cs:line 197 2020-09-17T17:20:29.690826728Z: [INFO] at Microsoft.Azure.AppService.MiddlewareShim.Startup.OnRequest(HttpContext context) in /EasyAuth/Middleware.Host/Startup.cs:line 151 2020-09-17T17:20:29.694881303Z: [INFO] �[41m�[30mfail�[39m�[22m�[49m: Microsoft.AspNetCore.Server.Kestrel[13] 2020-09-17T17:20:29.694899302Z: [INFO] Connection id "0HM2R5NDLDREG", Request id "0HM2R5NDLDREG:00000001": An unhandled exception was thrown by the application. 2020-09-17T17:20:29.694905702Z: [INFO] System.Net.Http.HttpRequestException: Connection refused 2020-09-17T17:20:29.695281200Z: [INFO] ---> System.Net.Sockets.SocketException (111): Connection refused 2020-09-17T17:20:29.695294000Z: [INFO] at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken) 2020-09-17T17:20:29.695299400Z: [INFO] --- End of inner exception stack trace --- 2020-09-17T17:20:29.695303700Z: [INFO] at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken) 2020-09-17T17:20:29.695308200Z: [INFO] at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean allowHttp2, CancellationToken cancellationToken) 2020-09-17T17:20:29.695313200Z: [INFO] at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken) 2020-09-17T17:20:29.695325400Z: [INFO] at System.Net.Http.HttpConnectionPool.GetHttpConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken) 2020-09-17T17:20:29.695330200Z: [INFO] at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken) 2020-09-17T17:20:29.695334700Z: [INFO] at System.Net.Http.DiagnosticsHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) 2020-09-17T17:20:29.695880996Z: [INFO] at System.Net.Http.HttpClient.FinishSendAsyncUnbuffered(Task1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
2020-09-17T17:20:29.695897196Z: [INFO] at Microsoft.Azure.AppService.MiddlewareShim.Startup.ForwardRequestAsync(HttpContext context) in /EasyAuth/Middleware.Host/Startup.cs:line 197
2020-09-17T17:20:29.695902896Z: [INFO] at Microsoft.Azure.AppService.MiddlewareShim.Startup.OnRequest(HttpContext context) in /EasyAuth/Middleware.Host/Startup.cs:line 151
2020-09-17T17:20:29.695907496Z: [INFO] at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)
2020-09-17T17:20:44.568918921Z: [INFO] Starting OpenBSD Secure Shell server: sshd.
Are you running in Azure or your local machine? Looks like this function is unable to connect to the storage account for some reason:
[INFO] Unhandled exception in request pipeline:
System.Net.Http.HttpRequestException: Connection refused
Are you running in Azure or your local machine? Looks like this function is unable to connect to the storage account for some reason:
[INFO] Unhandled exception in request pipeline: System.Net.Http.HttpRequestException: Connection refused
Ok,there could be some permission issue.
Now I tried to execute the code again from my private azure subscription.I uploaded an image and nothing happened.No errors no logs nothing. I found some errors in the app insights logs _
"AI: Local storage access has resulted in an error (User: app) (CustomFolder: ). If you want Application Insights SDK to store telemetry locally on disk in case of transient network issues please give the process access to %LOCALAPPDATA% or %TEMP% folder. If application is running in non-windows platform, create StorageFolder yourself, and set ServerTelemetryChannel.StorageFolder to the custom folder name. After you gave access to the folder you need to restart the process. Currently monitoring will continue but if telemetry cannot be sent it will be dropped. Error message: ."_
How can I make it work?I am using the same sample code [v2functions/blob-trigger-watermark-blob-out-binding]
See recorded [screen capture ] . (https://storageaccountrg1b758.blob.core.windows.net/sharedtest/BlobTriggerNotworking.mp4)
That particular function has a blob trigger and a blob output. Make sure you have the right configuration in the function.json and the input container matches the container you're uploading the image to.
It won't work with an HTTP trigger (Test/Run blade you show in the video capture), you have to upload a JPEG or PNG image to the input blob container to trigger the execution of that function.
Please follow the README carefully:
https://github.com/yokawasa/azure-functions-python-samples/blob/master/v2functions/blob-trigger-watermark-blob-out-binding/readme.md
BTW: You should really test all this locally first since you get much better logging without delay and you can still trigger on blobs that you upload to Azure.
Connected!
2020-09-17T20:17:15Z [Information] Executed 'Functions.BlobTrigger1' (Succeeded, Id=40de5580-e0c2-453f-94ef-64421748d9e3, Duration=519ms)