Skip to content
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

Sock Bind error in Apache Functions Python in local #7999

Open
jmalbarran opened this issue Dec 23, 2024 · 0 comments
Open

Sock Bind error in Apache Functions Python in local #7999

jmalbarran opened this issue Dec 23, 2024 · 0 comments
Labels
kind/bug Something isn't working

Comments

@jmalbarran
Copy link

Actual Behavior

I'm testing Apache Functions and I'm trying to test my function locally

For this, I have started the local server with

fn start --log-level DEBUG --port 8080

and I'm trying to create, deploy and invoke a test function with

fn use context default
fn update context registry mylocalregistry

fn -v init --runtime python fn-local

cd fn-local

fn -v deploy --create-app --app app-local --local
fn invoke app-local fn-local

Result

The invocation (last line) fails with Error invoking function. status: 502 message: Container failed to initialize, please ensure you are using the latest fdk and check the logs

In the server logs I see that the problem is a python socket creation

...
time="2024-12-21T19:48:40Z" level=debug msg="  File \"/python/fdk/__init__.py\", line 62, in start\n" app_id=01JFN9NJFZNG8G00GZJ0000001 container_id=01JFNC7J7ZNG8G00GZJ0000003 fn_id=01JFNC6GG1NG8G00GZJ0000001 image="mylocalregistry/fn-local:0.0.2" tag=stderr
time="2024-12-21T19:48:40Z" level=debug msg="    sock.bind(phony_socket_path)\n" app_id=01JFN9NJFZNG8G00GZJ0000001 container_id=01JFNC7J7ZNG8G00GZJ0000003 fn_id=01JFNC6GG1NG8G00GZJ0000001 image="mylocalregistry/fn-local:0.0.2" tag=stderr
time="2024-12-21T19:48:40Z" level=debug msg="PermissionError: [Errno 1] Operation not permitted\n" app_id=01JFN9NJFZNG8G00GZJ0000001 container_id=01JFNC7J7ZNG8G00GZJ0000003 fn_id=01JFNC6GG1NG8G00GZJ0000001 image="mylocalregistry/fn-local:0.0.2" tag=stderr
time="2024-12-21T19:48:40Z" level=info msg="hot function terminated" app_id=01JFN9NJFZNG8G00GZJ0000001 container_id=01JFNC7J7ZNG8G00GZJ0000003 cpus= error="container exit code 1" fn_id=01JFNC6GG1NG8G00GZJ0000001 idle_timeout=30 image="mylocalregistry/fn-local:0.0.2" memory=256

...

Steps to Reproduce

Install fn function with

brew install fn

I have started the local server with

fn start --log-level DEBUG --port 8080

and I'm trying to create, deploy and invoke a test function with

fn use context default
fn update context registry mylocalregistry

fn -v init --runtime python fn-local

cd fn-local

fn -v deploy --create-app --app app-local --local
fn invoke app-local fn-local

Result

...
time="2024-12-21T19:48:40Z" level=debug msg=" File "/python/fdk/init.py", line 62, in start\n" app_id=01JFN9NJFZNG8G00GZJ0000001 container_id=01JFNC7J7ZNG8G00GZJ0000003 fn_id=01JFNC6GG1NG8G00GZJ0000001 image="mylocalregistry/fn-local:0.0.2" tag=stderr
time="2024-12-21T19:48:40Z" level=debug msg=" sock.bind(phony_socket_path)\n" app_id=01JFN9NJFZNG8G00GZJ0000001 container_id=01JFNC7J7ZNG8G00GZJ0000003 fn_id=01JFNC6GG1NG8G00GZJ0000001 image="mylocalregistry/fn-local:0.0.2" tag=stderr
time="2024-12-21T19:48:40Z" level=debug msg="PermissionError: [Errno 1] Operation not permitted\n" app_id=01JFN9NJFZNG8G00GZJ0000001 container_id=01JFNC7J7ZNG8G00GZJ0000003 fn_id=01JFNC6GG1NG8G00GZJ0000001 image="mylocalregistry/fn-local:0.0.2" tag=stderr
time="2024-12-21T19:48:40Z" level=info msg="hot function terminated" app_id=01JFN9NJFZNG8G00GZJ0000001 container_id=01JFNC7J7ZNG8G00GZJ0000003 cpus= error="container exit code 1" fn_id=01JFNC6GG1NG8G00GZJ0000001 idle_timeout=30 image="mylocalregistry/fn-local:0.0.2" memory=256

...

Expected Behavior

Function invoked successfully

Additional Information

.

Rancher Desktop Version

1.16.0

Rancher Desktop K8s Version

N/A

Which container engine are you using?

moby (docker cli)

What operating system are you using?

macOS

Operating System / Build Version

MacOS Sequoia 15.1.1 (24B91)

What CPU architecture are you using?

x64

Linux only: what package format did you use to install Rancher Desktop?

None

Windows User Only

No response

@jmalbarran jmalbarran added the kind/bug Something isn't working label Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant