Get.graph.io fails due to Github API rate limiting


Report a Dgraph Bug

It seems that after a user installs dgraph 6-9 times, the installer script get.graph.io will fail due to GitHub API rate limiting used by the check_versions()

This will come up for users that use systemd for installation. Provisioning a 6 node cluster will run into this issue, and the outbound IP address will be the same and get blocked by rate limiting.

What version of Dgraph are you using?

n/a as this is the installer script on 2020-8-9 at 9:20 PST

Have you tried reproducing the issue with the latest release?

n/a as this is the installer script on 2020-8-9 at 9:20 PST

What is the hardware spec (RAM, OS)?

Cent OS

Steps to reproduce the issue (command/config used to run Dgraph).

I have automation that from root, does this command:

DGRAPH_VERSION="v20.07.0"
curl -sSf https://get.dgraph.io | ACCEPT_LICENSE="y" VERSION="$DGRAPH_VERSION" bash

Expected behaviour and actual result.

The actual behavior is:

    zero2: Dgraph Community License terms accepted with -y/--accept-license option.
    zero2: This version doesn't exist or it is a typo (Tip: You need to add "v" eg: v2.0.0-rc1)
    zero2: There was some problem while installing Dgraph. Please share the output of this script with us on https://dgraph.slack.com or http://discuss.dgraph.io so that we can resolve the issue for you.

In looking around the code for this area, found the following line:

	check_versions(){
		toCompare="$(curl -s https://api.github.com/repos/dgraph-io/dgraph/releases/tags/${release_version} | grep "tag_name" | awk '{print $2}' | tr -dc '[:alnum:]-.\n\r' | head -n1 )"
			if [ "$release_version" == "$toCompare" ]; then
			    continue
				else
				print_error "This version doesn't exist or it is a typo (Tip: You need to add \"v\" eg: v2.0.0-rc1)"
				exit 1
			fi
	}

I tried this locally and was getting back and empty string from the $toCompare, so I tried the curl command:

curl -s https://api.github.com/repos/dgraph-io/dgraph/releases/tags/v20.07.0

and got this:

{"message":"API rate limit exceeded for 135.180.134.207. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)","documentation_url":"https://developer.github.com/v3/#rate-limiting"}
1 Like

The PR
https://github.com/dgraph-io/Install-Dgraph/pull/18

Is merged, should be fine now.

1 Like