openziti / ziti

The parent project for OpenZiti. Here you will find the executables for a fully zero trust, application embedded, programmable network @OpenZiti
https://openziti.io
Apache License 2.0
2.69k stars 153 forks source link

Arch detection error on expressInstall #823

Closed mrbluecoat closed 2 years ago

mrbluecoat commented 2 years ago

I ran source /dev/stdin <<< "$(wget -qO- https://raw.githubusercontent.com/openziti/ziti/release-next/quickstart/docker/image/ziti-cli-functions.sh)"; expressInstall as directed by the quickstart doc but it gave this error:

ziti-bin/ziti-v0.26.5/ziti-controller: cannot execute binary file: Exec format error

I checked with file ziti-controller and it said ELF 64-bit LSB executable, x86-64

However, my uname -m is aarch64

I believe your ziti-cli-functions.sh needs to change from

  elif [[ "$(uname -a)" == *"arm"* ]]; then
    ZITI_ARCH="arm"
  fi

to

  elif [[ "$(uname -a)" == *"arm"* ]]; then
    ZITI_ARCH="arm"
  elif [[ "$(uname -a)" == *"aarch64"* ]]; then
    ZITI_ARCH="arm64"
  fi

P.S. you may also want to switch from uname -a to uname -m for a more direct arch string comparison

mrbluecoat commented 2 years ago

quick workaround until fixed in production:

curl -sLo /tmp/ziti.sh https://raw.githubusercontent.com/openziti/ziti/release-next/quickstart/docker/image/ziti-cli-functions.sh
sed -i 's/ZITI_ARCH="amd64"/ZITI_ARCH="arm64"/' /tmp/ziti.sh
source /dev/stdin <<< "$(cat /tmp/ziti.sh)"; expressInstall
dovholuknf commented 2 years ago

@gberl002 I thought we had this sorted?

@mrbluecoat what OS are you running? MacOS? or are you running on a raspberry pi or other?

mrbluecoat commented 2 years ago

Running Debian on an Orange Pi R1 Plus

gberl002 commented 2 years ago

@mrbluecoat Thanks for reporting this, it appears we have not run into a case where we've used ziti on aarch64. We don't easily have access to a Pi at the moment so would you mind pulling this branch and testing it to let us know if this works in your environment?

PR: https://github.com/openziti/ziti/pull/824 Branch: https://github.com/openziti/ziti/tree/issue823-expressinstall-aarch64

dovholuknf commented 2 years ago

it's easier than pulling the branch... you can just run the source directly:

source /dev/stdin <<< "$(wget -qO- https://raw.githubusercontent.com/openziti/ziti/issue823-expressinstall-aarch64/quickstart/docker/image/ziti-cli-functions.sh)"; expressInstall

that's a link right to the 'raw' form of that branch. @mrbluecoat if that works - would you let us know and we'll merge it back?

mrbluecoat commented 2 years ago

Sorry, no luck:

******** Setting Up Environment ********
using default ZITI_HOME: /root/.ziti/quickstart/orangepir1plus
ZITI HOME SET TO: /root/.ziti/quickstart/orangepir1plus
ZITI_BINARIES_VERSION: v0.26.5
Downloading https://github.com/openziti/ziti/releases/download/v0.26.5/ziti-linux-amd64-0.26.5.tar.gz to /root/.ziti/quickstart/orangepir1plus/ziti-bin/ziti-linux-amd64-0.26.5.tar.gz                                                                                                  
UNZIPPING /root/.ziti/quickstart/orangepir1plus/ziti-bin/ziti-linux-amd64-0.26.5.tar.gz into: /root/.ziti/quickstart/orangepir1plus/ziti-bin/ziti-v0.26.5
...

Looks like you updated verifyZitiVersionExists but forgot to update getLatestZitiVersion: https://www.diffchecker.com/cUlyhULB

gberl002 commented 2 years ago

@mrbluecoat Sorry about that, perfect case for The Pragmatic Programmer DRY development principle.

Would you kindly try again? I appreciate your assistance with this.

mrbluecoat commented 2 years ago

That worked, thanks

gberl002 commented 2 years ago

Thanks again @mrbluecoat, this has been merged. Closing the issue

https://github.com/openziti/ziti/pull/824