dlstreamer / pipeline-server

Home of Intel(R) Deep Learning Streamer Pipeline Server (formerly Video Analytics Serving)
BSD 3-Clause "New" or "Revised" License
126 stars 50 forks source link

Pipeline server fails to start - /lib/python3.8/runpy.py missing #128

Closed mulcas closed 1 year ago

mulcas commented 1 year ago

Trying to run the pipeline server, I am getting the error below:

Traceback (most recent call last):
  File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/pipeline-server/server/__main__.py", line 10, in <module>
    import connexion
  File "/usr/local/lib/python3.8/dist-packages/connexion/__init__.py", line 32, in <module>
    from .apps.flask_app import FlaskApp
  File "/usr/local/lib/python3.8/dist-packages/connexion/apps/flask_app.py", line 151, in <module>
    class FlaskJSONEncoder(json.JSONEncoder):
AttributeError: module 'flask.json' has no attribute 'JSONEncoder'

I am having a similar issue while testing DL Streamer for Object Detection in a different environment, but regarding Python3.10. Is this related to some new Python updates?

akwrobel commented 1 year ago

Hi @mulcas are you using the Pipeline Server container from DockerHub, or are you building this yourself? We do not see this issue when we run the public container: https://hub.docker.com/r/intel/dlstreamer-pipeline-server

Can you please provide more information on your setup? (Are you using the container image? Directly on host? Changing environment setup, etc?

mulcas commented 1 year ago

Hi @akwrobel,

I have found a workaround for this issue.

Sorry for the vague explanation of the problem. I am using Ubuntu (20.04). I am cloning the Pipeline Server (main), and trying to run the Microservices (Container images) from here: https://github.com/dlstreamer/pipeline-server/tree/main/samples/webrtc

After building the images, all Docker Containers can be launch (./run.sh). All (Web Server, Signaling Server, and Grafana), but the pipeline server.

This is the full output:

Found /dev/dri/renderD128 - enabling GPU
Found /dev/bus/usb - enabling for Intel(R) NCS2
Found /dev/snd - enabling microphone

Running Pipeline Server Image: 'dlstreamer-pipeline-server-gstreamer'
   Models: ''
   Pipelines: ''
   Framework: 'gstreamer'
   Environment: '-e GST_VAAPI_DRM_DEVICE=/dev/dri/renderD128 '
   Volume Mounts: '-v /dev/bus/usb:/dev/bus/usb '
   Mode: 'SERVICE'
   Ports: '-p 8080:8080 '
   Name: 'dlstreamer-pipeline-server-gstreamer'
   Network: ''
   Hostname: ''
   Entrypoint: ''
   EntrypointArgs: ''
   User: '--user 1000'
   User Groups: '--group-add 109 --group-add audio --group-add users '
   Devices: '--device /dev/dri/renderD128 --device /dev/snd '
   Device CGroup Rule: '--device-cgroup-rule='c 189:* rmw''

Traceback (most recent call last):
  File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/pipeline-server/server/__main__.py", line 10, in <module>
    import connexion
  File "/usr/local/lib/python3.8/dist-packages/connexion/__init__.py", line 32, in <module>
    from .apps.flask_app import FlaskApp
  File "/usr/local/lib/python3.8/dist-packages/connexion/apps/flask_app.py", line 151, in <module>
    class FlaskJSONEncoder(json.JSONEncoder):
AttributeError: module 'flask.json' has no attribute 'JSONEncoder'

A colleague found a (temporary) solution for this issue: Adding Flask == 2.2.3 to: https://github.com/dlstreamer/pipeline-server/blob/main/requirements.service.txt

I am having the same issue on another server, so I don't think it is related to a specif configuration/environment.

Also, I have built this sample two weeks ago, to demo a Flex Series GPU, and this issue wasn't present.

Thanks, mulcas