I have a .net service that runs in a container.
When I run it I have a very wired issue.
Assuming I have the link HTTP//:www.a.com/page.
The first attempt to call HTTP//:www.a.com/page succeeds, the second failed with 500, the third succeeded again, and so on.
In the output window, I can find: Exception thrown: 'System.UriFormatException' in System.Private.Uri.dll and Exception thrown: 'System.Net.Http.HttpRequestException'.
Initially, I thought that all the odd requests succeeded, but then more random patterns started to appear.
I tried to wait a few random seconds between attempts but it did not solve the issue.
Basically, some of the requests succeeded and some did not (again they are all exactly the same requests).
I added UseDeveloperExceptionPage. but it didn't catch anything, I added a BP on my first middleware, the requests that succeed break in it, the 500 never reach that point.
This led me to think that something is rung with Kerstel himself.
I returning 404 on the path, maybe Kerstel has caching mechanized that return automatically 500 if I repeat asking for a 404 path under x minutes?
The question is, how can I debug it? Where is the source of this bug?
This is the current setup of the Program.cs file:
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddControllers();
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
builder.Services.AddHealthChecks();
var app = builder.Build();
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
app.UseDeveloperExceptionPage();
app.UseSwagger();
app.UseSwaggerUI();
}
// Should be the first middleware
app.UseHealthChecks("/HealthCheck");
app.UseRouting();
app.UseEndpoints(endpoints =>
{
endpoints.Map("/{**catch-all}", async httpContext =>
{
// return 200 if we are healthy here
httpContext.Response.StatusCode = 404;
return;
});
});
Console.WriteLine("Test Version 6");
app.Run();
public partial class Program { } // so you can reference it from tests
-- edit --
When I use localhost (swagger) to communicate with .net, there is no error, only when I use it through the docker naming (using a regular browser request) there is an error, here are the traces:
Trace of swagger request (return 404 as expected):
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
Request starting HTTP/1.1 GET http://localhost:50182/category_1a1a1a1a%2Fproduct_2a2a2a2a%2Fid_1123467.product?sig=EEF7952F7B823B6981A797AAE429DF - -
trce: Microsoft.AspNetCore.HostFiltering.HostFilteringMiddleware[2]
All hosts are allowed.
dbug: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[3]
The request path does not match the path filter
dbug: Microsoft.AspNetCore.Routing.Matching.DfaMatcher[1001]
1 candidate(s) found for the request path '/category_1a1a1a1a%2Fproduct_2a2a2a2a%2Fid_1123467.product?sig=EEF7952F7B823B6981A797AAE429DF'
dbug: Microsoft.AspNetCore.Routing.Matching.DfaMatcher[1005]
Endpoint '/{**catch-all}' with route pattern '/{**catch-all}' is valid for the request path '/category_1a1a1a1a%2Fproduct_2a2a2a2a%2Fid_1123467.product?sig=EEF7952F7B823B6981A797AAE429DF'
dbug: Microsoft.AspNetCore.Routing.EndpointRoutingMiddleware[1]
Request matched endpoint '/{**catch-all}'
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[0]
Executing endpoint '/{**catch-all}'
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[1]
Executed endpoint '/{**catch-all}'
dbug: Microsoft.AspNetCore.Server.Kestrel.Connections[9]
Connection id "0HMJER5USLLOE" completed keep alive response.
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
Request finished HTTP/1.1 GET http://localhost:50182/category_1a1a1a1a%2Fproduct_2a2a2a2a%2Fid_1123467.product?sig=EEF7952F7B823B6981A797AAE429DF - - - 404 0 - 3126.3906ms
The thread 0xf12 has exited with code 0 (0x0).
The thread 0xf0f has exited with code 0 (0x0).
The thread '.NET ThreadPool Worker' (0xb2) has exited with code 0 (0x0).
The thread '.NET ThreadPool Worker' (0xbf) has exited with code 0 (0x0).
The thread '.NET ThreadPool Worker' (0xc1) has exited with code 0 (0x0).
The thread '.NET ThreadPool Worker' (0xb8) has exited with code 0 (0x0).
The thread 0xf14 has exited with code 0 (0x0).
The thread 0xf15 has exited with code 0 (0x0).
The thread 0xf10 has exited with code 0 (0x0).
Trace of browser request (return 404 as expected but with wired failures):
dbug: Microsoft.AspNetCore.Server.Kestrel.Connections[39]
Connection id "0HMJER5USLLOF" accepted.
dbug: Microsoft.AspNetCore.Server.Kestrel.Connections[1]
Connection id "0HMJER5USLLOF" started.
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
Request starting HTTP/1.0 GET http://proxy_backend/category_1a1a1a1a/product_2a2a2a2a/id_1123467.product?sig=EEF7952F7B823B6981A797AAE429DF - -
trce: Microsoft.AspNetCore.HostFiltering.HostFilteringMiddleware[2]
All hosts are allowed.
dbug: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[3]
The request path does not match the path filter
dbug: Microsoft.AspNetCore.Routing.Matching.DfaMatcher[1001]
1 candidate(s) found for the request path '/category_1a1a1a1a/product_2a2a2a2a/id_1123467.product'
dbug: Microsoft.AspNetCore.Routing.Matching.DfaMatcher[1005]
Endpoint '/{**catch-all}' with route pattern '/{**catch-all}' is valid for the request path '/category_1a1a1a1a/product_2a2a2a2a/id_1123467.product'
dbug: Microsoft.AspNetCore.Routing.EndpointRoutingMiddleware[1]
Request matched endpoint '/{**catch-all}'
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[0]
Executing endpoint '/{**catch-all}'
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[1]
Executed endpoint '/{**catch-all}'
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
Request finished HTTP/1.0 GET http://proxy_backend/category_1a1a1a1a/product_2a2a2a2a/id_1123467.product?sig=EEF7952F7B823B6981A797AAE429DF - - - 404 0 - 1959.3089ms
dbug: Microsoft.AspNetCore.Server.Kestrel.Connections[10]
Connection id "0HMJER5USLLOF" disconnecting.
dbug: Microsoft.AspNetCore.Server.Kestrel.Connections[2]
Connection id "0HMJER5USLLOF" stopped.
dbug: Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets[7]
Connection id "0HMJER5USLLOF" sending FIN because: "The Socket transport's send loop completed gracefully."
dbug: Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets[6]
Connection id "0HMJER5USLLOF" received FIN.
Then the trace of the next browser request (return 500 - failure):
Exception thrown: 'System.UriFormatException' in System.Private.Uri.dll
Exception thrown: 'System.UriFormatException' in System.Private.CoreLib.dll
Exception thrown: 'System.UriFormatException' in System.Private.CoreLib.dll
It looks like everything is normal when I access .net using http://localhost:50182/ but when I access it from http://proxy_backend (the docker name) only then I get the issues
How can I call a task that temporarily interrupts network connectivity to the target when it runs.
I wrote a PowerShell ansible module that modifies the target windows network settings causing it to lose connectivity for around 30 seconds. The connection is to a windows 2019 server via winrm I need to know if the task succeeded or reports errors.
If I call the task normally, it will fail with host unreachable if the network is gone for more than read timeout (30) seconds. The operation may have succeeded, but I don't have access to its return values.
- win_vswitch:
Name: "SomeSwitch"
VLAN: 123
state: present
Seems like a good use of async:
- name: Configure VSwitch
win_vswitch:
Name: "SomeSwitch"
VLAN: 123
state: present
async: 600
poll: 0
register: async_result
- name: vswitch - wait for the async task to finish
async_status:
jid: "{{ async_result.ansible_job_id }}"
register: task_result
until: task_result.finished
# ignore_unreachable: yes
retries: 60
delay: 5
# failed_when: False
The problem is that if the async_status poll is unable to get a network connection to the target for more than read_timeout seconds, it fails with host unreachable error. Even if the async_status's timeouts haven't expired.
Seems to me that I just need to set the read timeout to a higher value. And that's where I'm stuck.
Things I've tried:
timeout in ansible.cfg
ansible_winrm_read_timeout_sec & ansible_winrm_operation_timeout_sec in the inventory host item
ignore_unreachable & failed_when in the async_status module
rescue clause around the async_status
Suggestions?
TIA, Jeff
You can define ansible_winrm_connection_timeout (and other ansible_winrm_* values as well), by defining vars on the task itself:
- name: vswitch - wait for the async task to finish
async_status:
jid: "{{ async_result.ansible_job_id }}"
register: task_result
until: task_result.finished
retries: 60
delay: 5
vars:
ansible_winrm_connection_timeout: 300
This may be preferable to using the win_wait_for task depending upon the use case. win_wait_for might be good for a task when the network connectivity will immediately drop; however, if you have a task that will cause a drop at a random time (like a task installing network drivers).
I am currently try to load data from Prometheus Pagespeed Exporter (https://github.com/foomo/pagespeed_exporter) directly into ELK using Metricbeat. It seems so, that the Call of Pagespeed Exporter requires more time than Metricbeats offers to scrape the required data. A Client Timeout occures:
unable to decode response from prometheus endpoint: error making http request: Get http://pagespeed-exporter-monitoring:9271/metrics: net/http: request canceled (Client.Timeout exceeded while awaiting headers)
Currently the Request is cancelled after about 10s while the Timeout in metricbeat should be defined like Timeout = Period (https://www.elastic.co/guide/en/beats/devguide/current/metricset-details.html). The Period in my case is configured to 3600s.
metricbeat:
deployment:
metricbeatConfig:
metricbeat.yml: |
metricbeat.modules:
- module: prometheus
enabled: true
period: 3600s
hosts: ["pagespeed-exporter-monitoring:9271"]
metrics_path: /metrics
Is there any option to increase the Timeout or is there any other issue?
You can override the timeout on the module config,
https://www.elastic.co/guide/en/beats/metricbeat/current/configuration-metricbeat.html#_timeout
For example:
metricbeat:
deployment:
metricbeatConfig:
metricbeat.yml: |
metricbeat.modules:
- module: prometheus
enabled: true
period: 3600s
hosts: ["pagespeed-exporter-monitoring:9271"]
metrics_path: /metrics
timeout: 60s # adjust here
I can't stream a video over network using vlc. When I look logfile I see these lines
What is the problem and how can I solve it? My operating system is windows 10 64 bit. Also I need to make a script to stream a video over network with vlc. I could not find any helpful document about this. Can somebody help me about this issue?
main debug: toggling resume
main debug: auto hiding mouse cursor
main debug: auto hiding mouse cursor
main debug: exiting
main debug: exiting
main debug: no exit handler
main debug: removing all interfaces
main debug: removing module "qt"
main debug: deactivating the playlist
main debug: incoming request - stopping current input
main debug: killing decoder fourcc `h264'
main debug: removing module "h264"
main debug: incoming request - stopping current input
main debug: removing a sout input (sout_input: 0000026d28625c20)
main debug: incoming request - stopping current input
main debug: killing decoder fourcc `h264'
main debug: removing module "avcodec"
main debug: incoming request - stopping current input
main debug: saving a free vout
main debug: incoming request - stopping current input
main debug: reusing provided vout
main debug: incoming request - stopping current input
mux_ts debug: removing input pid=100
mux_ts debug: freeing video PID 100
main debug: incoming request - stopping current input
main warning: no more input streams for this mux
main debug: incoming request - stopping current input
main debug: removing module "mp4"
mp4 debug: freeing all memory
main debug: incoming request - stopping current input
main debug: Program doesn't contain anymore ES
main debug: removing module "record"
main debug: incoming request - stopping current input
main debug: removing module "cache_read"
main debug: incoming request - stopping current input
main debug: removing module "filesystem"
main debug: incoming request - stopping current input
main debug: dead input
qt debug: IM: Deleting the input
main debug: nothing to play
main debug: destroying useless sout
main debug: destroying chain... (name=duplicate)
main debug: removing module "duplicate"
duplicate debug: closing a duplication
main debug: destroying chain... (name=display)
main debug: removing module "display"
main debug: destroying useless vout
main debug: removing module "direct3d11"
direct3d11 debug: Direct3D11 resources destroyed
direct3d11 debug: Direct3D11 device adapter closed
direct3d11 error: SetThumbNailClip failed: 0x800706f4
direct3d11 debug: Win32 Vout EventThread terminating
direct3d11 debug: Win32VoutCloseWindow
direct3d11 debug: WinProc WM_DESTROY
main debug: removing module "inhibit"
qt debug: releasing video...
qt debug: Video is not needed anymore
main debug: removing module "freetype"
main debug: removing module "yuvp"
main debug: removing module "swscale"
main debug: destroying chain done
main debug: destroying chain... (name=standard)
main debug: removing module "stream_out_standard"
main debug: removing module "mux_ts"
main debug: removing module "udp"
main debug: destroying chain done
main debug: destroying chain done
main debug: removing module "mmdevice"
qt debug: requesting exit...
qt debug: waiting for UI thread...
qt debug: QApp exec() finished
qt debug: Video is not needed anymore
qt debug: Killing extension dialog provider
qt debug: ExtensionsDialogProvider is quitting...
main debug: removing module "lua"
main debug: removing module "win32"
main debug: removing module "hotkeys"
main debug: removing module "win_msg"
main debug: destroying
main debug: saving media library to file C:\Users\gulbe\AppData\Roaming\vlc\ml.xspf.tmp30208
main debug: looking for playlist export module matching "export-xspf": 4 candidates
main debug: using playlist export module "export"
main debug: removing module "export"
main debug: deleting item `Media Library'
main debug: deleting item `videoOo.mp4'
main debug: deleting item `Playlist'
main debug: removing module "memory"
-- logger module stopped --
-- logger module started --
main: one instance mode ENABLED
I'm working on a VLC project for myself. My goal is to create an HTML front end to start a stream. I am doing this through the use of Java Servlets.
Overview:
Ubuntu 13.04,
Java 7-21 : IcedTea 2.3.9,
Eclipse JAVAEE IDE,
Tomcat 7
I am trying to start a VLC HTTP video stream using this call.
vlc -vvv /home/jca310ms/Videos/test.avi.flv \
--sout '#transcode{vcodec=FLV1,vb=4096,fps=25,scale=1,acodec=mp3,ab=512,samplerate=44100,channels=2}:std{access=http,mux=flv,dst=0.0.0.0:8081/stream.flv}'
Now, this call does work from the command line. However, when it is run using :
String args = "vlc -vvv /home/jca310ms/Videos/test.avi.flv --sout '#transcode{vcodec=FLV1,vb=4096,fps=25,scale=1,acodec=mp3,ab=512,samplerate=44100,channels=2}:std{access=http,mux=flv,dst=0.0.0.0:8081/stream.flv}'";
Runtime runtime = Runtime.getRuntime();
Process p = runtime.exec(args);
I get these errors from the output:
err: [0x7ff2d8000b78] main input debug: Creating an input for 'test.avi.flv'
err: [0x7ff2ac001108] main stream output debug: using sout chain=`standard{mux="",access="'#transcode{vcodec=FLV1,vb=4096,fps=25,scale=1,acodec=mp3,ab=512,samplerate=44100,channels=2}",dst="std{access=http,mux=flv,dst=0.0.0.0:8081/stream.flv }'"}'
err: [0x7ff2ac001108] main stream output debug: stream=`standard'
err: [0x7ff2ac0014f8] main stream out debug: looking for sout stream module: 1 candidate
err: [0x7ff2ac0014f8] main stream out warning: missing value for option mux
err: [0x7ff2ac0014f8] main stream out debug: set config option: sout-standard-access to '#transcode{vcodec=FLV1,vb=4096,fps=25,scale=1,acodec=mp3,ab=512,samplerate=44100,channels=2}
err: [0x7ff2ac0014f8] main stream out debug: set config option: sout-standard-dst to std{access=http,mux=flv,dst=0.0.0.0:8081/stream.flv}'
err: [0x7ff2ac0014f8] stream_out_standard stream out error: no mux specified or found by extension
err: [0x7ff2ac0014f8] main stream out debug: no sout stream module matching "standard" could be loaded
err: [0x7ff2ac0014f8] main stream out debug: TIMER module_need() : 1.743 ms - Total 1.743 ms / 1 intvls (Avg 1.743 ms)
err: [0x7ff2ac0014f8] main stream out debug: destroying chain... (name=(null))
err: [0x7ff2ac0014f8] main stream out debug: destroying chain done
err: [0x7ff2ac001108] main stream output error: stream chain failed for `standard{mux="",access="'#transcode{vcodec=FLV1,vb=4096,fps=25,scale=1,acodec=mp3,ab=512,samplerate=44100,channels=2}",dst="std{access=http,mux=flv,dst=0.0.0.0:8081/stream.flv}'"}'
err: [0x20dd928] main playlist debug: finished input
err: [0x7ff2d8000b78] main input error: cannot start stream output instance, aborting
err: [0x20dd928] main playlist debug: dead input
err: [0x20dd928] main playlist debug: changing item without a request (current 0/1)
err: [0x20dd928] main playlist debug: nothing to play
Any ideas what might be causing the difference between vlc ability to start the stream through console, but not being able to start the stream using runtime.exec()?
Any and all help is well appreciated!!!