Answer the question
In order to leave comments, you need to log in
How to catch a pest or why does curl break?
Всем привет.
Помогите не сойти с ума ;)
Есть сервер. На сервере сборка (винда, студия и всё такое). В процессе сборки запускается нинзя, который запускает питон, который запускает curl, который отправляет файлик на другой сервер.
Раз в неделю эта замечательная конструкция встаёт раком и curl начинает стабильно возвращать код 55: типа "не могу отправить файл на [другой] сервер".
Если пойти по RDP и позвать curl из консольки, то всё работает.
Эффект воcпроизводится стабильно и лечится... перезагрузкой сервера. Или EMET-а. Или касперского.
Хотя в логах у последнего всё чисто.
Визуально, curl успевает отправить несколько МБ на [другой] сервер, после чего залипает минут на 5.
Apparently, after that, a timeout is triggered on the [other] server, and curl honestly writes "well, I couldn't."
Any ideas what might be preventing curl from reading the file from disk?
It’s impossible to accurately reproduce something like “turned off Casper, everything worked” :(
How can I diagnose this at all?
Answer the question
In order to leave comments, you need to log in
I would collect network diagnostics.
Before curl or after it returned an error, run several programs that write information to the log.
1) ping yourself, gateway, googledns and target host by IP. (depending on source and target host networks)
2) traceroute to target host without name lookup
3) environment variables (who am I) process lists and so on.
4) telnet (tcping) to the port of the target host and a foreign host for comparison. To check if an antivirus or target host is blocking you.
5) look at the logs of the target server. Increase the information content of the logs.
6) plug the host into the router (linuxbox) on it collect traffic on the port of interest (tcpdump to a file)
7) put the culprit on the hosthttps://www.winpcap.org/ and write the traffic to a file then see what happens in wireshark.
8) Mark Rusinovich's sysinternals utilities for analyzing what is happening with the grid, processes, connections, ports, errors in working with registry files, and so on.
9) try to send the file using PowerShell or any other utility instead of python and curl.
The stability of the error return, in theory, makes it possible to find the culprit. But "login via RDP" has many differences from running as system or a timer. Therefore it works for you on RDP.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question