wakatime/wakatime-cli

NixOS is recongnized as Unknown OS

Closed this issue · 5 comments

Expected behavior (what should have happened):

Actual behavior (what went wrong):

Screenshot from 2023-05-24 00-35-27

Environment:

  • OS: linux (NixOS)
  • Platform: x86_64

Logs:

{"caller":"cmd/heartbeat/heartbeat.go:140","file":"/run/user/1000/firenvim/github.com_wakatime-wakatime-cli-issues-new_TEXTAREA-id-issue-body_2023-05-23T16-35-07-898Z.txt","func":"heartbeat.SendHeartbeats","level":"warning","message":"Too many recent heartbeats.","now":"2023-05-24T00:35:10+08:00","os/arch":"unset/unset","plugin":"vim/801 neovim-wakatime/10.0.0","time":1684859708,"version":"1.73.0"}

Maybe this is the bug of NixOS. (about uname?) I'll report to them NixOS/nixpkgs#233647

@Freed-Wu paste the output for ~/.wakatime/wakatime-cli-linux-amd64 --user-agent (or the correct binary for your installation)

$ wakatime-cli --user-agent
wakatime/1.73.0 (linux-6.3.3-unknown) go1.20.4 Unknown/0

In your log the os/arch is unknown:

"os/arch":"unset/unset"

We use uname to detect the OS so it's probably related to that Nix issue:

err := syscall.Uname(&buf)

This problem seems to disappear. Thanks!