Skip to content

Sock Bind error in with Python in local - Mac with Rancher #1610

@jmalbarran

Description

@jmalbarran

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

But 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

...

I have already tried to run the starting with root sudo fn start with no change

I'm using Mac Sequioa with Rancher

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions