[Resolved] Mixpanel errors in console - mitigations?

The next release (release in use 0.11.7) being some time away and the mixpanel errors severely diluting console output to the point of inutility (see below for an example)…

Is there any edit that could be made to a source file or something to stop these message being output - or other mitigation?

update Is google analytics required for mixpanel to work?? I notice that the GET for https://www.google-analytics.com/analytics.js fails with ERR_NAME_NOT_RESOLVED and one of the callers looks like it may be associated with mixpanel (http://localhost:8080/static/js/1.b98a3dee54f2bf18fefe.js)

However, I can’t work out what’s blocking it now because NoScript is OFF for the tab, Ghostery trusts localhost; AdBlockPlus, UBlock Origin are off for localhost… and I have disabled the Google Analytics Opt-out Add-on (by Google) extension in Chrome.

What’s left??

2021-02-16 10:21:50,194 - ERROR - logging.py:77 - Failed setting mixpanel user
Traceback (most recent call last):
  File "c:\users\julian\anaconda3\envs\perceptilabs-gpu\lib\site-packages\urllib3\connection.py", line 160, in _new_conn
    (self._dns_host, self.port), self.timeout, **extra_kw
  File "c:\users\julian\anaconda3\envs\perceptilabs-gpu\lib\site-packages\urllib3\util\connection.py", line 61, in create_connection
    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
  File "c:\users\julian\anaconda3\envs\perceptilabs-gpu\lib\socket.py", line 752, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 11004] getaddrinfo failed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\users\julian\anaconda3\envs\perceptilabs-gpu\lib\site-packages\urllib3\connectionpool.py", line 677, in urlopen
    chunked=chunked,
  File "c:\users\julian\anaconda3\envs\perceptilabs-gpu\lib\site-packages\urllib3\connectionpool.py", line 381, in _make_request
    self._validate_conn(conn)
  File "c:\users\julian\anaconda3\envs\perceptilabs-gpu\lib\site-packages\urllib3\connectionpool.py", line 978, in _validate_conn
    conn.connect()
  File "c:\users\julian\anaconda3\envs\perceptilabs-gpu\lib\site-packages\urllib3\connection.py", line 309, in connect
    conn = self._new_conn()
  File "c:\users\julian\anaconda3\envs\perceptilabs-gpu\lib\site-packages\urllib3\connection.py", line 172, in _new_conn
    self, "Failed to establish a new connection: %s" % e
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x0000020DB4C644C8>: Failed to establish a new connection: [Errno 11004] getaddrinfo failed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\users\julian\anaconda3\envs\perceptilabs-gpu\lib\site-packages\mixpanel\__init__.py", line 557, in _write_request
    encode_multipart=False, # URL-encode payload in POST body.
  File "c:\users\julian\anaconda3\envs\perceptilabs-gpu\lib\site-packages\urllib3\request.py", line 80, in request
    method, url, fields=fields, headers=headers, **urlopen_kw
  File "c:\users\julian\anaconda3\envs\perceptilabs-gpu\lib\site-packages\urllib3\request.py", line 171, in request_encode_body
    return self.urlopen(method, url, **extra_kw)
  File "c:\users\julian\anaconda3\envs\perceptilabs-gpu\lib\site-packages\urllib3\poolmanager.py", line 336, in urlopen
    response = conn.urlopen(method, u.request_uri, **kw)
  File "c:\users\julian\anaconda3\envs\perceptilabs-gpu\lib\site-packages\urllib3\connectionpool.py", line 767, in urlopen
    **response_kw
  File "c:\users\julian\anaconda3\envs\perceptilabs-gpu\lib\site-packages\urllib3\connectionpool.py", line 767, in urlopen
    **response_kw
  File "c:\users\julian\anaconda3\envs\perceptilabs-gpu\lib\site-packages\urllib3\connectionpool.py", line 767, in urlopen
    **response_kw
  [Previous line repeated 1 more time]
  File "c:\users\julian\anaconda3\envs\perceptilabs-gpu\lib\site-packages\urllib3\connectionpool.py", line 727, in urlopen
    method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
  File "c:\users\julian\anaconda3\envs\perceptilabs-gpu\lib\site-packages\urllib3\util\retry.py", line 439, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.mixpanel.com', port=443): Max retries exceeded with url: /engage (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x0000020DB4C644C8>: Failed to establish a new connection: [Errno 11004] getaddrinfo failed'))

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "perceptilabs\mixpanel_handler.py", line 157, in perceptilabs.mixpanel_handler.MixPanelHandler._transform_and_track
  File "c:\users\julian\anaconda3\envs\perceptilabs-gpu\lib\site-packages\mixpanel\__init__.py", line 222, in people_set_once
    }, meta=meta or {})
  File "c:\users\julian\anaconda3\envs\perceptilabs-gpu\lib\site-packages\mixpanel\__init__.py", line 358, in people_update
    self._consumer.send('people', json_dumps(record, cls=self._serializer))
  File "c:\users\julian\anaconda3\envs\perceptilabs-gpu\lib\site-packages\mixpanel\__init__.py", line 539, in send
    self._write_request(self._endpoints[endpoint], json_message, api_key)
  File "c:\users\julian\anaconda3\envs\perceptilabs-gpu\lib\site-packages\mixpanel\__init__.py", line 560, in _write_request
    six.raise_from(MixpanelException(e), e)
  File "<string>", line 3, in raise_from
mixpanel.MixpanelException: HTTPSConnectionPool(host='api.mixpanel.com', port=443): Max retries exceeded with url: /engage (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x0000020DB4C644C8>: Failed to establish a new connection: [Errno 11004] getaddrinfo failed'))
2021-02-16 10:21:53,861 - ERROR - logging.py:77 - Failed setting mixpanel user
Traceback (most recent call last):
  File "c:\users\julian\anaconda3\envs\perceptilabs-gpu\lib\site-packages\urllib3\connection.py", line 160, in _new_conn
    (self._dns_host, self.port), self.timeout, **extra_kw
  File "c:\users\julian\anaconda3\envs\perceptilabs-gpu\lib\site-packages\urllib3\util\connection.py", line 61, in create_connection
    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
  File "c:\users\julian\anaconda3\envs\perceptilabs-gpu\lib\socket.py", line 752, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 11004] getaddrinfo failed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\users\julian\anaconda3\envs\perceptilabs-gpu\lib\site-packages\urllib3\connectionpool.py", line 677, in urlopen
    chunked=chunked,
  File "c:\users\julian\anaconda3\envs\perceptilabs-gpu\lib\site-packages\urllib3\connectionpool.py", line 381, in _make_request
    self._validate_conn(conn)
  File "c:\users\julian\anaconda3\envs\perceptilabs-gpu\lib\site-packages\urllib3\connectionpool.py", line 978, in _validate_conn
    conn.connect()
  File "c:\users\julian\anaconda3\envs\perceptilabs-gpu\lib\site-packages\urllib3\connection.py", line 309, in connect
    conn = self._new_conn()
  File "c:\users\julian\anaconda3\envs\perceptilabs-gpu\lib\site-packages\urllib3\connection.py", line 172, in _new_conn
    self, "Failed to establish a new connection: %s" % e
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x0000020DBED81948>: Failed to establish a new connection: [Errno 11004] getaddrinfo failed

During handling of the above exception, another exception occurred:

Hi,

It sounds like you have removed everything which should be blocking it.
Do you have anything more on the log, or is the Failed setting mixpanel user error the first one you see?
The one who set this up is out of office until Monday, but as soon as he is back I’ll reach out to you on Slack for some better debugging to see exactly how it fails.

We will probably also push a hotfix for it just to get the rid of the logs clogging up the console in the meantime.

Sorry for the inconvenience!

Hi Robert,

I remember noting in another post that the mixpanel error was occurring every 4s; I have now seen that the error occurs on some sort of event, so most of the time it occurs when I edit a layer (not sure whether just properties or position also); on the other occasion I guess an event was being triggered regularly causing the mixpanel effect).

I just started perceptilabs from scratch and attach the whole of the console output (in the app… didn’t have -v=3 on)

Startup log.txt (5.1 KB)

Thanks!
And yea, it’ll trigger at certain events rather than continuously, although it makes little difference in regards to how spammed you get from it :sweat_smile:

TL;DR - HOSTS FILE!

Mixpanel cropped up again in the email about live coding today and I realised I could access the link in a linux VM but not windows; checked not blocked by Quad 9 DNS or Cloudflare 1.1.1.2, finally blockage traced to entry in HOSTS because using: MVPS HOSTS from # http://winhelp2002.mvps.org/hosts.htm

Have commented it out; live coding link now works, can ping api.mixpanel.com… no obvious mixpanel issue in newly opened perceptilabs console.

That’s fantastic that you found it! :pray:
Thanks for writing it here as well, will be great to direct others with the same issue to as an option to what goes wrong.