GithubHelp home page GithubHelp logo

Comments (5)

FunksMaName avatar FunksMaName commented on May 24, 2024

The Python SDK is now on version 0.11.7, 6 whole months in and it's still the same old story with this bug when running on "windowsservercore:ltsc2016" docker images, as usual, well played Microsoft.

from applicationinsights-python.

SergeyKanzhelev avatar SergeyKanzhelev commented on May 24, 2024

@reyang can you take a look? If you plan to re-use this channel in OC - you will likely hit this issue

from applicationinsights-python.

reyang avatar reyang commented on May 24, 2024

Thanks @SergeyKanzhelev. I don't plan to re-use the channel.

from applicationinsights-python.

sachin-ac avatar sachin-ac commented on May 24, 2024

The bug is occurring here due to SSL certificate exception:
https://github.com/Microsoft/ApplicationInsights-Python/blob/0e8342023f79e422cb718ade544bc34af9baf6d3/applicationinsights/channel/SenderBase.py#L136
<urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852)>

This is a known issue with Python in Windows Docker container:
https://bugs.python.org/issue36137

The prescribed temporary workaround which worked for me was the following:
certutil -generateSSTFromWU roots.sst && certutil -addstore -f root roots.sst && del roots.sst

from applicationinsights-python.

madelineliao avatar madelineliao commented on May 24, 2024

Hi @reyang, I'm running into the same issue on Docker; tc.flush() hangs on forever.

Is there any solution for this? The request never seems to time out.

When I force exit the program, I get the following output:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/applicationinsights/channel/SenderBase.py", line 136, in send
    response = HTTPClient.urlopen(request, timeout=self._timeout)
  File "/usr/local/lib/python3.7/urllib/request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/local/lib/python3.7/urllib/request.py", line 525, in open
    response = self._open(req, data)
  File "/usr/local/lib/python3.7/urllib/request.py", line 543, in _open
    '_open', req)
  File "/usr/local/lib/python3.7/urllib/request.py", line 503, in _call_chain
    result = func(*args)
  File "/usr/local/lib/python3.7/urllib/request.py", line 1360, in https_open
    context=self._context, check_hostname=self._check_hostname)
  File "/usr/local/lib/python3.7/urllib/request.py", line 1317, in do_open
    encode_chunked=req.has_header('Transfer-encoding'))
  File "/usr/local/lib/python3.7/http/client.py", line 1229, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/local/lib/python3.7/http/client.py", line 1275, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.7/http/client.py", line 1224, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.7/http/client.py", line 1016, in _send_output
    self.send(msg)
  File "/usr/local/lib/python3.7/http/client.py", line 956, in send
    self.connect()
  File "/usr/local/lib/python3.7/http/client.py", line 1384, in connect
    super().connect()
  File "/usr/local/lib/python3.7/http/client.py", line 928, in connect
    (self.host,self.port), self.timeout, self.source_address)
  File "/usr/local/lib/python3.7/socket.py", line 716, in create_connection
    sock.connect(sa)

followed by:

KeyboardInterrupt

Original exception was:
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/local/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/app/hydrate/__main__.py", line 82, in <module>
    main()
  File "/app/hydrate/__main__.py", line 78, in main
    telemetry.flush()
  File "/app/hydrate/telemetry.py", line 84, in flush
    self._telemetry_client.flush()
  File "/usr/local/lib/python3.7/site-packages/applicationinsights/TelemetryClient.py", line 59, in flush
    self._channel.flush()
  File "/usr/local/lib/python3.7/site-packages/applicationinsights/channel/TelemetryChannel.py", line 73, in flush
    self._queue.flush()
  File "/usr/local/lib/python3.7/site-packages/applicationinsights/channel/SynchronousQueue.py", line 31, in flush
    local_sender.send(data)
  File "/usr/local/lib/python3.7/site-packages/applicationinsights/channel/SenderBase.py", line 136, in send
    response = HTTPClient.urlopen(request, timeout=self._timeout)
  File "/usr/local/lib/python3.7/urllib/request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/local/lib/python3.7/urllib/request.py", line 525, in open
    response = self._open(req, data)
  File "/usr/local/lib/python3.7/urllib/request.py", line 543, in _open
    '_open', req)
  File "/usr/local/lib/python3.7/urllib/request.py", line 503, in _call_chain
    result = func(*args)
  File "/usr/local/lib/python3.7/urllib/request.py", line 1360, in https_open
    context=self._context, check_hostname=self._check_hostname)
  File "/usr/local/lib/python3.7/urllib/request.py", line 1317, in do_open
    encode_chunked=req.has_header('Transfer-encoding'))
  File "/usr/local/lib/python3.7/http/client.py", line 1229, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/local/lib/python3.7/http/client.py", line 1275, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.7/http/client.py", line 1224, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.7/http/client.py", line 1016, in _send_output
    self.send(msg)
  File "/usr/local/lib/python3.7/http/client.py", line 956, in send
    self.connect()
  File "/usr/local/lib/python3.7/http/client.py", line 1384, in connect
    super().connect()
  File "/usr/local/lib/python3.7/http/client.py", line 928, in connect
    (self.host,self.port), self.timeout, self.source_address)
  File "/usr/local/lib/python3.7/socket.py", line 716, in create_connection
    sock.connect(sa)

Thank you!

from applicationinsights-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.