TechnitiumSoftware / DnsServer

Technitium DNS Server
https://technitium.com/dns/
GNU General Public License v3.0
4.1k stars 409 forks source link

Unable to load App Store #972

Closed borekon closed 3 weeks ago

borekon commented 1 month ago

Installed with the official installer on Ubuntu 22. When try to load the App Store, it show a blank window with an error message:

imagen

The error log says:

System.TimeoutException: The operation has timed out.
   at TechnitiumLibrary.TaskExtensions.WithTimeout[T](Task`1 task, Int32 timeout) in Z:\Technitium\Projects\TechnitiumLibrary\TechnitiumLibrary\TaskExtensions.cs:line 46
   at DnsServerCore.WebServiceAppsApi.ListStoreApps(HttpContext context) in Z:\Technitium\Projects\DnsServer\DnsServerCore\WebServiceAppsApi.cs:line 386
   at DnsServerCore.DnsWebService.WebServiceApiMiddleware(HttpContext context, RequestDelegate next) in Z:\Technitium\Projects\DnsServer\DnsServerCore\DnsWebService.cs:line 652
   at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddlewareImpl.<Invoke>g__Awaited|10_0(ExceptionHandlerMiddlewareImpl middleware, HttpContext context, Task task)

Timeout but don't know why. I have normal internet access from that VPS (can ping, curl ,etc). The same happens when try to download blocklist from dashboard:

2024-07-17 11:15:27 UTC] DNS Server failed to download block list and will use previously downloaded file (if available): https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
System.Threading.Tasks.TaskCanceledException: The request was canceled due to the configured HttpClient.Timeout of 100 seconds elapsing.
 ---> System.TimeoutException: A task was canceled.
 ---> System.Threading.Tasks.TaskCanceledException: A task was canceled.
   at System.Threading.Tasks.TaskCompletionSourceWithCancellation`1.WaitWithCancellationAsync(CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
   at System.Net.Http.DecompressionHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at TechnitiumLibrary.Net.Http.Client.HttpClientNetworkHandler.InternalSendAsync(HttpRequestMessage request, CancellationToken cancellationToken) in Z:\Technitium\Projects\TechnitiumLibrary\TechnitiumLibrary.Net\Http\Client\HttpClientNetworkHandler.cs:line 99
   at TechnitiumLibrary.Net.Http.Client.HttpClientNetworkHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) in Z:\Technitium\Projects\TechnitiumLibrary\TechnitiumLibrary.Net\Http\Client\HttpClientNetworkHandler.cs:line 242
   at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
   --- End of inner exception stack trace ---
   --- End of inner exception stack trace ---
   at System.Net.Http.HttpClient.HandleFailure(Exception e, Boolean telemetryStarted, HttpResponseMessage response, CancellationTokenSource cts, CancellationToken cancellationToken, CancellationTokenSource pendingRequestsCts)
   at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
   at DnsServerCore.Dns.ZoneManagers.BlockListZoneManager.<>c__DisplayClass20_0.<<UpdateBlockListsAsync>g__DownloadListUrlAsync|0>d.MoveNext() in Z:\Technitium\Projects\DnsServer\DnsServerCore\Dns\ZoneManagers\BlockListZoneManager.cs:line 427```
ShreyasZare commented 1 month ago

Thanks for the post. The service is working well and I am able to load the App Store. It seems some kind of network issue but not sure about that.

Try to curl https://download.technitium.com/dns/apps/apps2.json on the server and see if you are able to download the json file. Its the same file that is fetched by the App Store.

borekon commented 1 month ago

Thanks for the post. The service is working well and I am able to load the App Store. It seems some kind of network issue but not sure about that.

Try to curl https://download.technitium.com/dns/apps/apps2.json on the server and see if you are able to download the json file. Its the same file that is fetched by the App Store.

It works like a charm, but not luck from Dashboard:

 curl https://download.technitium.com/dns/apps/apps2.json
[
        {
                "name": "Advanced Blocking",
                "description": "Blocks domain names using block lists and regex block lists. Supports creating groups based on client's IP address or subnet to enforce different block lists and regex block lists for each group.\n\nNote! This app works independent of the DNS server's built-in blocking feature. The options configured in DNS server Settings section does not apply to this app.",
                "versions": [
    .....

Is there any possibility to get a deeper debug log?

ShreyasZare commented 1 month ago

Do you have IPv6 on your server? If yes, then these URLs would be fetched with IPv6 and there may be some transient IPv6 network issues somewhere causing this. I tested with IPv6 network and the service was working well from here at least.

ShreyasZare commented 1 month ago

One suggestion: Install the "Filter AAAA" manually (using the Install button in app section) by downloading the zip file from the json returned by the app store URL. The app will automatically start filtering AAAA requests so as to force apps to prefer IPv4 instead. Try this and see if that fixes your issue.

borekon commented 1 month ago

Thanks a lot for your help and suggestion, but i think the problem could be HTTPS related: imagen

borekon commented 3 weeks ago

I thin i know what is the problem. Even installing the AAAA filter, tcp request are done through IPv6 interface. Actually, using a wireguard interface (!?!?!) despite default ipv6 route is configured through ethernet interface...

ShreyasZare commented 3 weeks ago

I thin i know what is the problem. Even installing the AAAA filter, tcp request are done through IPv6 interface. Actually, using a wireguard interface (!?!?!) despite default ipv6 route is configured through ethernet interface...

VPN software install a couple of more specific routes that force all traffic via them. Those specific routes are always selected so existence of default route does not matter in such case.

borekon commented 3 weeks ago

I thin i know what is the problem. Even installing the AAAA filter, tcp request are done through IPv6 interface. Actually, using a wireguard interface (!?!?!) despite default ipv6 route is configured through ethernet interface...

VPN software install a couple of more specific routes that force all traffic via them. Those specific routes are always selected so existence of default route does not matter in such case.

Of course, this is the theory. Disabled IPv6 addreses in the wireguard interface and peers and now it is working like a charm.