Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'NoneType' object has no attribute 'format_exc' when operation timed out #108

Closed
skys215 opened this issue Jan 5, 2022 · 2 comments
Closed

Comments

@skys215
Copy link

skys215 commented Jan 5, 2022

Hi,

While I'm using Wakatime under MacOS 12.0.1, with Sublime Text 4126, I've got AttributeError: 'NoneType' object has no attribute 'format_exc' error. I'm using proxy to avoid blockage from Internet operator. I will check about why it cannot connect to the proxy. However, I think this error is preventing from logging usefull information for debug. I assume that this behaviour is not expected.

Let me know if you guys need more information to fixed the bug.

Here's the log:

[WakaTime] [INFO] Initializing WakaTime plugin v11.0.2
[WakaTime] [INFO] Downloading wakatime-cli...
reloading settings Packages/User/phpfmt.sublime-settings
[WakaTime] [DEBUG] GitHub API Response 304
[WakaTime] [DEBUG] Downloading wakatime-cli from https://github.com/wakatime/wakatime-cli/releases/download/undefined/wakatime-cli-darwin-amd64.zip
Package Control: Installing 1 upgrades
ignored packages updated to: ["JavaScriptNext - ES6 Syntax", "SublimeCodeIntel", "Vintage", "WakaTime"]
unloading python 3.3 plugin WakaTime.WakaTime
reloading settings Packages/WakaTime/WakaTime.sublime-settings
reloading settings Packages/User/Package Control.sublime-settings
reloading settings Packages/User/Preferences.sublime-settings
Package Control: Upgraded WakaTime to 11.0.3
ignored packages updated to: ["JavaScriptNext - ES6 Syntax", "SublimeCodeIntel", "Vintage"]
reloading settings Packages/User/Package Control.sublime-settings
reloading settings Packages/User/Preferences.sublime-settings
reloading settings Packages/WakaTime/WakaTime.sublime-settings
reloading python 3.3 plugin WakaTime.WakaTime
[WakaTime] [INFO] Initializing WakaTime plugin v11.0.3
[WakaTime] [INFO] Downloading wakatime-cli...
[WakaTime] [DEBUG] GitHub API Response 304
[WakaTime] [DEBUG] Downloading wakatime-cli from https://github.com/wakatime/wakatime-cli/releases/download/undefined/wakatime-cli-darwin-amd64.zip
reloading settings Packages/User/Preferences.sublime-settings
[WakaTime] [DEBUG] Traceback (most recent call last):
  File "/Users/username/Library/Application Support/Sublime Text 3/Packages/WakaTime/WakaTime.py", line 633, in run
    download(url, zip_file)
  File "/Users/username/Library/Application Support/Sublime Text 3/Packages/WakaTime/WakaTime.py", line 892, in download
    urlretrieve(url, filePath)
  File "./python3.3/urllib/request.py", line 181, in urlretrieve
  File "./python3.3/urllib/request.py", line 156, in urlopen
  File "./python3.3/urllib/request.py", line 475, in open
  File "./python3.3/urllib/request.py", line 587, in http_response
  File "./python3.3/urllib/request.py", line 513, in error
  File "./python3.3/urllib/request.py", line 447, in _call_chain
  File "./python3.3/urllib/request.py", line 595, in http_error_default
urllib.error.HTTPError: HTTP Error 404: Not Found

[WakaTime] [INFO] Finished extracting wakatime-cli.
Exception in thread Thread-8:
Traceback (most recent call last):
  File "./python3.3/urllib/request.py", line 1248, in do_open
  File "./python3.3/http/client.py", line 1065, in request
  File "./python3.3/http/client.py", line 1103, in _send_request
  File "./python3.3/http/client.py", line 1061, in endheaders
  File "./python3.3/http/client.py", line 906, in _send_output
  File "./python3.3/http/client.py", line 844, in send
  File "./python3.3/http/client.py", line 1198, in connect
  File "./python3.3/socket.py", line 435, in create_connection
  File "./python3.3/socket.py", line 426, in create_connection
TimeoutError: [Errno 60] Operation timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/username/Library/Application Support/Sublime Text 3/Packages/WakaTime/WakaTime.py", line 639, in run
    log(DEBUG, traceback.format_exc())
  File "/Users/username/Library/Application Support/Sublime Text 3/Packages/WakaTime/WakaTime.py", line 892, in download
    urlretrieve(url, filePath)
  File "./python3.3/urllib/request.py", line 181, in urlretrieve
  File "./python3.3/urllib/request.py", line 156, in urlopen
  File "./python3.3/urllib/request.py", line 469, in open
  File "./python3.3/urllib/request.py", line 487, in _open
  File "./python3.3/urllib/request.py", line 447, in _call_chain
  File "./python3.3/urllib/request.py", line 1289, in https_open
  File "./python3.3/urllib/request.py", line 1251, in do_open
urllib.error.URLError: <urlopen error [Errno 60] Operation timed out>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./python3.3/threading.py", line 901, in _bootstrap_inner
  File "/Users/username/Library/Application Support/Sublime Text 3/Packages/WakaTime/WakaTime.py", line 653, in run
    log(DEBUG, traceback.format_exc())
AttributeError: 'NoneType' object has no attribute 'format_exc'

Code Time: Response Error for /hashed_values: [Errno 60] Operation timed out
ERROR FETCHING HASHED VALUES
'NoneType' object has no attribute 'read'

Thanks in advance.

@skys215
Copy link
Author

skys215 commented Jan 5, 2022

https://github.com/wakatime/wakatime-cli/releases/download/undefined/wakatime-cli-darwin-amd64.zip
There's undefined in the url, maybe that's the problem?

UPDATED:

When trying to get the latest version from github, it returned 304 (GitHub API Response 304)

UPDATED2:

The undefined comes from here: .wakatime-internal.cfg

[internal]
cli_version = undefined
cli_version_last_modified = Tue, 04 Jan 2022 03:29:43 GMT
backoff_at =
backoff_retries = 0

UPDATED3:
Manually set cli_version_last_modified to one year before to get 200 http status code.
Now the version number is correct but got Operation timed out. I'll try to fix my proxy.

@skys215
Copy link
Author

skys215 commented Jan 5, 2022

Fixed the problem with proxy and WakaTime was working like before.

@skys215 skys215 closed this as completed Jan 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant