wakatime / jetbrains-wakatime

IntelliJ IDEA, PyCharm, RubyMine, PhpStorm, AppCode, AndroidStudio, Goland, Rider, & WebStorm plugin for quantifying your coding.
https://wakatime.com/intellij-idea
BSD 3-Clause "New" or "Revised" License
1.14k stars 167 forks source link

Plugin fails to work with JetBrains products in Windows 10 #123

Closed xSAVIKx closed 2 years ago

xSAVIKx commented 5 years ago

Windows 10 IDEA, PyCharm, and Webstorm plugins are failing with the following log message:

{
    "now": "2019/08/26 13:58:59 +0300",
    "version": "13.0.0",
    "plugin": "idea/2019.2.1 idea-wakatime/9.3.2",
    "time": 1566817120.071,
    "caller": "<user-home>AppData\\Roaming\\WakaTime\\wakatime-master\\wakatime\\api.py",
    "lineno": 125,
    "file": "<project-file>",
    "level": "WARNING",
    "message": "{'SSLError': 'HTTPSConnectionPool(host=\\'api.wakatime.com\\', port=443): Max retries exceeded with url: /api/v1/users/current/heartbeats.bulk (Caused by SSLError(\"Can\\'t connect to HTTPS URL because the SSL module is not available.\"))', 'traceback': 'Traceback (most recent call last):\\n  File \"<user-home>\\\\AppData\\\\Roaming\\\\WakaTime\\\\wakatime-master\\\\wakatime\\\\packages\\\\urllib3\\\\connectionpool.py\", line 589, in urlopen\\n    conn = self._get_conn(timeout=pool_timeout)\\n  File \"<user-home>\\\\AppData\\\\Roaming\\\\WakaTime\\\\wakatime-master\\\\wakatime\\\\packages\\\\urllib3\\\\connectionpool.py\", line 251, in _get_conn\\n    return conn or self._new_conn()\\n  File \"<user-home>\\\\AppData\\\\Roaming\\\\WakaTime\\\\wakatime-master\\\\wakatime\\\\packages\\\\urllib3\\\\connectionpool.py\", line 827, in _new_conn\\n    raise SSLError(\"Can\\'t connect to HTTPS URL because the SSL \"\\nurllib3.exceptions.SSLError: Can\\'t connect to HTTPS URL because the SSL module is not available.\\n\\nDuring handling of the above exception, another exception occurred:\\n\\nTraceback (most recent call last):\\n  File \"<user-home>\\\\AppData\\\\Roaming\\\\WakaTime\\\\wakatime-master\\\\wakatime\\\\packages\\\\requests\\\\adapters.py\", line 440, in send\\n    timeout=timeout\\n  File \"<user-home>\\\\AppData\\\\Roaming\\\\WakaTime\\\\wakatime-master\\\\wakatime\\\\packages\\\\urllib3\\\\connectionpool.py\", line 639, in urlopen\\n    _stacktrace=sys.exc_info()[2])\\n  File \"<user-home>\\\\AppData\\\\Roaming\\\\WakaTime\\\\wakatime-master\\\\wakatime\\\\packages\\\\urllib3\\\\util\\\\retry.py\", line 388, in increment\\n    raise MaxRetryError(_pool, url, error or ResponseError(cause))\\nurllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host=\\'api.wakatime.com\\', port=443): Max retries exceeded with url: /api/v1/users/current/heartbeats.bulk (Caused by SSLError(\"Can\\'t connect to HTTPS URL because the SSL module is not available.\"))\\n\\nDuring handling of the above exception, another exception occurred:\\n\\nTraceback (most recent call last):\\n  File \"<user-home>\\\\AppData\\\\Roaming\\\\WakaTime\\\\wakatime-master\\\\wakatime\\\\api.py\", line 111, in send_heartbeats\\n    verify=ssl_verify)\\n  File \"<user-home>\\\\AppData\\\\Roaming\\\\WakaTime\\\\wakatime-master\\\\wakatime\\\\packages\\\\requests\\\\sessions.py\", line 555, in post\\n    return self.request(\\'POST\\', url, data=data, json=json, **kwargs)\\n  File \"<user-home>\\\\AppData\\\\Roaming\\\\WakaTime\\\\wakatime-master\\\\wakatime\\\\packages\\\\requests\\\\sessions.py\", line 508, in request\\n    resp = self.send(prep, **send_kwargs)\\n  File \"<user-home>\\\\AppData\\\\Roaming\\\\WakaTime\\\\wakatime-master\\\\wakatime\\\\packages\\\\requests\\\\sessions.py\", line 618, in send\\n    r = adapter.send(request, **kwargs)\\n  File \"<user-home>\\\\AppData\\\\Roaming\\\\WakaTime\\\\wakatime-master\\\\wakatime\\\\packages\\\\requests\\\\adapters.py\", line 506, in send\\n    raise SSLError(e, request=request)\\nwakatime.packages.requests.exceptions.SSLError: HTTPSConnectionPool(host=\\'api.wakatime.com\\', port=443): Max retries exceeded with url: /api/v1/users/current/heartbeats.bulk (Caused by SSLError(\"Can\\'t connect to HTTPS URL because the SSL module is not available.\"))\\n'}"
}

I guess the issue may be related to my installations of Python, but why the hell the plugin looks at my setup? Just in case, I have the latest Anaconda setup in a custom (non-default) location.

alanhamlett commented 5 years ago

Yes, turn on DEBUG mode in PyCharm then it will print the Python that it's using to your idea.log file. The plugin tries to use any existing Python on your machine first before finally downloading it's embedded Python.

xSAVIKx commented 5 years ago

Here is what I have in Webstorm logs:

2019-08-26 13:54:54,084 [   6515]  DEBUG -                       WakaTime -  
com.sun.jna.platform.win32.Win32Exception: The system cannot find the file specified.
    at com.sun.jna.platform.win32.Advapi32Util.registryGetKeys(Advapi32Util.java:1991)
    at com.sun.jna.platform.win32.Advapi32Util.registryGetKeys(Advapi32Util.java:1971)
    at com.wakatime.intellij.plugin.Dependencies.getPythonFromRegistry(Dependencies.java:119)
    at com.wakatime.intellij.plugin.Dependencies.getPythonLocation(Dependencies.java:84)
    at com.wakatime.intellij.plugin.Dependencies.isPythonInstalled(Dependencies.java:45)
    at com.wakatime.intellij.plugin.WakaTime.initComponent(WakaTime.java:88)
    at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentConfigComponentAdapter.getComponentInstance(ComponentManagerImpl.java:503)
    at com.intellij.openapi.components.impl.ComponentManagerImpl.createComponents(ComponentManagerImpl.java:126)
    at com.intellij.openapi.application.impl.ApplicationImpl.lambda$load$7(ApplicationImpl.java:414)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:169)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:591)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:537)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:59)
    at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:156)
    at com.intellij.openapi.application.impl.ApplicationImpl.load(ApplicationImpl.java:414)
    at com.intellij.idea.IdeaApplication.lambda$executeInitAppInEdt$5(IdeaApplication.java:150)
    at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
    at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:746)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:377)
    at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
2019-08-26 13:54:54,087 [   6518]  DEBUG -                       WakaTime -  
com.sun.jna.platform.win32.Win32Exception: The system cannot find the file specified.
    at com.sun.jna.platform.win32.Advapi32Util.registryGetKeys(Advapi32Util.java:1991)
    at com.sun.jna.platform.win32.Advapi32Util.registryGetKeys(Advapi32Util.java:1971)
    at com.wakatime.intellij.plugin.Dependencies.getPythonFromRegistry(Dependencies.java:119)
    at com.wakatime.intellij.plugin.Dependencies.getPythonLocation(Dependencies.java:85)
    at com.wakatime.intellij.plugin.Dependencies.isPythonInstalled(Dependencies.java:45)
    at com.wakatime.intellij.plugin.WakaTime.initComponent(WakaTime.java:88)
    at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentConfigComponentAdapter.getComponentInstance(ComponentManagerImpl.java:503)
    at com.intellij.openapi.components.impl.ComponentManagerImpl.createComponents(ComponentManagerImpl.java:126)
    at com.intellij.openapi.application.impl.ApplicationImpl.lambda$load$7(ApplicationImpl.java:414)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:169)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:591)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:537)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:59)
    at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:156)
    at com.intellij.openapi.application.impl.ApplicationImpl.load(ApplicationImpl.java:414)
    at com.intellij.idea.IdeaApplication.lambda$executeInitAppInEdt$5(IdeaApplication.java:150)
    at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
    at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:746)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:377)
    at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
2019-08-26 13:54:54,088 [   6519]  DEBUG -                       WakaTime -  
com.sun.jna.platform.win32.Win32Exception: The system cannot find the file specified.
    at com.sun.jna.platform.win32.Advapi32Util.registryGetKeys(Advapi32Util.java:1991)
    at com.sun.jna.platform.win32.Advapi32Util.registryGetKeys(Advapi32Util.java:1971)
    at com.wakatime.intellij.plugin.Dependencies.getPythonFromRegistry(Dependencies.java:131)
    at com.wakatime.intellij.plugin.Dependencies.getPythonLocation(Dependencies.java:85)
    at com.wakatime.intellij.plugin.Dependencies.isPythonInstalled(Dependencies.java:45)
    at com.wakatime.intellij.plugin.WakaTime.initComponent(WakaTime.java:88)
    at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentConfigComponentAdapter.getComponentInstance(ComponentManagerImpl.java:503)
    at com.intellij.openapi.components.impl.ComponentManagerImpl.createComponents(ComponentManagerImpl.java:126)
    at com.intellij.openapi.application.impl.ApplicationImpl.lambda$load$7(ApplicationImpl.java:414)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:169)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:591)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:537)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:59)
    at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:156)
    at com.intellij.openapi.application.impl.ApplicationImpl.load(ApplicationImpl.java:414)
    at com.intellij.idea.IdeaApplication.lambda$executeInitAppInEdt$5(IdeaApplication.java:150)
    at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
    at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:746)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:377)
    at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
2019-08-26 13:54:54,088 [   6519]  DEBUG -                       WakaTime - pythonw --version 
2019-08-26 13:54:54,103 [   6534]  DEBUG -                       WakaTime - Python 3.7.3 
2019-08-26 13:54:54,103 [   6534]  DEBUG -                       WakaTime - Found python binary: pythonw 
2019-08-26 13:54:54,407 [   6838]   INFO - pl$FileIndexDataInitialization - Initialization done:412 
2019-08-26 13:54:54,454 [   6885]  DEBUG -                       WakaTime - wakatime cli version check output: "13.0.0" 
2019-08-26 13:54:54,454 [   6885]  DEBUG -                       WakaTime - wakatime cli version check exit code: 0 
2019-08-26 13:54:54,541 [   6972]   INFO - exImpl$StubIndexInitialization - Initialization done:133 
2019-08-26 13:54:54,748 [   7179]  DEBUG -                       WakaTime - Current cli version from GitHub: 13.0.0 
2019-08-26 13:54:54,748 [   7179]   INFO -                       WakaTime - wakatime-cli is up to date. 
2019-08-26 13:54:54,748 [   7179]  DEBUG -                       WakaTime - CLI location: C:\Users\savik\AppData\Roaming\WakaTime\wakatime-master\wakatime\cli.py 
2019-08-26 13:54:56,013 [   8444]   INFO -                       WakaTime - Finished initializing WakaTime plugin 
2019-08-26 13:54:56,055 [   8486]   INFO - j.ide.ui.OptionsTopHitProvider - 11 ms spent to cache options in application 
2019-08-26 13:54:56,109 [   8540]   INFO - tellij.diagnostic.LoadingPhase - Reached FRAME_SHOWN loading phase 
2019-08-26 13:54:56,806 [   9237]   INFO - pl.projectlevelman.NewMappings - VCS Root: [Git] - [D:/WebstormProjects/pdf-processing-function] 
2019-08-26 13:54:57,086 [   9517]   INFO - com.intellij.ide.ui.UISettings - Loaded: fontSize=13, fontScale=1.0; restored: fontSize=13, fontScale=1.0 
2019-08-26 13:54:57,564 [   9995]   INFO - j.ide.script.IdeStartupScripts - 0 startup script(s) found 
2019-08-26 13:54:57,685 [  10116]   INFO - rojectCodeStyleSettingsManager - Initialized from default code style settings. 
2019-08-26 13:54:58,107 [  10538]   INFO -              PerformancePlugin - Performance Plugin is in silent mode 
2019-08-26 13:54:58,270 [  10701]   INFO - pl.ProjectRootManagerComponent - project roots have changed 
2019-08-26 13:54:58,644 [  11075]   INFO - .diagnostic.PerformanceWatcher - Pushing JS language level to 45 libraries  took 205ms; general responsiveness: ok; EDT responsiveness: ok 
2019-08-26 13:54:58,909 [  11340]   INFO - .diagnostic.PerformanceWatcher - Pushing properties took 477ms; general responsiveness: ok; EDT responsiveness: ok 
2019-08-26 13:54:58,999 [  11430]   INFO - .diagnostic.PerformanceWatcher - Indexable file iteration took 89ms; general responsiveness: ok; EDT responsiveness: ok 
2019-08-26 13:54:59,205 [  11636]   INFO - .diagnostic.PerformanceWatcher - Pushing properties took 2ms; general responsiveness: ok; EDT responsiveness: ok 
2019-08-26 13:54:59,245 [  11676]   INFO - pl.ProjectRootManagerComponent - project roots have changed 
2019-08-26 13:54:59,252 [  11683]   INFO - indexing.UnindexedFilesUpdater - Unindexed files update canceled 
2019-08-26 13:54:59,450 [  11881]   INFO - .diagnostic.PerformanceWatcher - Pushing JS language level to 45 libraries  took 5ms; general responsiveness: ok; EDT responsiveness: ok 
2019-08-26 13:54:59,480 [  11911]   INFO - .diagnostic.PerformanceWatcher - Pushing properties took 11ms; general responsiveness: ok; EDT responsiveness: ok 
2019-08-26 13:54:59,938 [  12369]   INFO - ge.ExternalProjectsDataStorage - Load external projects data in 2 millis (read time: 1) 
2019-08-26 13:55:00,016 [  12447]   INFO - j.ide.ui.OptionsTopHitProvider - 530 ms spent to cache options in project 
2019-08-26 13:55:00,018 [  12449]   INFO - .diagnostic.PerformanceWatcher - Post-startup activities under progress took 1739ms; general responsiveness: ok; EDT responsiveness: 1/1 sluggish 
2019-08-26 13:55:00,030 [  12461]   INFO - .diagnostic.PerformanceWatcher - Indexable file iteration took 549ms; general responsiveness: ok; EDT responsiveness: 1/1 sluggish 
2019-08-26 13:55:00,039 [  12470]   INFO - cloudConfig.CloudConfigManager - === StatusBar.update create === 
2019-08-26 13:55:00,040 [  12471]   INFO - cloudConfig.CloudConfigManager - === doConnect === 
2019-08-26 13:55:00,041 [  12472]   INFO - cloudConfig.CloudConfigManager - === getConnectionState === 
2019-08-26 13:55:00,053 [  12484]  DEBUG -                       WakaTime - Api Key: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXc69d 
2019-08-26 13:55:00,288 [  12719]   INFO - tartup.impl.StartupManagerImpl - <project>/.idea case-sensitivity: expected=false actual=false 
2019-08-26 13:55:00,309 [  12740]   INFO - tellij.diagnostic.LoadingPhase - Reached PROJECT_OPENED loading phase 
2019-08-26 13:55:00,315 [  12746]   INFO - tellij.diagnostic.LoadingPhase - Reached INDEXING_FINISHED loading phase 
2019-08-26 13:55:00,315 [  12746]   INFO -  #git4idea.commands.GitHandler - [.] git version 
2019-08-26 13:55:00,350 [  12781]   INFO - .cloudConfig.CloudConfigClient - === Get cloud config URL: https://cloudconfig.jetbrains.com/cloudconfig/files === 
2019-08-26 13:55:00,354 [  12785]   INFO - cloudConfig.CloudConfigManager - === StatusBar.start another widget: com.intellij.cloudConfig.StatusBarInfoManager$InfoComponent@87e52af === 
2019-08-26 13:55:00,384 [  12815]   INFO -  #git4idea.commands.GitHandler - git version 2.23.0.windows.1 
2019-08-26 13:55:00,395 [  12826]   INFO - ea.config.GitExecutableManager - Git version for C:\Git\cmd\git.exe : 2.23.0 
2019-08-26 13:55:00,527 [  12958]   INFO - Json.PackageJsonUpdateNotifier - processPackageJsonFiles [file://<project>/package.json] 
2019-08-26 13:55:00,541 [  12972]   INFO - tor.impl.FileEditorManagerImpl - Project opening took 4046 ms 
2019-08-26 13:55:00,786 [  13217]   INFO - son.PackageVersionRangeMatcher - Matching 14 done in 151 ms 
2019-08-26 13:55:01,682 [  14113]   INFO - j.ide.plugins.RepositoryHelper - using cached plugin list (updated at 8/26/2019 1:48 PM) 
2019-08-26 13:55:01,809 [  14240]   INFO - cloudConfig.CloudConfigManager - === End.connect === 
2019-08-26 13:55:07,024 [  19455]   INFO - ings.impl.UpdateCheckerService - channel: release 
2019-08-26 13:55:24,105 [  36536]  DEBUG -                       WakaTime - Executing CLI: [pythonw, <user_home>\AppData\Roaming\WakaTime\wakatime-master\wakatime\cli.py, --entity, <project>/src/main/js/utils/index.js, --time, 1566816900.1830, --key, XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXc69d, --project, <project>, --language, JavaScript, --plugin, WebStorm/2019.2.1 WebStorm-wakatime/9.3.2] 
2019-08-26 13:55:24,447 [  36878]  DEBUG -                       WakaTime - Command finished with return value: 102 

I have the same debug output from the PyCharm as well.

alanhamlett commented 5 years ago

Usually this happens due to Anaconda Python not having the SSL module: https://github.com/wakatime/wakatime/issues/104

Does running easy_install pyopenssl fix this error?

alanhamlett commented 4 years ago

This might be fixed with v13.0.4 of wakatime. The next time you relaunch your IDE it should get the new version. Does that fix it?

gandarez commented 2 years ago

Is that still NOK @alanhamlett?

alanhamlett commented 2 years ago

Should be fixed now that we're no longer dependent on Python.