Skip to content

bodyFound is undefined error on Docker on ubuntu server VM #33

Description

@kamms

Hi!
I'm trying to get this running on a brand new ubuntu server virtual machine. I've managed to solve some errors that I run into (didn't document that unfortunately), but I can't figure out a way around this one. Am I doing something dumb to produce this error somehow?

Full error message:

bodyFound is undefined ./src/VideoFeed.tsx/VideoFeed/</intervalId<@http://192.168.1.93/static/js/bundle.js:1616:20

image

Things I've done so far:

  • docker exec bash in the container for cd webapp && yarn install

    • This fixed an earlier error
  • Changes in main.py:

    • Disabled the "Bounds not set...." printout
    • Added cv2.imwrite to line 1010 to check that the camera is available and script can fetch images.
      • This results in a continuously updated jpeg that I can check and verify that the camera is working (it is).
  • in webapp/package.json as per previous issue

    • added to devDependencies:
      "@babel/plugin-proposal-private-property-in-object": "^7.16.0"
    • changed "start": "react-scripts start&", to "start": "react-scripts start",
  • Modified start_docker.sh:

    #!/bin/bash
    yarn --cwd webapp start &
    python3 main.py
    

I guess I could have skipped the start& -> start modification and not changed the start_docker.sh file at all, but I reached the point of just throwing everything at the problem.

docker-compose.yml:

services:
  baby-sleep-coach:
    build:
      dockerfile: ./Dockerfile
      context: .
    ports:
      - "0.0.0.0:${PORT}:80"
      - "0.0.0.0:8000:8000"
      - "0.0.0.0:8001:8001"
    env_file:
      - .env
    volumes:
      - type: bind
        source: /home/kamms/babysleepcoach
        target: "${APP_DIR}"

.env:

CAM_URL=rtsp://user:pw@192.168.1.9:554/h264Preview_01_sub # full url of the baby camera
APP_DIR=/usr/app/babysleepcoach # location of app root, primarily used for docker
DEBUG=False
OWL=False # lol
VIDEO_PATH=/usr/app/babysleepcoach # for debugging & testing
#HATCH_IP=192.168.HATCH.IP # optional
REACT_APP_BACKEND_IP=192.168.1.93:8001#.0.206:8001 # ip of flask server. This is the ip of "this" machine running the system
REACT_APP_RESOURCE_SERVER_IP=192.168.1.93:8000#0.206:8000 # ip of resource server (TODO: align to 1 server). This is the ip of "this" machine running the system
PORT=80 # port web app serves assets from

Docker logs:

babysleepcoach-baby-sleep-coach-1  | yarn run v1.22.19
babysleepcoach-baby-sleep-coach-1  | $ react-scripts start
babysleepcoach-baby-sleep-coach-1  | WARNING: No module named 'pexpect'
babysleepcoach-baby-sleep-coach-1  | reading focusRegionArr:  ['']
babysleepcoach-baby-sleep-coach-1  | Initializing...
babysleepcoach-baby-sleep-coach-1  | 
babysleepcoach-baby-sleep-coach-1  | Initialization complete.
babysleepcoach-baby-sleep-coach-1  | Start receiving frames.
babysleepcoach-baby-sleep-coach-1  | Connecting to camera at: rtsp://user:pw@192.168.1.9:554/h264Preview_01_sub
babysleepcoach-baby-sleep-coach-1  |  * Serving Flask app 'main'
babysleepcoach-baby-sleep-coach-1  |  * Debug mode: on
babysleepcoach-baby-sleep-coach-1  | INFO: Created TensorFlow Lite XNNPACK delegate for CPU.
babysleepcoach-baby-sleep-coach-1  | (node:48) [DEP_WEBPACK_DEV_SERVER_ON_AFTER_SETUP_MIDDLEWARE] DeprecationWarning: 'onAfterSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option.
babysleepcoach-baby-sleep-coach-1  | (Use `node --trace-deprecation ...` to show where the warning was created)
babysleepcoach-baby-sleep-coach-1  | (node:48) [DEP_WEBPACK_DEV_SERVER_ON_BEFORE_SETUP_MIDDLEWARE] DeprecationWarning: 'onBeforeSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option.
babysleepcoach-baby-sleep-coach-1  | Starting the development server...
babysleepcoach-baby-sleep-coach-1  | 
babysleepcoach-baby-sleep-coach-1  | Compiled successfully!
babysleepcoach-baby-sleep-coach-1  | 
babysleepcoach-baby-sleep-coach-1  | You can now view baby-sleep-tracker in the browser.
babysleepcoach-baby-sleep-coach-1  | 
babysleepcoach-baby-sleep-coach-1  |   Local:            http://localhost:80
babysleepcoach-baby-sleep-coach-1  |   On Your Network:  http://172.18.0.2:80
babysleepcoach-baby-sleep-coach-1  | 
babysleepcoach-baby-sleep-coach-1  | Note that the development build is not optimized.
babysleepcoach-baby-sleep-coach-1  | To create a production build, use yarn build.
babysleepcoach-baby-sleep-coach-1  | 
babysleepcoach-baby-sleep-coach-1  | webpack compiled successfully
babysleepcoach-baby-sleep-coach-1  | Files successfully emitted, waiting for typecheck results...
babysleepcoach-baby-sleep-coach-1  | Issues checking in progress...
babysleepcoach-baby-sleep-coach-1  | No issues found.
babysleepcoach-baby-sleep-coach-1  | 192.168.1.46 - - [02/Jan/2024 13:55:04] "GET / HTTP/1.1" 200 -

Ports seem to be fine at least. Netstat -tuln in the container:

root@6941ba7bce4d:/usr/app/babysleepcoach# netstat -tuln
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      
tcp        0      0 0.0.0.0:8000            0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:8001            0.0.0.0:*               LISTEN     
tcp        0      0 127.0.0.11:41407        0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN     
udp        0      0 127.0.0.11:45988        0.0.0.0:*                   

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions