Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fin Github interaction: API rate limit exceeded #1790

Open
Spurlos opened this issue Aug 14, 2023 · 0 comments
Open

Fin Github interaction: API rate limit exceeded #1790

Spurlos opened this issue Aug 14, 2023 · 0 comments

Comments

@Spurlos
Copy link

Spurlos commented Aug 14, 2023

Description

Running a regular fin update ended up with 403\404 errors. By looking into verbose debug output using FIN_DEBUG=1 I see that request to https://api.github.com/repos/docksal/docksal/releases returns

{
"message": "API rate limit exceeded for xxx.xxx.xxx.xxx. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)",
"documentation_url": "https://docs.github.com/rest/overview/resources-in-the-rest-api#rate-limiting"
}

Subsequent request without a set variable returns 404 for the release URL.

Here is the end of debug log

[STEP 1/4] Updating fin...
+ get_fin_updated
++ get_repo_version_url
+++ get_docksal_version_latest
+++ [[ '' != '' ]]
+++ URL_REPO_RELEASE=https://api.github.com/repos/docksal/docksal/releases
++++ curl -kfsSL https://api.github.com/repos/docksal/docksal/releases
++++ grep tag_name
++++ sed 's/.*"tag_name": "\(.*\)",/\1/'
curl: (22) The requested URL returned error: 403
+++ tags=
+++ wants_rc_version
+++ [[ '' == 1 ]]
+++ [[ '' == \t\r\u\e ]]
++++ echo ''
++++ head -n 1
++++ grep -v rc
+++ echo -n
++ echo https://raw.githubusercontent.com/docksal/docksal/
+ local fin_url=https://raw.githubusercontent.com/docksal/docksal//bin/fin
+ local new_fin
++ curl -kfsSL 'https://raw.githubusercontent.com/docksal/docksal//bin/fin?r=32520'
curl: (22) The requested URL returned error: 404
+ new_fin=
+ if_failed_error 'fin download failed.'
+ '[' '!' 22 -eq 0 ']'
+ echo-error 'fin download failed.'
+ echo -e '\033[0;101;30m ERROR: \033[0m \033[0;91;49mfin download failed.\033[0m'
 ERROR:  fin download failed.
+ shift
+ exit 1

Assume that fin needs to check for 403 and exit with a the message from GitHub at least.
At most if fin would have access to gh executable or some kind of GitHub access token to make an authenticated API call.

I see a scenario where someone in the network can accidentally trip the API limit on github, and whole network won't be able to do fin updates. (Imagine an office full of devs on same network)

Steps to reproduce the issue:

  1. run fin update

Describe the results you received:

[STEP 1/4] Updating fin...
curl: (22) The requested URL returned error: 403
curl: (22) The requested URL returned error: 404
 ERROR:  fin download failed.

Describe the results you expected:

Graceful error reporting

Output of fin config:

fin config output
Seems irrelevant, ping me if necessary

Output of fin sysinfo:

fin sysinfo output

███  DOCKSAL
Docksal version: v1.18.2
fin version:     v1.113.2

███  OS
Linux Ubuntu 23.04
Linux spurlos-21HH0033RT 6.2.0-27-generic #28-Ubuntu SMP PREEMPT_DYNAMIC Wed Jul 12 22:39:51 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

███  ENVIRONMENT
MODE : Linux Kernel
DOCKER_HOST : 

███  DOCKER
Expected client version: 20.10.23
Expected server version: 20.10.23

Installed versions:

Client: Docker Engine - Community
Version:           24.0.5
API version:       1.43
Go version:        go1.20.6
Git commit:        ced0996
Built:             Fri Jul 21 20:35:14 2023
OS/Arch:           linux/amd64
Context:           default

Server: Docker Engine - Community
Engine:
Version:          24.0.5
API version:      1.43 (minimum version 1.12)
Go version:       go1.20.6
Git commit:       a61e2b4
Built:            Fri Jul 21 20:35:14 2023
OS/Arch:          linux/amd64
Experimental:     false
containerd:
Version:          1.6.22
GitCommit:        8165feabfdfe38c65b599c4993d227328c231fca
runc:
Version:          1.1.8
GitCommit:        v1.1.8-0-g82f18fe
docker-init:
Version:          0.19.0
GitCommit:        de40ad0

███  DOCKER COMPOSE
Expected version:  2.15.1
Installed version: 2.15.1

███  DOCKSAL: PROJECTS
project        STATUS                  virtual host                              project root
<REDACTED>

███  DOCKSAL: VIRTUAL HOSTS

███  DOCKSAL: NETWORKING

DOCKSAL_IP: 192.168.64.100
DOCKSAL_HOST_IP: 192.168.64.1
DOCKSAL_VHOST_PROXY_IP: 
DOCKSAL_DNS_IP: 
DOCKSAL_DNS_DISABLED: 0
DOCKSAL_NO_DNS_RESOLVER: 0
DOCKSAL_DNS_UPSTREAM: 
DOCKSAL_DNS_DOMAIN: docksal

███  DOCKSAL: CONNECTIVITY

Host to 192.168.64.100: 	PASS
Container to 192.168.64.100: 	PASS
Container to 192.168.64.1: 	PASS

Checking connectivity to http://dns-test.docksal...
Host: PASS
Containers: PASS

███  DOCKER: RUNNING CONTAINERS
CONTAINER ID   IMAGE                     COMMAND                  CREATED          STATUS                    PORTS                                                    NAMES
bc45330c2d29   docksal/ssh-agent:1.4     "docker-entrypoint.s…"   39 seconds ago   Up 37 seconds (healthy)                                                            docksal-ssh-agent
c1948cfd8ec6   docksal/dns:1.2           "docker-entrypoint.s…"   39 seconds ago   Up 38 seconds (healthy)   192.168.64.100:53->53/udp                                docksal-dns
9e800cc56358   docksal/vhost-proxy:1.8   "docker-entrypoint.s…"   40 seconds ago   Up 39 seconds (healthy)   192.168.64.100:80->80/tcp, 192.168.64.100:443->443/tcp   docksal-vhost-proxy

███  DOCKER: NETWORKS
NETWORK ID     NAME       DRIVER    SCOPE
adce60c4c825   _default   bridge    local
1d4a69f56cf4   bridge     bridge    local
93157890ecc4   host       host      local
a1b9eed55ca7   none       null      local

███  HDD Usage
Filesystem                         Size  Used Avail Use% Mounted on
tmpfs                              3.2G  3.1M  3.1G   1% /run
/dev/mapper/ubuntu--vg-ubuntu--lv  935G  138G  750G  16% /
tmpfs                               16G  460M   16G   3% /dev/shm
tmpfs                              5.0M  8.0K  5.0M   1% /run/lock
/dev/nvme0n1p2                     2.0G  212M  1.6G  12% /boot
/dev/nvme0n1p1                     1.1G  6.1M  1.1G   1% /boot/efi
tmpfs                              3.2G  196K  3.2G   1% /run/user/1000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant