mujx / hakatime

Wakatime server implementation & analytics dashboard
https://hakatime.mtx-dev.xyz
The Unlicense
631 stars 47 forks source link

VS Code v1.60.2 and Wakatime Extension v1.27.0 - MethodNotAllowed Error #48

Closed jimmybrancaccio closed 2 years ago

jimmybrancaccio commented 3 years ago

I have VS Code v1.60.2 and v1.27.0 of the Wakatime extension. Ever since the 21st (about 2 days ago) the extension has failed to upload heartbeats to my Hakatime instance. I enabled debug mode in Hakatime but that didn't seem to provide any extra logs, and then I enabled debug mode for the extension and I am seeing this:

{
    "caller": "/Users/runner/work/wakatime-cli/wakatime-cli/cmd/legacy/run.go:199",
    "func": "runCmd",
    "level": "error",
    "message": "failed to run command: offline sync failed: api error: invalid response status from \"https://hakatime.mydomain.com/api/v1/users/current/heartbeats.bulk\". got: 200, want: 201/202. body: \"{\\\"responses\\\":[[{\\\"data\\\":{\\\"id\\\":\\\"69994\\\"}},201],[{\\\"data\\\":{\\\"id\\\":\\\"69995\\\"}},201],[{\\\"data\\\":{\\\"id\\\":\\\"69996\\\"}},201],[{\\\"data\\\":{\\\"id\\\":\\\"69997\\\"}},201],[{\\\"data\\\":{\\\"id\\\":\\\"69998\\\"}},201],[{\\\"data\\\":{\\\"id\\\":\\\"69999\\\"}},201],[{\\\"data\\\":{\\\"id\\\":\\\"70000\\\"}},201],[{\\\"data\\\":{\\\"id\\\":\\\"70001\\\"}},201],[{\\\"data\\\":{\\\"id\\\":\\\"70002\\\"}},201],[{\\\"data\\\":{\\\"id\\\":\\\"70003\\\"}},201]]}\"",
    "now": "2021-09-23T16:37:32-05:00",
    "version": "v1.27.0"
}

{
    "caller": "/Users/runner/work/wakatime-cli/wakatime-cli/pkg/api/diagnostic.go:28",
    "func": "SendDiagnostics",
    "level": "debug",
    "message": "sending diagnostic data to api at https://hakatime.mydomain.com/api/v1/plugins/errors",
    "now": "2021-09-23T16:37:32-05:00",
    "version": "v1.27.0"
}

{
    "caller": "/Users/runner/work/wakatime-cli/wakatime-cli/cmd/legacy/run.go:235",
    "func": "sendDiagnostics",
    "level": "error",
    "message": "failed to send diagnostics: invalid response status from \"https://hakatime.mydomain.com/api/v1/plugins/errors\". got: 400, want: 201. body: \"{\\\"error\\\":\\\"MethodNotAllowed\\\",\\\"message\\\":\\\"Ensure that the Content-Type header field is set correctly\\\"}\"",
    "now": "2021-09-23T16:37:32-05:00",
    "version": "v1.27.0"
}

Any ideas on this? It does look like the Wakatime extension was updated very recently, so maybe it's that?

If there's any other information I can provide to help troubleshoot this please let me know!

mujx commented 3 years ago

Yep it seems some recent updates on the VS Code edit had caused some issues. I will address them soon.

I'm not sure if downgrading your plugin is an option until the issue fixed.