nuclio icon indicating copy to clipboard operation
nuclio copied to clipboard

[Bug]: Nuclio invoke fails for cvat examples behind proxy on already running container

Open dnns92 opened this issue 2 years ago • 1 comments

Nuclio Version checks

  • [X] I have checked that this issue has not already been reported.

  • [X] I have confirmed this bug exists on the latest version of Nuclio.

Issue Description

Dear Community, I cannot get my nuclio functions to run on a freshly pulled openvino example. The nuclio dashboard sais the function is "running", but I can't run nulcio invoke to test it. It's just the serverless function of cvat. I followed this tutorial: https://opencv.github.io/cvat/docs/administration/advanced/installation_automatic_annotation/

Note that this is NOT a CVAT issue, but a nuclio issue.

I use CVAT v2.1 and this compose file

version: '3.3'
services:
  nuclio:
    container_name: nuclio
    build:
      context: "components/serverless/"
    restart: always
    networks:
      - cvat
    volumes:
      - /tmp:/tmp
      - /run/user/${UID}/docker.sock:/var/run/docker.sock:ro
    environment:
      http_proxy:
      https_proxy:
      no_proxy: 172.28.0.1,${no_proxy}
      NUCLIO_CHECK_FUNCTION_CONTAINERS_HEALTHINESS: 'true'
      NUCLIO_DASHBOARD_DEFAULT_FUNCTION_MOUNT_MODE: 'volume'
    ports:
      - '8070:8070'
    logging:
      driver: "json-file"
      options:
        max-size: 100m
        max-file: "3"

  cvat_server:
    environment:
      CVAT_SERVERLESS: 1
    extra_hosts:
      - "host.docker.internal:host-gateway"

  cvat_worker_low:
    extra_hosts:
      - "host.docker.internal:host-gateway"

The corresponding Dockerfile is very basic

FROM quay.io/nuclio/dashboard:1.8.14-amd64
USER root

ARG http_proxy
ARG https_proxy

ENV http_proxy=${http_proxy}
ENV https_proxy=${https_proxy}
ENV no_proxy=${no_proxy}
ENV HTTP_PROXY=${http_proxy}
ENV HTTPS_PROXY=${https_proxy}

wget <my certificate> -O <outputpath>
RUN chmod 644 /usr/local/share/ca-certificates/* && update-ca-certificates

This is my test function

image=$(curl https://upload.wikimedia.org/wikipedia/en/7/7d/Lenna_%28test_image%29.png --output - | base64 | tr -d '\n')
cat << EOF > /tmp/input.json
{"image": "$image"}
EOF
cat /tmp/input.json | nuctl invoke openvino-omz-public-yolo-v3-tf -c 'application/json

This is the upcoming error

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  462k  100  462k    0     0  2172k      0 --:--:-- --:--:-- --:--:-- 2162k
22.11.30 15:23:42.972    nuctl.platform.invoker (I) Executing function {"method": "POST", "url": "http://:49154", "bodyLength": 631790, "headers": {"Content-Type":["application/json"],"X-Nuclio-Log-Level":["info"],"X-Nuclio-Target":["openvino-omz-public-yolo-v3-tf"]}}

Error - Post "http://:49154": write tcp 10.98.19.19:48578->165.215.64.34:9480: write: connection reset by peer
    /nuclio/pkg/platform/abstract/invoker.go:103

Call stack:
Failed to send HTTP request
    /nuclio/pkg/platform/abstract/invoker.go:103
Failed to invoke function
    /nuclio/pkg/nuctl/command/invoke.go:132

Expected Behavior

That it's not throwing an error ;)

Deployment Method

Docker

Nuclio Version

1.8.14

Additional Information

OS Version:

  • Ubuntu 20.04
  • Docker version 20.10.21
  • docker-compose version 1.29.2, build 5becea4c

dnns92 avatar Nov 30 '22 14:11 dnns92

Hi @dnns92 ! Can you make sure your nuclio function is running properly before invoking it (docker ps and docker logs on the function's container)?

Also, I noticed you're using an older version of Nuclio. Try using the latest version (see releases page) and see if the error persists. Note that for later versions you will need to remove this line from the volumes in your compose file:

- /tmp:/tmp

TomerShor avatar Dec 06 '22 16:12 TomerShor