-
Notifications
You must be signed in to change notification settings - Fork 405
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[fnserver] fn invoke myapp hello
on Windows: Error invoking function. status: 502 message: Container failed to initialize
#1577
Comments
fn invoke myapp hello
on Windows: Error invoking function. status: 502 message: Container failed to initializefn invoke myapp hello
on Windows: Error invoking function. status: 502 message: Container failed to initialize
Hi, getting the same error, when doing the tutorial https://fnproject.io/tutorials/JavaFDKIntroduction/ |
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 Obviously, docker (colima) was not started with root user. So, the fdk version was not the problem... |
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. |
您好,您的邮件已收到,谢谢。——熊宇飞
|
I am also having same issue, any solution to it? |
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:
Analysis if using Rancher Desktop
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 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 |
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. |
The issue was resolved for me after applying above Docker command, ty |
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:
|
I'm seeing this exact issue now on my Mac M1 (Ventura 13.2.1). Docker Desktop version: 4.22.1 Any workarounds? |
Thank you, @mariobustosjmz, for this workaround. It solved the issue for me. |
您好,您的邮件已收到,谢谢。——熊宇飞
|
@mariobustosjmz You're my hero. I'm really curious how you pinpointed that setting as the problem. In any event thanks that seems to have done the trick (for now) In my case the tutorial from the docs would throw
If this can help anyone in the future. |
您好,您的邮件已收到,谢谢。——熊宇飞
|
I'm now getting a different message: Fn not cound. |
您好,您的邮件已收到,谢谢。——熊宇飞
|
Description
fn invoke myapp hello
failed with:Error invoking function. status: 502 message: Container failed to initialize, please ensure you are using the latest fdk and check the logs
Steps to reproduce the issue:
Describe the results you received:
Logs:
Describe the results you expected:
hello
function executed.Additional information you deem important (e.g. issue happens only occasionally):
Always reproducible. Also reproducible with go:
Logs:
Output of
fn version
(CLI command):Additional environment details (OSX, Linux, flags, etc.):
Windows 10 Pro.
The text was updated successfully, but these errors were encountered: