Azure / setup-kubectl

GitHub Action for installing Kubectl
MIT License
132 stars 49 forks source link

Bug: running amd64 kubectl on runners returns 'cannot execute binary file: Exec format error' #89

Closed nathanjulsrud closed 1 year ago

nathanjulsrud commented 1 year ago

What happened?

Additionally when leveraging the action 'azure/setup-kubectl@v3'

Error: Error: Kubectl 'v1.28.3' for 'amd64' arch not found.

Version

Runner

ubuntu-latest

Relevant log output


  with:
    version: latest
  env:
    VERSION: 
    CUSTOMER: thunderdome
    TENANT: test
    COMPONENT_OVERRIDES: ""
    EXCLUSIVE_COMPONENTS: stopevents-gql-api,stopevents-3pi-in-tripevents-to-notifications-con,stopevents-3pi-in-tripevents-to-stopevents-con,stopevents-3pi-out-trackrequests-from-stopevents-con,stopevents-3pi-out-tripevents-from-stopevents-con,stopevents-load-route-vendors-v1-con,stopevents-load-routes-stops-v1-con,stopevents-load-routes-stops-v[2](https://github.com/masterysystems/mastermind-release/actions/runs/6565412886/job/17833883230#step:3:2)-con,stopevents-aggregation-con,stopevents-current-stop-aggregation-con,stopevents-stopex-events-subscription-api-con,stopevents-current-and-next-stop-consumer,stopevents-from-driver-assignments,stopevents-load-routes-v2-con,stopevents-trailer-exception
    ROBOTSLACK_NOTIFICATIONS: Success&Failures
    FIX_OPERATION_IN_PROGRESS: 
    FIX_CANNOT_PATCH: 
    KONDUCTOR_HOME: .
    KUBECONFIG: /home/runner/work/_temp/kubeconfig_16464116[3](https://github.com/masterysystems/mastermind-release/actions/runs/6565412886/job/17833883230#step:3:3)7[4](https://github.com/masterysystems/mastermind-release/actions/runs/6565412886/job/17833883230#step:3:4)[6](https://github.com/masterysystems/mastermind-release/actions/runs/6565412886/job/17833883230#step:3:6)3
    E2EFLAG: 
    RUN_TESTS:  
Error: Error: Kubectl 'v1.2[8](https://github.com/masterysystems/mastermind-release/actions/runs/6565412886/job/17833883230#step:3:8).3' for 'amd64' arch not found.```

When trying the workout 

name: test-kubectl
run-name: test-kubectl
on:
  workflow_dispatch:

jobs:
  test-kubectl:
    name: test-kubectl
    runs-on: ubuntu-latest
    steps:
      - run: |
          lscpu
          curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.28.2/bin/darwin/amd64/kubectl
          sudo mv ./kubectl /usr/local/bin/kubectl
          sudo chmod +x /usr/local/bin/kubectl
          which kubectl
          kubectl

error 

Run lscpu
  lscpu
  curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.[2](https://github.com/masterysystems/mastermind-release/actions/runs/6565473319/job/17834071172#step:2:2)8.2/bin/darwin/amd64/kubectl
  sudo mv ./kubectl /usr/local/bin/kubectl
  sudo chmod +x /usr/local/bin/kubectl
  which kubectl
  kubectl
  shell: /usr/bin/bash -e {0}
Architecture:                       x86_64
CPU op-mode(s):                     [3](https://github.com/masterysystems/mastermind-release/actions/runs/6565473319/job/17834071172#step:2:3)2-bit, 6[4](https://github.com/masterysystems/mastermind-release/actions/runs/6565473319/job/17834071172#step:2:4)-bit
Address sizes:                      46 bits physical, 48 bits virtual
Byte Order:                         Little Endian
CPU(s):                             2
On-line CPU(s) list:                0,1
Vendor ID:                          GenuineIntel
Model name:                         Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz
CPU family:                         6
Model:                              8[5](https://github.com/masterysystems/mastermind-release/actions/runs/6565473319/job/17834071172#step:2:5)
Thread(s) per core:                 1
Core(s) per socket:                 2
Socket(s):                          1
Stepping:                           7
BogoMIPS:                           5187.81
Flags:                              fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse3[6](https://github.com/masterysystems/mastermind-release/actions/runs/6565473319/job/17834071172#step:2:6) clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology cpuid pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single pti fsgsbase bmi1 hle avx2 smep bmi2 erms invpcid rtm avx512f avx512dq rdseed adx smap clflushopt avx512cd avx512bw avx512vl xsaveopt xsavec xsaves md_clear
Hypervisor vendor:                  Microsoft
Virtualization type:                full
L1d cache:                          64 KiB (2 instances)
L1i cache:                          64 KiB (2 instances)
L2 cache:                           2 MiB (2 instances)
L3 cache:                           35.8 MiB (1 instance)
NUMA node(s):                       1
NUMA node0 CPU(s):                  0,1
Vulnerability Gather data sampling: Unknown: Dependent on hypervisor status
Vulnerability Itlb multihit:        KVM: Mitigation: VMX unsupported
Vulnerability L1tf:                 Mitigation; PTE Inversion
Vulnerability Mds:                  Mitigation; Clear CPU buffers; SMT Host state unknown
Vulnerability Meltdown:             Mitigation; PTI
Vulnerability Mmio stale data:      Vulnerable: Clear CPU buffers attempted, no microcode; SMT Host state unknown
Vulnerability Retbleed:             Vulnerable
Vulnerability Spec rstack overflow: Not affected
Vulnerability Spec store bypass:    Vulnerable
Vulnerability Spectre v1:           Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:           Mitigation; Retpolines, STIBP disabled, RSB filling, PBRSB-eIBRS Not affected
Vulnerability Srbds:                Not affected
Vulnerability Tsx async abort:      Mitigation; Clear CPU buffers; SMT Host state unknown
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
 54 53.3M   54 29.2M    0     0  50.5M      0  0:00:01 --:--:--  0:00:01 50.5M
100 53.3M  100 53.3M    0     0  62.8M      0 --:--:-- --:--:-- --:--:-- 62.8M
/usr/local/bin/kubectl
/home/runner/work/_temp/3a940518-e3ea-45f0-b105-23260ec3c[7](https://github.com/masterysystems/mastermind-release/actions/runs/6565473319/job/17834071172#step:2:7)20.sh: line 6: /usr/local/bin/kubectl: cannot execute binary file: Exec format error
Error: Process completed with exit code [12](https://github.com/masterysystems/mastermind-release/actions/runs/6565473319/job/17834071172#step:2:13)6.
nathanjulsrud commented 1 year ago

Update: when using the 'azure/setup-kubectl@v3' the issue becomes sporadic which suggests configuration drift on the runners.

paul-danilin-moia commented 1 year ago

Hello @nathanjulsrud, I am facing the same error since this morning in my pipelines. Restart helps sometimes. Can the issue be reopened?