I am testing an endpoint that I am experiencing some issues with.
I am simply using HttpClient in a loop that performs a request each hour.
var httpClient = new HttpClient();
var message = httpClient.GetAsync(url).Result;
Console.WriteLine(message.StatusCode);
Once in a while I am getting this exception:
System.Net.Http.HttpRequestException: An error occurred while sending
the request. —> System.Net.WebException: The remote name could not
be resolved: ‘xxx’
The experience is that right after the exception, the URL can be accessed. In a browser you simply refresh the page and all is good.
I still haven’t got any reports from users experiencing it so I am wondering if it’s just a local issue here but could use a little information to help diagnose.
Is there a way to check if The remote name could not be resolved is caused by an DNS issue or by a web server issue from the exceptions? Can I get more information out of HttpCLient or do I need more advanced diagnostic tools?
brett rogers
6,4317 gold badges32 silver badges43 bronze badges
asked Jul 29, 2014 at 11:23
![]()
Poul K. SørensenPoul K. Sørensen
16.6k19 gold badges121 silver badges280 bronze badges
6
It’s probably caused by a local network connectivity issue (but also a DNS error is possible). Unfortunately HResult is generic, however you can determine the exact issue catching HttpRequestException and then inspecting InnerException: if it’s a WebException then you can check the WebException.Status property, for example WebExceptionStatus.NameResolutionFailure should indicate a DNS resolution problem.
It may happen, there isn’t much you can do.
What I’d suggest to always wrap that (network related) code in a loop with a try/catch block (as also suggested here for other fallible operations). Handle known exceptions, wait a little (say 1000 msec) and try again (for say 3 times). Only if failed all times then you can quit/report an error to your users. Very raw example like this:
private const int NumberOfRetries = 3;
private const int DelayOnRetry = 1000;
public static async Task<HttpResponseMessage> GetFromUrlAsync(string url) {
using (var client = new HttpClient()) {
for (int i=1; i <= NumberOfRetries; ++i) {
try {
return await client.GetAsync(url);
}
catch (Exception e) when (i < NumberOfRetries) {
await Task.Delay(DelayOnRetry);
}
}
}
}
answered Jul 29, 2014 at 11:32
![]()
Adriano RepettiAdriano Repetti
64.3k19 gold badges137 silver badges203 bronze badges
16
I had a similar issue when trying to access a service (old ASMX service). The call would work when accessing via an IP however when calling with an alias I would get the remote name could not be resolved.
Added the following to the config and it resolved the issue:
<system.net>
<defaultProxy enabled="true">
</defaultProxy>
</system.net>
answered Feb 7, 2018 at 13:59
1
Open the hosts file located at : **C:windowssystem32driversetc**.
Hosts file is for what?
Add the following at end of this file :
YourServerIP YourDNS
Example:
198.168.1.1 maps.google.com
answered Jul 12, 2018 at 8:46
this problem is pretty sure related to the HttpClient of c#. This client is designed to reuse it. Because the sockets are not directly closed after you dispose the HttpClient. Good explanation is provided by this blog post (https://www.nimaara.com/beware-of-the-net-httpclient/).
You have to handle the case that you DNS lookup table is outdated. In the blog post you also find information how to do this.
ServicePointManager.FindServicePoint(endpoint).ConnectionLeaseTimeout = (int)TimeSpan.FromMinutes(1).TotalMilliseconds;
ServicePointManager.DnsRefreshTimeout = (int)1.Minutes().TotalMilliseconds;
answered Jun 22, 2021 at 5:47
![]()
I am testing an endpoint that I am experiencing some issues with.
I am simply using HttpClient in a loop that performs a request each hour.
var httpClient = new HttpClient();
var message = httpClient.GetAsync(url).Result;
Console.WriteLine(message.StatusCode);
Once in a while I am getting this exception:
System.Net.Http.HttpRequestException: An error occurred while sending
the request. —> System.Net.WebException: The remote name could not
be resolved: ‘xxx’
The experience is that right after the exception, the URL can be accessed. In a browser you simply refresh the page and all is good.
I still haven’t got any reports from users experiencing it so I am wondering if it’s just a local issue here but could use a little information to help diagnose.
Is there a way to check if The remote name could not be resolved is caused by an DNS issue or by a web server issue from the exceptions? Can I get more information out of HttpCLient or do I need more advanced diagnostic tools?
brett rogers
6,4317 gold badges32 silver badges43 bronze badges
asked Jul 29, 2014 at 11:23
![]()
Poul K. SørensenPoul K. Sørensen
16.6k19 gold badges121 silver badges280 bronze badges
6
It’s probably caused by a local network connectivity issue (but also a DNS error is possible). Unfortunately HResult is generic, however you can determine the exact issue catching HttpRequestException and then inspecting InnerException: if it’s a WebException then you can check the WebException.Status property, for example WebExceptionStatus.NameResolutionFailure should indicate a DNS resolution problem.
It may happen, there isn’t much you can do.
What I’d suggest to always wrap that (network related) code in a loop with a try/catch block (as also suggested here for other fallible operations). Handle known exceptions, wait a little (say 1000 msec) and try again (for say 3 times). Only if failed all times then you can quit/report an error to your users. Very raw example like this:
private const int NumberOfRetries = 3;
private const int DelayOnRetry = 1000;
public static async Task<HttpResponseMessage> GetFromUrlAsync(string url) {
using (var client = new HttpClient()) {
for (int i=1; i <= NumberOfRetries; ++i) {
try {
return await client.GetAsync(url);
}
catch (Exception e) when (i < NumberOfRetries) {
await Task.Delay(DelayOnRetry);
}
}
}
}
answered Jul 29, 2014 at 11:32
![]()
Adriano RepettiAdriano Repetti
64.3k19 gold badges137 silver badges203 bronze badges
16
I had a similar issue when trying to access a service (old ASMX service). The call would work when accessing via an IP however when calling with an alias I would get the remote name could not be resolved.
Added the following to the config and it resolved the issue:
<system.net>
<defaultProxy enabled="true">
</defaultProxy>
</system.net>
answered Feb 7, 2018 at 13:59
1
Open the hosts file located at : **C:windowssystem32driversetc**.
Hosts file is for what?
Add the following at end of this file :
YourServerIP YourDNS
Example:
198.168.1.1 maps.google.com
answered Jul 12, 2018 at 8:46
this problem is pretty sure related to the HttpClient of c#. This client is designed to reuse it. Because the sockets are not directly closed after you dispose the HttpClient. Good explanation is provided by this blog post (https://www.nimaara.com/beware-of-the-net-httpclient/).
You have to handle the case that you DNS lookup table is outdated. In the blog post you also find information how to do this.
ServicePointManager.FindServicePoint(endpoint).ConnectionLeaseTimeout = (int)TimeSpan.FromMinutes(1).TotalMilliseconds;
ServicePointManager.DnsRefreshTimeout = (int)1.Minutes().TotalMilliseconds;
answered Jun 22, 2021 at 5:47
![]()
Страница 7 из 7
-
А чего сами не сделаете несколько «левых» почт?
-
Потому что нужно несколько сотен, зареганых на российские номера.
-
А ни у кого нет видео с марафона пузата по СЯ? Когда-то на марафоне местном давали ссылку, но она сейчас не работает… А у меня по тому видео с КК все замечательно получалось. А сейчас что-то не идет совсем. Не собирает, и все

-
Девочки, была с сайтом на длительном перерыве, сейчас на карантине появилось свободное время ним заняться. начала искать ключи в кк, все хорошо, собрало. Но когда нажимаю найти частоту к ним, не ищет и пишет:
25.03.2020 15:13:24 ошибка NetworkMethods.LoadPage: Невозможно соединиться с удаленным сервером (no proxy)в чем может быть проблема?
просто странно, что ключи нашло, а частоту нет.@
Последнее редактирование модератором: 25 мар 2020
-
У меня нормально работает. Если проблема осталась, то стоит сообщить разработчикам. Уверена, что ребята подскажут, что сделать.
-
сообщила. сказали обновить, а я его итак обновила….
-
Всё оказалось так просто и всё
Страница 7 из 7
Как правильно настроить словоёб, для работы с прокси?
Сбор ключей в один поток, без прокси работает отлично, но хотелось бы настроить сбор в три потока, но к сожалению возникает ошибка при добавлении прокси.
Мои настройки — первый вариант:
- Настройки/Парсер/Yandex.Direct — тут прописал список аккаунов яндекса в формате ЛогинЯндекса:ПарольЯндекса (также есть формат: прокси:порт:#ЛогинПрокси:ПарольПрокси:ЛогинЯндекса:ПарольЯндекса)
- Настройки/Сеть — Загрузил из файла прокси, которые взяты по ссылке hidemy.name/ru/proxy-list/?country=RU&maxtime=400#list
Код:
19.09.2020 18:22:14: ошибка NetworkMethods.LoadPage: Базовое соединение закрыто: Соединение было неожиданно закрыто. (http://188.247.39.14:43032/)
19.09.2020 18:22:14: an error occured while determining the domain name (proxy: 188.247.39.14:43032)
19.09.2020 18:22:30: ошибка NetworkMethods.LoadPage: Невозможно соединиться с удаленным сервером (http://95.84.141.162:3629/)
19.09.2020 18:22:30: an error occured while determining the domain name (proxy: 95.84.141.162:3629)
19.09.2020 18:23:06: ошибка NetworkMethods.LoadPage: Невозможно соединиться с удаленным сервером (http://109.167.226.107:53930/)
19.09.2020 18:23:06: an error occured while determining the domain name (proxy: 109.167.226.107:53930)
19.09.2020 18:23:27: ошибка NetworkMethods.LoadPage: Базовое соединение закрыто: Непредвиденная ошибка при приеме. (http://188.235.133.102:1080/)
19.09.2020 18:23:27: an error occured while determining the domain name (proxy: 188.235.133.102:1080)
19.09.2020 18:23:43: ошибка NetworkMethods.LoadPage: Невозможно соединиться с удаленным сервером (http://158.58.131.27:53058/)
19.09.2020 18:23:43: an error occured while determining the domain name (proxy: 158.58.131.27:53058)
19.09.2020 18:24:19: ошибка NetworkMethods.LoadPage: Невозможно соединиться с удаленным сервером (http://212.67.0.150:50090/)
19.09.2020 18:24:19: an error occured while determining the domain name (proxy: 212.67.0.150:50090)
19.09.2020 18:24:38: ошибка NetworkMethods.LoadPage: Базовое соединение закрыто: Соединение было неожиданно закрыто. (http://195.239.7.18:35746/)
19.09.2020 18:24:38: an error occured while determining the domain name (proxy: 195.239.7.18:35746)
19.09.2020 18:24:49: ошибка NetworkMethods.LoadPage: Базовое соединение закрыто: Соединение было неожиданно закрыто. (http://83.219.158.123:4145/)
19.09.2020 18:24:49: an error occured while determining the domain name (proxy: 83.219.158.123:4145)
19.09.2020 18:24:54: ошибка NetworkMethods.LoadPage: Базовое соединение закрыто: Соединение было неожиданно закрыто. (http://77.233.10.37:33683/)
19.09.2020 18:24:54: an error occured while determining the domain name (proxy: 77.233.10.37:33683)
19.09.2020 18:25:30: ошибка NetworkMethods.LoadPage: Невозможно соединиться с удаленным сервером (http://109.252.255.162:38500/)
19.09.2020 18:25:30: an error occured while determining the domain name (proxy: 109.252.255.162:38500)
19.09.2020 18:25:34: ошибка NetworkMethods.LoadPage: Базовое соединение закрыто: Непредвиденная ошибка при приеме. (http://109.201.96.222:4145/)
19.09.2020 18:25:34: an error occured while determining the domain name (proxy: 109.201.96.222:4145)
19.09.2020 18:25:50: ошибка NetworkMethods.LoadPage: Невозможно соединиться с удаленным сервером (http://178.47.141.196:4145/)
19.09.2020 18:25:50: an error occured while determining the domain name (proxy: 178.47.141.196:4145)
19.09.2020 18:25:54: ошибка NetworkMethods.LoadPage: Базовое соединение закрыто: Соединение было неожиданно закрыто. (http://37.235.203.91:4145/)
19.09.2020 18:25:54: an error occured while determining the domain name (proxy: 37.235.203.91:4145)
19.09.2020 18:26:42: ошибка NetworkMethods.LoadPage: Время ожидания операции истекло (http://185.123.194.28:3629/)
19.09.2020 18:26:42: an error occured while determining the domain name (proxy: 185.123.194.28:3629)
19.09.2020 18:26:58: ошибка NetworkMethods.LoadPage: Невозможно соединиться с удаленным сервером (http://194.226.109.76:4153/)
19.09.2020 18:26:59: an error occured while determining the domain name (proxy: 194.226.109.76:4153)
19.09.2020 18:27:03: ошибка NetworkMethods.LoadPage: Базовое соединение закрыто: Непредвиденная ошибка при приеме. (http://176.114.228.40:44604/)
19.09.2020 18:27:03: an error occured while determining the domain name (proxy: 176.114.228.40:44604)
19.09.2020 18:27:07: ошибка NetworkMethods.LoadPage: Базовое соединение закрыто: Непредвиденная ошибка при приеме. (http://88.84.212.14:4145/)
19.09.2020 18:27:07: an error occured while determining the domain name (proxy: 88.84.212.14:4145)
19.09.2020 18:27:23: ошибка NetworkMethods.LoadPage: Невозможно соединиться с удаленным сервером (http://46.254.240.106:43310/)
19.09.2020 18:27:23: an error occured while determining the domain name (proxy: 46.254.240.106:43310)
19.09.2020 18:27:39: ошибка NetworkMethods.LoadPage: Невозможно соединиться с удаленным сервером (http://109.197.93.133:43797/)
19.09.2020 18:27:39: an error occured while determining the domain name (proxy: 109.197.93.133:43797)
19.09.2020 18:27:55: ошибка NetworkMethods.LoadPage: Невозможно соединиться с удаленным сервером (http://92.255.185.6:4145/)
19.09.2020 18:27:55: an error occured while determining the domain name (proxy: 92.255.185.6:4145)
19.09.2020 18:28:18: ошибка NetworkMethods.LoadPage: Базовое соединение закрыто: Соединение было неожиданно закрыто. (http://178.57.89.142:32916/)
19.09.2020 18:28:18: an error occured while determining the domain name (proxy: 178.57.89.142:32916)
19.09.2020 18:28:36: ошибка NetworkMethods.LoadPage: Базовое соединение закрыто: Соединение было неожиданно закрыто. (http://78.110.154.177:51676/)
19.09.2020 18:28:36: an error occured while determining the domain name (proxy: 78.110.154.177:51676)
19.09.2020 18:28:52: ошибка NetworkMethods.LoadPage: Невозможно соединиться с удаленным сервером (http://89.185.93.190:4145/)
19.09.2020 18:28:52: an error occured while determining the domain name (proxy: 89.185.93.190:4145)
19.09.2020 18:29:09: ошибка NetworkMethods.LoadPage: Невозможно соединиться с удаленным сервером (http://78.139.91.76:4145/)
19.09.2020 18:29:09: an error occured while determining the domain name (proxy: 78.139.91.76:4145)
19.09.2020 18:29:25: ошибка NetworkMethods.LoadPage: Базовое соединение закрыто: Непредвиденная ошибка при приеме. (http://94.180.253.213:1080/)
19.09.2020 18:29:25: an error occured while determining the domain name (proxy: 94.180.253.213:1080)
19.09.2020 18:29:59: ошибка NetworkMethods.LoadPage: Базовое соединение закрыто: Соединение было неожиданно закрыто. (http://95.181.214.105:3629/)
19.09.2020 18:29:59: an error occured while determining the domain name (proxy: 95.181.214.105:3629)
19.09.2020 18:30:17: принят запрос на остановку сбора
19.09.2020 18:30:29: ошибка NetworkMethods.LoadPage: Невозможно соединиться с удаленным сервером (http://31.41.225.205:45067/)
19.09.2020 18:30:29: an error occured while determining the domain name (proxy: 31.41.225.205:45067)
19.09.2020 18:30:31: процесс сбора левой колонки Yandex.Wordstat для фразы "Ключ Фраза" был завершен не полностью
Мои настройки — второй вариант:
- Настройки/Парсер/Yandex.Direct — тут прописал список аккаунов яндекса в формате #ЛогинПрокси:ПарольПрокси:ЛогинЯндекса:ПарольЯндекса
Код:
19.09.2020 19:03:09: кол-во потоков Yandex.Wordstat ограничено числом аккаунтов Yandex.Direct: 1
19.09.2020 19:03:09: процесс сбора левой колонки Yandex.Wordstat для фразы "Ключ Фраза" начат
19.09.2020 19:03:23: ошибка NetworkMethods.LoadPage: Невозможно соединиться с удаленным сервером (http://192.162.193.243:54313/)
P.S
Ещё подскажите, где взять бесплатные прокси-листы. Не помню уже как называется, но раньше был сайт (такой досовский синий), я там брал, щас не могу его найти.
- Печать
Страниц: [1] 2 Вниз
Тема: Проблема с Key Collector и Словоеб (Прочитано 12873 раз)
![]()
Проблема в том что последние два дня когда вбиваю какой-то запрос для последующего анализа — мне выдает не совсем понятные вещи и не совсем понятные цифры.

На скрине все видно.
Кто знает почему?

Записан
![]()
В самом кей-коллеторе писали, что яша сменил кодировку, исправят…, т.е. уже исправили в кей-коллекторе…
« Последнее редактирование: 10-07-2012, 11:42:15 от Владимир75 »

Записан
Мобильный, WatsApp., Viber +79964788889, telegram @xiceer.
![]()
В самом кей-коллеторе писали, что яша сменил кодировку, исправят…, т.е. уже исправили в кей-коллекторе…
А касательно Словоеба ничего не говорили? Если яша сменил кодировку, то почему одни ключи отображаются нормально, а другие вот такими же не совсем понятными вещами и не совсем понятными цифрами.

Записан
![]()
EntuziAst, увы, пока никаких данных нет.

Записан
![]()
EntuziAst, увы, пока никаких данных нет.
Очень и очень жаль. Решил взять Key Collector, если там исправили эту ошибку. Я так понимаю, что у Вас уже есть Key Collector. Ошибку там исправили?)

Записан
![]()
Очень и очень жаль. Решил взять Key Collector, если там исправили эту ошибку. Я так понимаю, что у Вас уже есть Key Collector. Ошибку там исправили?)
Проблему с кодировкой уже исправили

Записан
![]()
Проблему с кодировкой уже исправили
Спасибо! Будем брать!)

Записан
Я использую программу Словоеб 2.0.5. Но очень медленно собирает данные. Например сейчас идет сбор «!» яндекс вордстат, идет уже целый день. В журнале событий постоянно сообщения:
02.08.2013 9:53:36: ошибка NetworkMethods.LoadPage: Запрос был прерван: Время ожидания операции истекло.
02.08.2013 9:53:36: при загрузке страницы уточняющих частотностей возникла ошибка. Выполняем повторную (2) попытку загрузить информацию
по времени в статистике насчитал, что осталось еще 28 с лишним дней! (всего 1% завершен за прошедший день)
всего поисковых фраз более 300 000
нельзя ли как-то ускорить процесс? Если можно, подскажите в чем причина?
Спасибо

Записан
![]()
Я использую программу Словоеб 2.0.5. Но очень медленно собирает данные. Например сейчас идет сбор «!» яндекс вордстат, идет уже целый день. В журнале событий постоянно сообщения:
02.08.2013 9:53:36: ошибка NetworkMethods.LoadPage: Запрос был прерван: Время ожидания операции истекло.
02.08.2013 9:53:36: при загрузке страницы уточняющих частотностей возникла ошибка. Выполняем повторную (2) попытку загрузить информацию
по времени в статистике насчитал, что осталось еще 28 с лишним дней! (всего 1% завершен за прошедший день)
всего поисковых фраз более 300 000
нельзя ли как-то ускорить процесс? Если можно, подскажите в чем причина?
Спасибо
В кейколлекторе процесс ускорить можно. На счет словоёба необходимо упрашивать у разработчика. Возможно эту опцию они из него исключили.

Записан
Да, разработчики написали, что для словоёба только если увеличить таймауты — одно решение.
Неужели действительно нет другого выхода? Что тогда все нахваливают эту прогу?

Записан
- Печать
Страниц: [1] 2 Вверх
- Remove From My Forums
Невозможно разрешить удалённое имя
-
Общие обсуждения
-
Добрый день!
В этой теме я писал про созданные мной веб-сервис и отчёт, вытягивающий данные из этого сервиса.
Ошибка, связанная с незарегистрированным модулем обработки XML устранена, но теперь возникает другая ошибка, а именно: «Не удалось выполнить запрос для набора данных «EventsDataSet» (rsErrorExecutingCommand). Failed
to prepare web request for the specified URL (rsXmlDataProviderError). Невозможно разрешить удаленное имя: ‘XXX’«.Пробовал загружать в библиотеку документов отчёт без параметров, тянущий данные из списка SharePoint — всё в порядке.
Куда стоит копать, чтобы разобраться с этим?
-
Изменен тип
3 ноября 2014 г. 7:25
-
Изменен тип