wakatime / sublime-wakatime

Sublime Text 2 & 3 plugin for automatic time tracking and metrics generated from your programming activity.
https://wakatime.com/sublime-text
BSD 3-Clause "New" or "Revised" License
525 stars 47 forks source link

Plugin not logging time; throwing error to ~/.wakatime.log #29

Closed emma-sg closed 9 years ago

emma-sg commented 9 years ago

From .wakatime.log:

Traceback (most recent call last):
  File "/Users/eden/Library/Application Support/Sublime Text 3/Packages/WakaTime/packages/wakatime/wakatime-cli.py", line 20, in <module>
    sys.exit(wakatime.main(sys.argv))
  File "/Users/eden/Library/Application Support/Sublime Text 3/Packages/WakaTime/packages/wakatime/wakatime/__init__.py", line 401, in main
    **vars(args)
  File "/Users/eden/Library/Application Support/Sublime Text 3/Packages/WakaTime/packages/wakatime/wakatime/__init__.py", line 336, in send_action
    if response.getcode() in ALWAYS_LOG_CODES:
AttributeError: 'NoneType' object has no attribute 'getcode'
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory

The lines Traceback (most recent call last): to AttributeError: 'NoneType' object has no attribute 'getcode' were repeated multiple times. No time is being logged.

alanhamlett commented 9 years ago

This has been fixed in the latest version. Did you use Sublime Package Control to install WakaTime? Then you can upgrade by pressing CMD + SHIFT + P and selecting Package Control: Upgrade/Overwrite All Packages.

Your WakaTime version must be out-of-date because line 401 in the current version is not the same as your traceback: https://github.com/wakatime/sublime-wakatime/blob/master/packages/wakatime/wakatime/__init__.py#L401

emma-sg commented 9 years ago

Ok, I updated (ended up reinstalling) WakaTime for ST, been coding for a little while, but the .wakatime.db has not been updated since before the issue appeared.

alanhamlett commented 9 years ago

@EdenSG are you seeing logged time in your dashboard? .wakatime.db is only used to store offline heartbeats when you are coding without internet access, so it won't get updated if every heartbeat is sent successfully.

emma-sg commented 9 years ago

No, I’m not.

On Jan 5, 2015, at 1:01 AM, Alan Hamlett notifications@github.com wrote:

@EdenSG https://github.com/EdenSG are you seeing logged time in your dashboard? .wakatime.db is only used to store offline heartbeats when you are coding without internet access, so it won't get updated if every heartbeat is sent successfully.

— Reply to this email directly or view it on GitHub https://github.com/wakatime/sublime-wakatime/issues/29#issuecomment-68671357.

alanhamlett commented 9 years ago

Can you set debug to true in your WakaTime.sublime-settings file, then open the ST console with CTRL + ` and look for any error messages? Also check ~/.wakatime.log for error messages after turning on debug mode.

emma-sg commented 9 years ago

Huh, looks like it could possibly be an issue with ST/NodeJS — I’ve got a bunch of these in my console:

Traceback (most recent call last):
  File "/Applications/Sublime Text 3.app/Contents/MacOS/sublime_plugin.py", line 445, in is_enabled_
    raise ValueError("is_enabled must return a bool", self)
ValueError: ('is_enabled must return a bool', <Nodejs.Nodejs.NodeUglifyCommand object at 0x10946e690>)

And then from .wakatime.log:

Traceback (most recent call last):
  File "/Users/eden/Library/Application Support/Sublime Text 3/Packages/WakaTime/packages/wakatime/wakatime-cli.py", line 20, in <module>
    sys.exit(wakatime.main(sys.argv))
  File "/Users/eden/Library/Application Support/Sublime Text 3/Packages/WakaTime/packages/wakatime/wakatime/__init__.py", line 401, in main
    **vars(args)
  File "/Users/eden/Library/Application Support/Sublime Text 3/Packages/WakaTime/packages/wakatime/wakatime/__init__.py", line 336, in send_action
    if response.getcode() in ALWAYS_LOG_CODES:
AttributeError: 'NoneType' object has no attribute 'getcode'
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
alanhamlett commented 9 years ago

That traceback is still from an old version of the plugin. Line 336 from your traceback: wakatime/wakatime/__init__.py", line 336, in send_action does not match line 336 in the current plugin version: init.py#L336

Are you using https://packagecontrol.io/ to install WakaTime?

emma-sg commented 9 years ago

I am. I’ll try reinstalling Package Control.

On Jan 6, 2015, at 3:40 AM, Alan Hamlett notifications@github.com wrote:

That traceback is still from an old version of the plugin. Line 336 from your traceback: wakatime/wakatime/init.py", line 336, in send_action does not match line 336 in the current plugin version: init.py#L336 https://github.com/wakatime/sublime-wakatime/blob/e1dc4039fd510a4b34e73ef981b54857d98dd79f/packages/wakatime/wakatime/__init__.py#L336 Are you using https://packagecontrol.io/ https://packagecontrol.io/ to install WakaTime?

— Reply to this email directly or view it on GitHub https://github.com/wakatime/sublime-wakatime/issues/29#issuecomment-68839525.

emma-sg commented 9 years ago

Ok, I reinstalled ST and Package Control, and it seems to be working again. Mysterious, but I suspect it was an issue with ST rather than with sublime-wakatime. Thanks anyways!

alanhamlett commented 9 years ago

Awesome, glad you've fixed it!