syft: Curl: Could not resolve host: latest

What happened:

  1. Executing installation via curl -sSfL https://raw.githubusercontent.com/anchore/syft/main/install.sh latest

  2. Executed installation via curl -sSfL https://raw.githubusercontent.com/anchore/syft/main/install.sh | sh -s -- -b /usr/local/bin latest

What you expected to happen: Installation of the syft binary to build out.

How to reproduce it (as minimally and precisely as possible): Ran the above commands in #1. Anything else we need to know?:

Environment:

  • Output of syft version:
  • OS (e.g: cat /etc/os-release or similar): Host OS: Linux 5.11.0-41-generic #45-Ubuntu SMP Fri Nov 5 11:37:01 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 16 (8 by maintainers)

Most upvoted comments

I fixed the issue by:

  1. conducted a quick update.
  2. removing curl.
  3. Installing curl version 7.74.0
  4. running the curl line as sudo
  5. Moved syft from /bin/ to /usr/bin/

This is my output for

sudo curl -sSfL https://raw.githubusercontent.com/anchore/grype/main/install.sh | sh -s -x
+ set -e

+ cat /dev/null

+ _logp=6

+ cat /dev/null

+ PROJECT_NAME=grype

+ OWNER=anchore

+ REPO=grype

+ BINARY=grype

+ FORMAT=tar.gz

+ uname_os

+ tr [:upper:] [:lower:]

+ uname -s

+ os=linux

+ echo linux

+ OS=linux

+ uname_arch

+ uname -m

+ arch=x86_64

+ arch=amd64

+ echo amd64

+ ARCH=amd64

+ PREFIX=anchore/grype

+ PLATFORM=linux/amd64

+ GITHUB_DOWNLOAD=https://github.com/anchore/grype/releases/download

+ uname_os_check linux

+ uname_os

+ tr [:upper:] [:lower:]

+ uname -s

+ os=linux

+ echo linux

+ os=linux

+ return 0

+ uname_arch_check amd64

+ uname_arch

+ uname -m

+ arch=x86_64

+ arch=amd64

+ echo amd64

+ arch=amd64

+ return 0

+ parse_args

+ BINDIR=./bin

+ getopts b:dh?x arg

+ shift 0

+ TAG=

+ get_binaries

+ BINARIES=grype

+ tag_to_version

+ [ -z  ]

+ log_info checking GitHub for latest tag

+ log_priority 6

+ test -z 6

+ [ 6 -le 6 ]

+ log_prefix

+ echo anchore/grype

+ log_tag 6

+ echo info

+ echoerr anchore/grype info checking GitHub for latest tag

+ echo anchore/grype info checking GitHub for latest tag

anchore/grype info checking GitHub for latest tag

+ github_release anchore/grype 

+ owner_repo=anchore/grype

+ version=

+ test -z 

+ version=latest

+ giturl=https://github.com/anchore/grype/releases/latest

+ http_copy https://github.com/anchore/grype/releases/latest Accept:application/json

+ mktemp

+ tmp=/tmp/tmp.a1yk1S3vo3

+ http_download /tmp/tmp.a1yk1S3vo3 https://github.com/anchore/grype/releases/latest Accept:application/json

+ log_debug http_download https://github.com/anchore/grype/releases/latest

+ log_priority 7

+ test -z 7

+ [ 7 -le 6 ]

+ return 0

+ is_command curl

+ command -v curl

+ http_download_curl /tmp/tmp.a1yk1S3vo3 https://github.com/anchore/grype/releases/latest Accept:application/json

+ local_file=/tmp/tmp.a1yk1S3vo3

+ source_url=https://github.com/anchore/grype/releases/latest

+ header=Accept:application/json

+ [ -z Accept:application/json ]

+ curl -w %{http_code} -sL -H Accept:application/json -o /tmp/tmp.a1yk1S3vo3 https://github.com/anchore/grype/releases/latest

+ code=200

+ [ 200 != 200 ]

+ return 0

+ return

+ cat /tmp/tmp.a1yk1S3vo3

+ body={"id":55299322,"tag_name":"v0.27.2","update_url":"/anchore/grype/releases/tag/v0.27.2","update_authenticity_token":"rb2H2bovpYqhV8thv3JDurSc9CCa0R6/nVUKH7mf50RGTOYVFnwFX2es6oM3rwJOZ1clZLvCD4JTVPfsY6JLDA==","delete_url":"/anchore/grype/releases/tag/v0.27.2","delete_authenticity_token":"ZTiRWRhy1Rw51pz8Fk+iEuam54DNumtxmLW10YoV69aL6vQiB1UoJ1tSrangWVXXUenftNYXIPwZfnIiaRovVA==","edit_url":"/anchore/grype/releases/edit/v0.27.2"}

+ rm -f /tmp/tmp.a1yk1S3vo3

+ echo {"id":55299322,"tag_name":"v0.27.2","update_url":"/anchore/grype/releases/tag/v0.27.2","update_authenticity_token":"rb2H2bovpYqhV8thv3JDurSc9CCa0R6/nVUKH7mf50RGTOYVFnwFX2es6oM3rwJOZ1clZLvCD4JTVPfsY6JLDA==","delete_url":"/anchore/grype/releases/tag/v0.27.2","delete_authenticity_token":"ZTiRWRhy1Rw51pz8Fk+iEuam54DNumtxmLW10YoV69aL6vQiB1UoJ1tSrangWVXXUenftNYXIPwZfnIiaRovVA==","edit_url":"/anchore/grype/releases/edit/v0.27.2"}

+ json={"id":55299322,"tag_name":"v0.27.2","update_url":"/anchore/grype/releases/tag/v0.27.2","update_authenticity_token":"rb2H2bovpYqhV8thv3JDurSc9CCa0R6/nVUKH7mf50RGTOYVFnwFX2es6oM3rwJOZ1clZLvCD4JTVPfsY6JLDA==","delete_url":"/anchore/grype/releases/tag/v0.27.2","delete_authenticity_token":"ZTiRWRhy1Rw51pz8Fk+iEuam54DNumtxmLW10YoV69aL6vQiB1UoJ1tSrangWVXXUenftNYXIPwZfnIiaRovVA==","edit_url":"/anchore/grype/releases/edit/v0.27.2"}

+ test -z {"id":55299322,"tag_name":"v0.27.2","update_url":"/anchore/grype/releases/tag/v0.27.2","update_authenticity_token":"rb2H2bovpYqhV8thv3JDurSc9CCa0R6/nVUKH7mf50RGTOYVFnwFX2es6oM3rwJOZ1clZLvCD4JTVPfsY6JLDA==","delete_url":"/anchore/grype/releases/tag/v0.27.2","delete_authenticity_token":"ZTiRWRhy1Rw51pz8Fk+iEuam54DNumtxmLW10YoV69aL6vQiB1UoJ1tSrangWVXXUenftNYXIPwZfnIiaRovVA==","edit_url":"/anchore/grype/releases/edit/v0.27.2"}

+ sed s/".*//

+ sed s/.*"tag_name":"//

+ tr -s \n  

+ echo {"id":55299322,"tag_name":"v0.27.2","update_url":"/anchore/grype/releases/tag/v0.27.2","update_authenticity_token":"rb2H2bovpYqhV8thv3JDurSc9CCa0R6/nVUKH7mf50RGTOYVFnwFX2es6oM3rwJOZ1clZLvCD4JTVPfsY6JLDA==","delete_url":"/anchore/grype/releases/tag/v0.27.2","delete_authenticity_token":"ZTiRWRhy1Rw51pz8Fk+iEuam54DNumtxmLW10YoV69aL6vQiB1UoJ1tSrangWVXXUenftNYXIPwZfnIiaRovVA==","edit_url":"/anchore/grype/releases/edit/v0.27.2"}

+ version=v0.27.2

+ test -z v0.27.2

+ echo v0.27.2

+ REALTAG=v0.27.2

+ true

+ test -z v0.27.2

+ TAG=v0.27.2

+ VERSION=0.27.2

+ adjust_format

+ true

+ adjust_os

+ true

+ adjust_arch

+ true

+ log_info found version: 0.27.2 for v0.27.2/linux/amd64

+ log_priority 6

+ test -z 6

+ [ 6 -le 6 ]

+ log_prefix

+ echo anchore/grype

+ log_tag 6

+ echo info

+ echoerr anchore/grype info found version: 0.27.2 for v0.27.2/linux/amd64

+ echo anchore/grype info found version: 0.27.2 for v0.27.2/linux/amd64

anchore/grype info found version: 0.27.2 for v0.27.2/linux/amd64

+ NAME=grype_0.27.2_linux_amd64

+ ARCHIVE=grype_0.27.2_linux_amd64.tar.gz

+ ARCHIVE_URL=https://github.com/anchore/grype/releases/download/v0.27.2/grype_0.27.2_linux_amd64.tar.gz

+ CHECKSUM=grype_0.27.2_checksums.txt

+ CHECKSUM_URL=https://github.com/anchore/grype/releases/download/v0.27.2/grype_0.27.2_checksums.txt

+ execute

+ mktemp -d

+ tmpdir=/tmp/tmp.sGc4fpFdcT

+ log_debug downloading files into /tmp/tmp.sGc4fpFdcT

+ log_priority 7

+ test -z 7

+ [ 7 -le 6 ]

+ return 0

+ http_download /tmp/tmp.sGc4fpFdcT/grype_0.27.2_linux_amd64.tar.gz https://github.com/anchore/grype/releases/download/v0.27.2/grype_0.27.2_linux_amd64.tar.gz

+ log_debug http_download https://github.com/anchore/grype/releases/download/v0.27.2/grype_0.27.2_linux_amd64.tar.gz

+ log_priority 7

+ test -z 7

+ [ 7 -le 6 ]

+ return 0

+ is_command curl

+ command -v curl

+ http_download_curl /tmp/tmp.sGc4fpFdcT/grype_0.27.2_linux_amd64.tar.gz https://github.com/anchore/grype/releases/download/v0.27.2/grype_0.27.2_linux_amd64.tar.gz

+ local_file=/tmp/tmp.sGc4fpFdcT/grype_0.27.2_linux_amd64.tar.gz

+ source_url=https://github.com/anchore/grype/releases/download/v0.27.2/grype_0.27.2_linux_amd64.tar.gz

+ header=

+ [ -z  ]

+ curl -w %{http_code} -sL -o /tmp/tmp.sGc4fpFdcT/grype_0.27.2_linux_amd64.tar.gz https://github.com/anchore/grype/releases/download/v0.27.2/grype_0.27.2_linux_amd64.tar.gz

+ code=200

+ [ 200 != 200 ]

+ return 0

+ return

+ http_download /tmp/tmp.sGc4fpFdcT/grype_0.27.2_checksums.txt https://github.com/anchore/grype/releases/download/v0.27.2/grype_0.27.2_checksums.txt

+ log_debug http_download https://github.com/anchore/grype/releases/download/v0.27.2/grype_0.27.2_checksums.txt

+ log_priority 7

+ test -z 7

+ [ 7 -le 6 ]

+ return 0

+ is_command curl

+ command -v curl

+ http_download_curl /tmp/tmp.sGc4fpFdcT/grype_0.27.2_checksums.txt https://github.com/anchore/grype/releases/download/v0.27.2/grype_0.27.2_checksums.txt

+ local_file=/tmp/tmp.sGc4fpFdcT/grype_0.27.2_checksums.txt

+ source_url=https://github.com/anchore/grype/releases/download/v0.27.2/grype_0.27.2_checksums.txt

+ header=

+ [ -z  ]

+ curl -w %{http_code} -sL -o /tmp/tmp.sGc4fpFdcT/grype_0.27.2_checksums.txt https://github.com/anchore/grype/releases/download/v0.27.2/grype_0.27.2_checksums.txt

+ code=200

+ [ 200 != 200 ]

+ return 0

+ return

+ [ linux != darwin ]

+ hash_sha256_verify /tmp/tmp.sGc4fpFdcT/grype_0.27.2_linux_amd64.tar.gz /tmp/tmp.sGc4fpFdcT/grype_0.27.2_checksums.txt

+ TARGET=/tmp/tmp.sGc4fpFdcT/grype_0.27.2_linux_amd64.tar.gz

+ checksums=/tmp/tmp.sGc4fpFdcT/grype_0.27.2_checksums.txt

+ [ -z /tmp/tmp.sGc4fpFdcT/grype_0.27.2_checksums.txt ]

+ BASENAME=grype_0.27.2_linux_amd64.tar.gz

+ cut -d   -f 1

+ tr \t  

+ grep grype_0.27.2_linux_amd64.tar.gz /tmp/tmp.sGc4fpFdcT/grype_0.27.2_checksums.txt

+ want=a0aaae28792a70fd465301cef0f3dc4bd09c2e707208f7a576e4085c8ea861d4

+ [ -z a0aaae28792a70fd465301cef0f3dc4bd09c2e707208f7a576e4085c8ea861d4 ]

+ hash_sha256 /tmp/tmp.sGc4fpFdcT/grype_0.27.2_linux_amd64.tar.gz

+ TARGET=/tmp/tmp.sGc4fpFdcT/grype_0.27.2_linux_amd64.tar.gz

+ is_command gsha256sum

+ command -v gsha256sum

+ is_command sha256sum

+ command -v sha256sum

+ sha256sum /tmp/tmp.sGc4fpFdcT/grype_0.27.2_linux_amd64.tar.gz

+ hash=a0aaae28792a70fd465301cef0f3dc4bd09c2e707208f7a576e4085c8ea861d4  /tmp/tmp.sGc4fpFdcT/grype_0.27.2_linux_amd64.tar.gz

+ cut -d   -f 1

+ echo a0aaae28792a70fd465301cef0f3dc4bd09c2e707208f7a576e4085c8ea861d4  /tmp/tmp.sGc4fpFdcT/grype_0.27.2_linux_amd64.tar.gz

+ got=a0aaae28792a70fd465301cef0f3dc4bd09c2e707208f7a576e4085c8ea861d4

+ [ a0aaae28792a70fd465301cef0f3dc4bd09c2e707208f7a576e4085c8ea861d4 != a0aaae28792a70fd465301cef0f3dc4bd09c2e707208f7a576e4085c8ea861d4 ]

+ srcdir=/tmp/tmp.sGc4fpFdcT

+ cd /tmp/tmp.sGc4fpFdcT

+ unpack grype_0.27.2_linux_amd64.tar.gz

+ archive=grype_0.27.2_linux_amd64.tar.gz

+ tar --no-same-owner -xzf grype_0.27.2_linux_amd64.tar.gz

+ test ! -d ./bin

+ [ linux = windows ]

+ install /tmp/tmp.sGc4fpFdcT/grype ./bin/

+ log_info installed ./bin/grype

+ log_priority 6

+ test -z 6

+ [ 6 -le 6 ]

+ log_prefix

+ echo anchore/grype

+ log_tag 6

+ echo info

+ echoerr anchore/grype info installed ./bin/grype

+ echo anchore/grype info installed ./bin/grype

anchore/grype info installed ./bin/grype

+ rm -rf /tmp/tmp.sGc4fpFdcT

Thanks for looking into this. Not sure why it is not reproducible at your end.

I’ve tried that command again:

curl -sSfL https://raw.githubusercontent.com/anchore/syft/main/install.sh | sh -s anchore/syft info checking GitHub for latest tag anchore/syft crit unable to find ‘’ - use ‘latest’ or see https://github.com/anchore/syft/releases for details

I also updated my git repo with the latest change to install.sh

~/git/syft (main=) $ git pull remote: Enumerating objects: 3, done. remote: Counting objects: 100% (3/3), done. remote: Compressing objects: 100% (3/3), done. remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0 Unpacking objects: 100% (3/3), 4.55 KiB | 2.28 MiB/s, done. From https://github.com/anchore/syft ecbfbe6…3d8c166 main -> origin/main Updating ecbfbe6…3d8c166 Fast-forward install.sh | 8 ++++±– 1 file changed, 5 insertions(+), 3 deletions(-)

… but I still get the same results:

~/git/syft (main=) $ ./install.sh anchore/syft info checking GitHub for latest tag anchore/syft crit unable to find ‘’ - use ‘latest’ or see https://github.com/anchore/syft/releases for details