docs icon indicating copy to clipboard operation
docs copied to clipboard

Error invoking function if the configured FN_IOFS_DOCKER_PATH is too long

Open ArtunSubasi opened this issue 6 years ago • 2 comments

I was receiving the following error while invoking a function via CLI fn invoke: "Error invoking function. status: 502 message: container failed to initialize, please ensure you are using the latest fdk / format and check the logs".

I turns out, it was because of the length of the path specified in the env variable FN_IOFS_DOCKER_PATH. Everything under 74 chars is ok, paths with 75 or more chars do not work.

I'm using a mac, building and running with docker. To reproduce:

docker run -p 8080:8080 \
           -e FN_IOFS_DOCKER_PATH=/aVeryLongPathWithMoreThan74Chars/LongLongLongLongLongLongLongLongLongLongLong \
           -e FN_IOFS_PATH=/iofs \
           -v $PWD/fn/data:/app/data \
           -v /aVeryLongPathWithMoreThan74Chars/LongLongLongLongLongLongLongLongLongLongLong:/iofs \
           -v /var/run/docker.sock:/var/run/docker.sock fnproject/fnserver:0.3.668

Deploying a function and running it using the CLI:

fn invoke app function

Error message:

Error invoking function. status: 502 message: container failed to initialize, please ensure you are using the latest fdk / format and check the logs

The logs contain just the same information.

Client version is latest version: 0.5.59 Server version: 0.3.668

Although I solved my problem by using a shorter path, I wanted to inform you about the issue. You may want to add a validation, better logging or documentation.

ArtunSubasi avatar Mar 03 '19 19:03 ArtunSubasi

Isn't that a docker limitation rather than Fn?

denismakogon avatar Mar 05 '19 22:03 denismakogon

Honestly, I don't know. I don't understand why the path on the host machine matters, since my Mac Majove supports up to 1016 characters in paths. The mounted path within the docker image is always /iofs

What is IOFS anyway? Is there a documentation about IOFS and how it should be configured?

ArtunSubasi avatar Mar 06 '19 08:03 ArtunSubasi