wakatime / visualstudio-wakatime

Visual Studio plugin for automatic time tracking and metrics generated from your programming activity.
https://wakatime.com/visual-studio
BSD 3-Clause "New" or "Revised" License
334 stars 62 forks source link

Waketime visual studio extension can not dowoload waketime-cli #150

Closed Liu-Zhiying closed 1 year ago

Liu-Zhiying commented 1 year ago

I am a China user, recently I installed wakatime plugin in my Visual Studio, but it can't upload time to server, I checked the logs from plugin, it seems that wakatime-cli zip file from GitHub is invalid, I try to using proxy, and download the file manually, but all the try is failed.so what could I do? QQ截图20230813152151

Liu-Zhiying commented 1 year ago

The full log is:

[WakaTime Debug 03:16:30 PM] It will load WakaTime extension
[WakaTime Info 03:16:30 PM] Initializing WakaTime v13.1.0
[WakaTime Debug 03:16:30 PM] A proxy with authentication will be used.
[WakaTime Debug 03:16:31 PM] GitHub API Response Forbidden
[WakaTime Debug 03:16:31 PM] Latest wakatime-cli version from GitHub: 
[WakaTime Debug 03:16:31 PM] Downloading wakatime-cli ...
[WakaTime Debug 03:16:31 PM] A proxy with authentication will be used.
[WakaTime Debug 03:16:31 PM] Finished downloading wakatime-cli 
[WakaTime Debug 03:16:31 PM] Extracting wakatime-cli to: C:\Users\Lzy\.wakatime
[WakaTime HandledException 03:16:31 PM] Error installing dependencies: System.IO.InvalidDataException: 中央目录损坏。 ---> System.IO.IOException: 试图将文件指针移到文件开头之前。

   在 System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   在 System.IO.FileStream.SeekCore(Int64 offset, SeekOrigin origin)
   在 System.IO.FileStream.Seek(Int64 offset, SeekOrigin origin)
   在 System.IO.Compression.ZipArchive.ReadEndOfCentralDirectory()
   --- 内部异常堆栈跟踪的结尾 ---
   在 System.IO.Compression.ZipArchive.ReadEndOfCentralDirectory()
   在 System.IO.Compression.ZipArchive.Init(Stream stream, ZipArchiveMode mode, Boolean leaveOpen)
   在 System.IO.Compression.ZipFile.Open(String archiveFileName, ZipArchiveMode mode, Encoding entryNameEncoding)
   在 WakaTime.Shared.ExtensionUtils.Dependencies.<InstallCli>d__9.MoveNext()
--- 引发异常的上一位置中堆栈跟踪的末尾 ---
   在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   在 WakaTime.Shared.ExtensionUtils.Dependencies.<CheckAndInstallCli>d__8.MoveNext()
--- 引发异常的上一位置中堆栈跟踪的末尾 ---
   在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   在 WakaTime.Shared.ExtensionUtils.Dependencies.<CheckAndInstall>d__7.MoveNext()
--- 引发异常的上一位置中堆栈跟踪的末尾 ---
   在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   在 WakaTime.Shared.ExtensionUtils.WakaTime.<InitializeAsync>d__24.MoveNext()
Liu-Zhiying commented 1 year ago

The settings is:

QQ截图20230813152539

alanhamlett commented 1 year ago

Please don't share your secret api key (waka_ca7c3170-7568-4ce1-a509-8257725f5eba) in screenshots.

alanhamlett commented 1 year ago

Try a different proxy, because it works normally outside China.

Liu-Zhiying commented 1 year ago

Try a different proxy, because it works normally outside China.

It seems not that easy to resolve this problem, my proxy server is in local computer (is my clash application to go out of China, and the proxy port is mixed mode), I can make sure is work properly, unless the format of my proxy address fill in is wrong, the problem should be resolved, but it not, an interesting thing is the newest release of wakatime-cli in GitHub do not have windows version, I think it maybe the plugin download the newest release of wakatime-cli for Windows, but no file is provided. QQ截图20230813183529

Liu-Zhiying commented 1 year ago

And the zip file in my computer is 0KB.

alanhamlett commented 1 year ago

an interesting thing is the newest release of wakatime-cli in GitHub do not have windows version

It's just hidden, you need to click Show all 23 assets link at the bottom of that release.

alanhamlett commented 1 year ago

I think I see your problem: remove @ from your proxy setting

Liu-Zhiying commented 1 year ago

I think I see your problem: remove @ from your proxy setting

it's fine, thinks

Liu-Zhiying commented 1 year ago

thanks

alanhamlett commented 1 year ago

Glad it's working now :)