NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.29k stars 14.27k forks source link

onedrive client (via services.onedrive) exhausts GitHub API rate limit #344510

Open wamserma opened 1 month ago

wamserma commented 1 month ago

Describe the bug

This is best described via a short backstory (also should help other people searching for this issue): I was wondering why my GitHub API limit was exhausted within a minute or so after resetting and I could no longer nix flake update. A bit of investigation led me to a machine where I still had the onedrive client enabled via services.onedrive.enable = true; but the auth for one user had expired (or been removed). This led to onedrive exiting immediately and the systemd service restarting (restart counter was close to 5000 within a few hours after the machine had booted). Unfortunately onedrive checks for updates at each startup, using the GitHub API...

Steps To Reproduce

Steps to reproduce the behavior:

  1. Set up a NixOS 25.05 machine with services.onedrive.enable = true; configured
  2. Configure onedrive for one user
  3. ensure that the systemd service is running a onedrive client in the context of this user
  4. bork/remove the auth credentials for this user
  5. observe the systemd serivce restarting every few seconds
  6. observe the GitHub API limit being permanently exhausted (e.g. via curl -I https://api.github.com/repos/NixOS/nixpkgs/commits/master)

Expected behavior

Additional context

While creating the PR to nixpkgs is straightforward I don't use onedrive actively and can't spend the time on testing the patch, hence I opted for creating this issue.

Notify maintainers

@AndersonTorres (most recently added to https://github.com/NixOS/nixpkgs/blob/master/pkgs/by-name/on/onedrive/package.nix)

Metadata

NixOS 24.05 (x86-64) last updated ~mid-September 2024 (relevant Nix expressions haven't been touched for ~5 months) Laptop with basic KDE install for office work, no fancy config/overlays/etc.


Add a :+1: reaction to issues you find important.

Artturin commented 1 month ago

Removing the update lines seems to be the best fix.

AkechiShiro commented 1 month ago

Could you PR this fix or a patch ? If not let me know, I'll try to do it on my side