knative / client

Knative developer experience, docs, reference Knative CLI implementation
Apache License 2.0
353 stars 261 forks source link

Error: fork/exec /usr/local/bin/kn-func: exec format error #1938

Closed lv10 closed 7 months ago

lv10 commented 7 months ago

Bug report

After successfully installing kn and func. I can't run kn func. I get Error: fork/exec /usr/local/bin/kn-func: exec format error. I have installed different versions of the two 2 tools, with no luck.

I attempt installing kn using the binary I get: /usr/local/bin/kn: line 1: syntax error: unexpected "(". I'm attempting to install this in a Docker container so that I can run the docker container in a pipeline and do the pushing of a function within the pipeline.

Expected behavior

Install both tools and be able to use kn func to build and deploy the the function I created.

Steps to reproduce the problem

Run the following dockerfile:

FROM alpine:latest

RUN apk add --no-cache git make libc6-compat bash

# Install kn CLI
RUN wget https://github.com/knative/client/releases/download/knative-v1.11.0/kn-linux-amd64 -o kn \
    && chmod +x kn \
    && mv kn /usr/local/bin \
    && kn version

# Install `kn func`
RUN wget https://github.com/knative/func/releases/download/knative-v1.13.1/func_linux_amd64 -o kn-func \
    && chmod +x kn-func \
    && mv kn-func /usr/local/bin

kn version



### Knative (serving/eventing) version

<!-- Remove all except the known affected versions of Knative running on the cluster on which you have detected the issue -->

> Nightly
> 0.12.x
> 0.11.x
> 0.10.x
> 0.9.x
lv10 commented 7 months ago

Issue was resolved. I was using -o which points to logs for wget instead -O which sets the output file. I wasn't able to see the stack trace for the error which caused me to believe there was a bug. Since the error: Error: fork/exec /usr/local/bin/kn-func: exec format error usually means that there's a architecture mismatch.