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

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

Open
kamms opened this issue Jan 2, 2024 · 3 comments
Open

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

kamms opened this issue Jan 2, 2024 · 3 comments

Comments

@kamms
Copy link

kamms commented Jan 2, 2024

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:[email protected]: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:[email protected]: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:*                   
@rtxco
Copy link

rtxco commented Feb 13, 2024

Did you ever figure this out

@kamms
Copy link
Author

kamms commented Feb 19, 2024

Nope

@rtxco
Copy link

rtxco commented Feb 20, 2024

Were you even getting a video feed of your camera on the website? Mine isn't throwing up these errors but I have no video feed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants