TheDabblingDuck / ankimote

Ankimote is an addon that adds remote control functionality to Anki flashcards
MIT License
25 stars 4 forks source link

Ankimote fails if Google Analytics cannot be reached #51

Open iamasink opened 6 months ago

iamasink commented 6 months ago

I get the following error when I connect (though it still connects fine) and it errors whenever I try use the remote, then does nothing.

Anki encountered a problem. Please follow the troubleshooting steps. Add-ons possibly involved: Ankimote Debug Info:

Anki 23.12.1 (1a1d4d54)  (ao)
Python 3.9.15 Qt 6.6.1 PyQt 6.6.1
Platform: Windows-10-10.0.22631

Traceback (most recent call last):
  File "urllib3.connection", line 203, in _new_conn
  File "urllib3.util.connection", line 60, in create_connection
  File "socket", line 954, in getaddrinfo
socket.gaierror: [Errno 11004] getaddrinfo failed

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

Traceback (most recent call last):
  File "urllib3.connectionpool", line 790, in urlopen
  File "urllib3.connectionpool", line 496, in _make_request
  File "urllib3.connection", line 395, in request
  File "http.client", line 1280, in endheaders
  File "http.client", line 1040, in _send_output
  File "http.client", line 980, in send
  File "urllib3.connection", line 243, in connect
  File "urllib3.connection", line 210, in _new_conn
urllib3.exceptions.NameResolutionError: <urllib3.connection.HTTPConnection object at 0x0000011663099100>: Failed to resolve 'www.google-analytics.com' ([Errno 11004] getaddrinfo failed)

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

Traceback (most recent call last):
  File "requests.adapters", line 486, in send
  File "urllib3.connectionpool", line 844, in urlopen
  File "urllib3.util.retry", line 515, in increment
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='www.google-analytics.com', port=80): Max retries exceeded with url: /collect (Caused by NameResolutionError("<urllib3.connection.HTTPConnection object at 0x0000011663099100>: Failed to resolve 'www.google-analytics.com' ([Errno 11004] getaddrinfo failed)"))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Lily\AppData\Roaming\Anki2\addons21\ankimote\__init__.py", line 266, in handleMessage
    requests.post("http://www.google-analytics.com/collect", data=payloadAnsCard)
  File "requests.api", line 115, in post
  File "requests.api", line 59, in request
  File "requests.sessions", line 589, in request
  File "requests.sessions", line 703, in send
  File "requests.adapters", line 519, in send
requests.exceptions.ConnectionError: HTTPConnectionPool(host='www.google-analytics.com', port=80): Max retries exceeded with url: /collect (Caused by NameResolutionError("<urllib3.connection.HTTPConnection object at 0x0000011663099100>: Failed to resolve 'www.google-analytics.com' ([Errno 11004] getaddrinfo failed)"))

===Add-ons (active)===
(add-on provided name [Add-on folder, installed at, version, is config changed])
Additional Card Fields Fork for 21 ['744725736', 2022-10-23T11:10, 'None', '']
AnkiConnect ['2055492159', 2024-02-27T04:37, 'None', '']
AnkiWebView Inspector ['31746032', 2023-06-27T20:26, 'None', '']
Ankimote ['ankimote', 0, 'None', '']
CrowdAnki JSON exportimport Edit history Collaborate on deck creation ['1788670778', 2023-10-30T18:57, 'None', '']
FSRS4Anki Helper ['759844606', 2024-04-16T05:00, 'None', mod]
ImageResizer ['1214357311', 2023-12-03T01:58, 'None', '']
More Overview Stats 21 ['738807903', 2021-07-30T20:13, 'None', '']
Review Heatmap ['1771074083', 2022-06-30T02:43, 'None', '']

===IDs of active AnkiWeb add-ons===
1214357311 1771074083 1788670778 2055492159 31746032 738807903 744725736 759844606

===Add-ons (inactive)===
(add-on provided name [Add-on folder, installed at, version, is config changed])
iamasink commented 6 months ago

The addon errors and doesn't function if it cannot reach www.google-analytics.com, which I have blocked. I forked this repo to remove the tracking for anyone else with this issue: https://github.com/iamasink/ankimote.
It'd be nice to see an opt out and for it to fail silently, though!

CarlosJavierOrozco commented 4 months ago

The addon errors and doesn't function if it cannot reach www.google-analytics.com, which I have blocked. I forked this repo to remove the tracking for anyone else with this issue: https://github.com/iamasink/ankimote. It'd be nice to see an opt out and for it to fail silently, though!

Thankyou!!! work perfectly!