WakaTime throws an error when trying to enter API Key after initial config

michaelaflores created this issue on 2021-03-23 · The issue is replied 12 times

Noticing that attempting to run the api key command to check the API key throws this error:
Screen Shot 2021-03-23 at 3 53 32 PM

My .wakatime.cfg file has:

[settings]
api_key = <key>

Nova version: 5 Build 245280
macOS: 11.2.3 (20D91)
Device: MacBook Air (M1, 2020)

michaelaflores wrote this answer on 2021-03-23

I believe this is perhaps related to WakaTime not reporting any time that I spend in Nova? The debug pane reports:

Extension encountered an uncaught exception:
/Users/michaelflores/Library/Application Support/Nova/Extensions/wakatime.timetracker/Scripts/main.js (Line 382, Column 0)
Error: Error launching process: /Volumes/Macintosh HD/Users/michaelflores/.wakatime/wakatime-cli/wakatime-cli, The operation couldn’t be completed. Bad CPU type in executable
alanhamlett wrote this answer on 2021-03-24

Duplicate of #6. Does creating a ~/.wakatime.cfg file fix it? If it's arch related, try using the Python source version by adding this line to your ~/.waktime.cfg file:
standalone = false

michaelaflores wrote this answer on 2021-03-24

@alanhamlett I created this one because it happens after the first run when there is in fact a config file already present (in the description I included the contents of that file). #6 relates to the very first run, where the error is related to a config file not being present yet.

I will give adding that line a try and report back, thank you!

michaelaflores wrote this answer on 2021-03-24

@alanhamlett unfortunately after adding that line, I still get the following debug output

WakaTime[10:07:48.221000] [WakaTime] [DEBUG] Initializing version 2.0.0

WakaTime[10:07:48.532000] [WakaTime] [ERROR] Error: Error launching process: /Volumes/Macintosh HD/Users/michaelflores/.wakatime/wakatime-cli/wakatime-cli, The operation couldn’t be completed. Bad CPU type in executable

WakaTime[10:07:48.533000] [WakaTime] [DEBUG] Finished initializing WakaTime extension.
alanhamlett wrote this answer on 2021-03-24

Can you try deleting the folder /Volumes/Macintosh HD/Users/michaelflores/.wakatime/wakatime-cli and restarting Nova?

michaelaflores wrote this answer on 2021-03-24

@alanhamlett when I did that and restarted Nova, I saw debug logs to the effect of "downloading wakatime-cli". Upon restarting Nova thereafter, I see the same logs. Is there some check of the CPU type that assumes an Intel processor?

WakaTime[13:17:51.601000] [WakaTime] [DEBUG] Initializing version 2.0.0

WakaTime[13:17:51.913000] [WakaTime] [ERROR] Error: Error launching process: /Volumes/Macintosh HD/Users/michaelflores/.wakatime/wakatime-cli/wakatime-cli, The operation couldn’t be completed. Bad CPU type in executable

WakaTime[13:17:51.914000] [WakaTime] [DEBUG] Finished initializing WakaTime extension.
michaelaflores wrote this answer on 2021-03-24

After trying to use 2.0.1 I now get this in the debug panel when starting Nova/trying to use any WakaTime commands

WakaTime[17:19:01.792000] Extension encountered an uncaught exception:
/Users/michaelflores/Library/Application Support/Nova/Extensions/wakatime.timetracker/Scripts/main.js (Line 200, Column 0)
ReferenceError: Can't find variable: config
    [email protected]:///Users/michaelflores/Library/Application%20Support/Nova/Extensions/wakatime.timetracker/Scripts/main.js:200:23
    [email protected]:///Users/michaelflores/Library/Application%20Support/Nova/Extensions/wakatime.timetracker/Scripts/main.js:280:25
    [email protected]:///Users/michaelflores/Library/Application%20Support/Nova/Extensions/wakatime.timetracker/Scripts/main.js:43:27
    file:///Users/michaelflores/Library/Application%20Support/Nova/Extensions/wakatime.timetracker/Scripts/main.js:21:18

Here is what's located at ~:
Screen Shot 2021-03-24 at 5 19 17 PM

michaelaflores wrote this answer on 2021-03-24

I tried uninstalling, deleting .wakatime and .wakatime.cfg, and installing again. After prompting for my API key, I entered it, and the following error showed up in debug panel:

WakaTime[17:24:27.922000] Extension encountered an uncaught exception:
/Users/michaelflores/Library/Application Support/Nova/Extensions/wakatime.timetracker/Scripts/main.js (Line 235, Column 0)
ReferenceError: Can't find variable: lines
    [email protected]:///Users/michaelflores/Library/Application%20Support/Nova/Extensions/wakatime.timetracker/Scripts/main.js:235:28
    file:///Users/michaelflores/Library/Application%20Support/Nova/Extensions/wakatime.timetracker/Scripts/main.js:52:39

I tried restarting Nova, and now see:

WakaTime[17:25:19.977000] [WakaTime] [ERROR] Error: Error launching process: /Volumes/Macintosh HD/Users/michaelflores/.wakatime/wakatime-cli/wakatime-cli, The operation couldn’t be completed. Bad CPU type in executable

Then I am reprompted for my API key, and after entering it, the debug panel shows:

WakaTime[17:25:54.989000] Extension encountered an uncaught exception:
/Users/michaelflores/Library/Application Support/Nova/Extensions/wakatime.timetracker/Scripts/main.js (Line 235, Column 0)
ReferenceError: Can't find variable: lines
    [email protected]:///Users/michaelflores/Library/Application%20Support/Nova/Extensions/wakatime.timetracker/Scripts/main.js:235:28
    file:///Users/michaelflores/Library/Application%20Support/Nova/Extensions/wakatime.timetracker/Scripts/main.js:52:39

If I recreate .wakatime.config manually, the error changes to

WakaTime[17:27:38.634000] Extension encountered an uncaught exception:
/Users/michaelflores/Library/Application Support/Nova/Extensions/wakatime.timetracker/Scripts/main.js (Line 200, Column 0)
ReferenceError: Can't find variable: config
    [email protected]:///Users/michaelflores/Library/Application%20Support/Nova/Extensions/wakatime.timetracker/Scripts/main.js:200:23
    [email protected]:///Users/michaelflores/Library/Application%20Support/Nova/Extensions/wakatime.timetracker/Scripts/main.js:288:56
    [email protected]:///Users/michaelflores/Library/Application%20Support/Nova/Extensions/wakatime.timetracker/Scripts/main.js:447:24
    file:///Users/michaelflores/Library/Application%20Support/Nova/Extensions/wakatime.timetracker/Scripts/main.js:2:12
SuEric wrote this answer on 2021-03-27

Having same exact issue than @michaelaflores

mikebronner wrote this answer on 2021-04-10

Having this issue as well. ~/.wakatime.cfg already exists for me as I use it in many other programs.

alanhamlett wrote this answer on 2021-04-11

Should be fixed in v2.0.2?

mikebronner wrote this answer on 2021-04-11

@alanhamlett That's awesome! Not getting any more errors or crashes when setting API Key. Will monitor over the next few days to watch time tracking :) Thanks for pushing this through!

More Details About Repo
Owner Name wakatime
Repo Name WakaTime.novaextension
Full Name wakatime/WakaTime.novaextension
Language JavaScript
Created Date 2020-09-17
Updated Date 2021-04-27
Star Count 4
Watcher Count 4
Fork Count 1
Issue Count 1

YOU MAY BE INTERESTED

Issue Title State Comments Created Date Updated Date Closed Date
Why not provide andThreadPoolKey in HystrixObservableCommand? open 0 2019-05-28 2021-10-24 -
[Lens] Session timeout on unsaved Lens chart gets stuck open 11 2021-09-30 2021-11-20 -
Mention Helm-SLY in the readme? closed 9 2019-10-19 2021-11-07 2021-02-04
Ability to create service keys with additional IAM User open 1 2021-02-23 2021-11-14 -
Invalid warning on Worker assignment closed 3 2021-01-13 2021-11-14 2021-01-28
Mention deser-hjson as a solution for Rust open 0 2021-07-02 2021-10-03 -
Font not rendering some latin letters closed 6 2021-09-28 2021-11-05 2021-09-29
Issue with update 0.12.2 closed 1 2021-03-31 2021-11-13 2021-03-31
Error parsing multiline expression open 4 2021-10-29 2021-11-07 -
奖品项,能设置背景为渐变色吗? closed 8 2021-01-14 2021-11-11 2021-01-14