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

Errors when wakatime.com is not responding. #41

Closed
jamapag opened this issue Jul 4, 2016 · 7 comments
Closed

Errors when wakatime.com is not responding. #41

jamapag opened this issue Jul 4, 2016 · 7 comments

Comments

@jamapag
Copy link

jamapag commented Jul 4, 2016

For some reason wakatime.com is not responding for me so vim plugin constantly writes errors on top of vim window, so I unable to work with it. There is some logs:

{"now": "2016/07/04 21:32:08 +0300", "version": "6.0.6", "plugin": "vim/703 vim-wakatime/4.0.12", "time": 1467657068.24605, "level": "ERROR", "message": "Traceback (most recent call last):\n  File \"/Users/maks/.vim/bundle/vim-wakatime/plugin/packages/wakatime/logger.py\", line 77, in traceback_formatter\n    level = kwargs.get('level', args[0]).lower()\nIndexError: tuple index out of range\n"}
Traceback (most recent call last):
  File "/Users/maks/.vim/bundle/vim-wakatime/plugin/packages/wakatime/main.py", line 518, in execute
    retval = process_heartbeat(args, configs, hostname, heartbeat)
  File "/Users/maks/.vim/bundle/vim-wakatime/plugin/packages/wakatime/main.py", line 496, in process_heartbeat
    return send_heartbeat(**heartbeat)
  File "/Users/maks/.vim/bundle/vim-wakatime/plugin/packages/wakatime/main.py", line 374, in send_heartbeat
    proxies=proxies, timeout=timeout)
  File "/Users/maks/.vim/bundle/vim-wakatime/plugin/packages/wakatime/packages/requests/sessions.py", line 518, in post
    return self.request('POST', url, data=data, json=json, **kwargs)
  File "/Users/maks/.vim/bundle/vim-wakatime/plugin/packages/wakatime/packages/requests/sessions.py", line 475, in request
    resp = self.send(prep, **send_kwargs)
  File "/Users/maks/.vim/bundle/vim-wakatime/plugin/packages/wakatime/packages/requests/sessions.py", line 585, in send
    r = adapter.send(request, **kwargs)
  File "/Users/maks/.vim/bundle/vim-wakatime/plugin/packages/wakatime/packages/requests/adapters.py", line 403, in send
    timeout=timeout
  File "/Users/maks/.vim/bundle/vim-wakatime/plugin/packages/wakatime/packages/requests/packages/urllib3/connectionpool.py", line 640, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/Users/maks/.vim/bundle/vim-wakatime/plugin/packages/wakatime/packages/requests/packages/urllib3/util/retry.py", line 284, in increment
    _observed_errors=_observed_errors)
  File "/Users/maks/.vim/bundle/vim-wakatime/plugin/packages/wakatime/packages/requests/packages/urllib3/util/retry.py", line 153, in new
    raise_on_status=self.raise_on_status,
AttributeError: 'Retry' object has no attribute 'raise_on_status'

{"now": "2016/07/04 21:32:19 +0300", "version": "6.0.6", "plugin": "vim/704 vim-wakatime/4.0.12", "time": 1467657079.319077, "level": "ERROR", "message": "Traceback (most recent call last):\n  File \"/Users/maks/.vim/bundle/vim-wakatime/plugin/packages/wakatime/logger.py\", line 77, in traceback_formatter\n    level = kwargs.get('level', args[0]).lower()\nIndexError: tuple index out of range\n"}
{"now": "2016/07/04 21:32:57 +0300", "version": "6.0.6", "plugin": "vim/704 vim-wakatime/4.0.12", "time": 1467657117.530476, "level": "ERROR", "message": "Traceback (most recent call last):\n  File \"/Users/maks/.vim/bundle/vim-wakatime/plugin/packages/wakatime/logger.py\", line 77, in traceback_formatter\n    level = kwargs.get('level', args[0]).lower()\nIndexError: tuple index out of range\n"}

And it writes those 'Tracebacks' into my vim window.

@alanhamlett
Copy link
Member

Thought this was fixed with #39, guess it's still a problem in urllib3 master version.

@jamapag
Copy link
Author

jamapag commented Jul 5, 2016

Is it necessary to print whole stack traces into vim window/std out?

@alanhamlett
Copy link
Member

Can you update vim-wakatime and see if the error is fixed?

We should redirect tracebacks, but I haven't been able to redirect the output of exec to a variable yet.

@jamapag
Copy link
Author

jamapag commented Jul 6, 2016

Problem still exists. You can test it by yourself. Just close internet connection, and try to open some file with command line vim. Result should be something like this:
vim_screenshot

@alanhamlett
Copy link
Member

Should be fixed in the latest version of vim-wakatime. There was a problem with the cached requests.Session object when it was pickled from a previous version of requests that wasn't compatible with the latest version.

@jamapag
Copy link
Author

jamapag commented Jul 6, 2016

Looks good for me.

@jamapag jamapag closed this as completed Jul 6, 2016
@alanhamlett
Copy link
Member

Thanks!

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

2 participants