Comments (13)
Our group recently started experiencing this issue when switching from Docker Desktop to Rancher Desktop. The issue we see applies to all FDK languages. We have included a workaround below.
Specifically we see in our logs:
Unable to connect to unix socket /tmp/iofs/lsnr.sock.tmp Error: listen EPERM: operation not permitted /tmp/iofs/lsnr.sock.tmp
Container failed to initialize, please ensure you are using the latest fdk and check the logs
Analysis if using Rancher Desktop
fn start
will run a docker command that binds to volumes inside a users home directory. Binding volumes inside a users home directory works fine in Docker Desktop, but in Rancher Desktop volumes are mounted with the nodev option. This option prevents unix domain sockets from working—something all the FDKs require!
For example, if using the node-fdk with debug logging turned on—you'll see this issue cause an EPERM error here: (https://github.com/fnproject/fdk-node/blob/master/fn-fdk.js#L336).
Workaround for Rancher Desktop:
Instead of using fn start
, try the command below. It does the same thing but binds volumes under /tmp instead of your home directory. This got us unblocked.
docker run --rm -i --name fnserver \
-v /tmp/iofs:/iofs \
-e FN_IOFS_DOCKER_PATH=/tmp/iofs \
-e FN_IOFS_PATH=/iofs \
-v /tmp/data:/app/data \
-v /var/run/docker.sock:/var/run/docker.sock \
--privileged \
-p 8080:8080 \
--entrypoint ./fnserver \
-e FN_LOG_LEVEL=DEBUG fnproject/fnserver:latest
@ceefour @geroe1 @pcross616 @suneelkandali - Are any of you using Rancher Desktop by chance? If so, does this workaround resolve your issue?
Thanks
from fn.
Hi All,
About :
Error invoking function. status: 502 message: Container failed to initialize, please ensure you are using the latest fdk and check the logs
I've faced this problem using my Mac, after 2 hours spend and trying to understand all error logs , I found a config in my docker settings...
so , I've updated file sharing implementation of containers from VirtioFs (default) to osxfs legacy
after what then I'm able to invoke my function correctly.
from fn.
Hi, getting the same error, when doing the tutorial https://fnproject.io/tutorials/JavaFDKIntroduction/
Is there an easy explanation, fix or workaround?
Thanks alot,
Georg
from fn.
I found this log output in the server:
time="2022-08-12T09:58:19Z" level=debug msg="Exception in thread "main" com.fnproject.fn.runtime.exception.FunctionInitializationException: Unable to bind to unix socket in /tmp/iofs/lsnr.sock\n" app_id=01G7C30SYVNG8G00GZJ0000001 container_id=01GA8QV18RNG8G00GZJ000000T fn_id=01G7C753WANG8G00GZJ0000002 image="fndemo/javafn:0.0.11" tag=stderr
time="2022-08-12T09:58:19Z" level=debug msg="\tat com.fnproject.fn.runtime.HTTPStreamCodec.(HTTPStreamCodec.java:174)\n" app_id=01G7C30SYVNG8G00GZJ0000001 container_id=01GA8QV18RNG8G00GZJ000000T fn_id=01G7C753WANG8G00GZJ0000002 image="fndemo/javafn:0.0.11" tag=stderr
time="2022-08-12T09:58:19Z" level=debug msg="\tat com.fnproject.fn.runtime.EntryPoint.main(EntryPoint.java:69)\n" app_id=01G7C30SYVNG8G00GZJ0000001 container_id=01GA8QV18RNG8G00GZJ000000T fn_id=01G7C753WANG8G00GZJ0000002 image="fndemo/javafn:0.0.11" tag=stderr
time="2022-08-12T09:58:19Z" level=debug msg="Caused by: com.fnproject.fn.runtime.ntv.UnixSocketException: Error in bind:Operation not permitted\n" app_id=01G7C30SYVNG8G00GZJ0000001 container_id=01GA8QV18RNG8G00GZJ000000T fn_id=01G7C753WANG8G00GZJ0000002 image="fndemo/javafn:0.0.11" tag=stderr
Obviously, docker (colima) was not started with root user.
So, the fdk version was not the problem...
from fn.
I am getting the same issue on MacOS when using colima or rancher desktop.
the invoked function that is deployed when the fn container spins up doesn't seem to have a valid iofs on the host machine.
I tested with Docker Desktop and this works as expected.
from fn.
from fn.
I am also having same issue, any solution to it?
from fn.
Yup, can confirm the issue is nodev on the container mount volume for iofs. I was able to change it to anything not in my home dir path. I feel like it's a security policy issue with rancher desktop when mounting in the user home. The above docker command works great.
from fn.
The issue was resolved for me after applying above Docker command, ty
from fn.
I have the same issue on my Mac M1 with Docker and a fresh installation of FN. I am following the Node.js tutorial, and when I reach the part "fn invoke nodeapp nodefn," I encounter the error mentioned above. Here is the command to start FN with debug log level:
fn start --log-level DEBUG
¡¡¡ 'fn start' should NOT be used for PRODUCTION !!! see https://github.com/fnproject/fn-helm/
docker: Error response from daemon: Conflict. The container name "/fnserver" is already in use by container "d7ac23b0f59ed43134dd4e09415bcb0ff261cb23127af791b068474d0b6dd965". You have to remove (or rename) that container to be able to reuse that name.
See 'docker run --help'.
from fn.
I'm seeing this exact issue now on my Mac M1 (Ventura 13.2.1).
Docker Desktop version: 4.22.1
FnProject version: 0.6.26
Any workarounds?
from fn.
Error invoking function. status: 502 message: Container failed to initialize, please ensure you are using the latest fdk an
Thank you, @mariobustosjmz, for this workaround. It solved the issue for me.
I'd like to know whether there will be a fix for that issue soon since I did not find a way to change the sharing implementation only for a group of containers.
from fn.
from fn.
Related Issues (20)
- @FnConfiguration not able to run when i'm setting in child class
- No new commits?
- Support for OCI fss
- Fn function times out before the actual timeout HOT 3
- Error on Debian 10: Cannot get the proper memory information to size server.
- Deploy without building
- fn create app myapp errors out with "read: connection reset by peer" HOT 1
- Project Status
- ARM binaries / ARM Docker images HOT 2
- fnserver container has no access to internal cluster network - cannot ping mysql database
- Wrong time zone in fn logs HOT 2
- fn - ERROR - Could not find config file HOT 1
- Is this project DEAD? HOT 6
- External API invocation is failing with 502 error
- Project Discontinuation? HOT 1
- Vulnerability of dependency "golang.org/x/text" HOT 2
- Is there any way to set the go runtime env $GORPOXY?
- How to import a JavaScript file located outside the directory of a function with Node.js?
- error="docker version is too old. Required: 17.10.0-ce Found: 4.8.1" HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fn.