Error invoking function if the configured FN_IOFS_DOCKER_PATH is too long
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.
Isn't that a docker limitation rather than Fn?
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?