Skip to content

nginx error 12: Cannot allocate memory #1706

Open
@FM-17

Description

@FM-17

Describe the bug
Frigate 9.0+ is failing to start due to an nginx related memory error on my Google Coral Dev Board. Frigate 8.4 runs fine. This is my first attempt at frigate so I apologize if this was caused by a minor oversight.

Version of frigate
frigate:0.9.0-rc2-aarch64

Config file

mqtt:
  host: <ANON_HOST_IP>
  port: 1883
  topic_prefix: frigate
detectors:
  coral:
    type: edgetpu
    device: ''
cameras:
  front_door:
    ffmpeg:
      inputs:
        - path: rtsp://{FRIGATE_RTSP_USER}:{FRIGATE_RTSP_PASSWORD}@{FRIGATE_RTSP_IP}:554/stream2
          roles:
            - detect
            - record
    detect:
      width: 640
      height: 360
      fps: 5
      enabled: True
      max_disappeared: 25
    motion:
      mask: 0,0,238,0,236,25,0,25
    record:
      enabled: False
      retain_days: 0
      events:
        enabled: True
        pre_capture: 5
        post_capture: 5
        objects:
          - person
        required_zones: []
        retain:
          default: 10
          objects:
            person: 15
    rtmp:
      enabled: False
    live:
      height: 360
      quality: 8
    objects:
      track:
        - person

Frigate container logs

fm@coral:~/home$ docker-compose up
Starting frigate ... done
Attaching to frigate
frigate    | [s6-init] making user provided files available at /var/run/s6/etc...exited 0.
frigate    | [s6-init] ensuring user provided files have correct perms...exited 0.
frigate    | [fix-attrs.d] applying ownership & permissions fixes...
frigate    | [fix-attrs.d] done.
frigate    | [cont-init.d] executing container initialization scripts...
frigate    | [cont-init.d] done.
frigate    | [services.d] starting services
frigate    | [services.d] done.
frigate    | nginx: [alert] mmap(MAP_ANON|MAP_SHARED, 536870912) failed (12: Cannot allocate memory)
frigate    | nginx: [alert] munmap(FFFFFFFFFFFFFFFF, 536870912) failed (22: Invalid argument)
frigate    | [cont-finish.d] executing container finish scripts...
frigate    | [cont-finish.d] done.
frigate    | [s6-finish] waiting for services.
frigate    | [s6-finish] sending all processes the TERM signal.
frigate    | [s6-finish] sending all processes the KILL signal and exiting.

FFprobe from camera

 ffprobe rtsp://{FRIGATE_RTSP_USER}:{FRIGATE_RTSP_PASSWORD}@{FRIGATE_RTSP_IP}:554/stream2
ffprobe version 3.4.8-0ubuntu0.2 Copyright (c) 2007-2020 the FFmpeg developers
  built with gcc 7 (Ubuntu 7.5.0-3ubuntu1~18.04)
  configuration: --prefix=/usr --extra-version=0ubuntu0.2 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
  libavutil      55. 78.100 / 55. 78.100
  libavcodec     57.107.100 / 57.107.100
  libavformat    57. 83.100 / 57. 83.100
  libavdevice    57. 10.100 / 57. 10.100
  libavfilter     6.107.100 /  6.107.100
  libavresample   3.  7.  0 /  3.  7.  0
  libswscale      4.  8.100 /  4.  8.100
  libswresample   2.  9.100 /  2.  9.100
  libpostproc    54.  7.100 / 54.  7.100
Input #0, rtsp, from 'rtsp://{FRIGATE_RTSP_USER}:{FRIGATE_RTSP_PASSWORD}@{FRIGATE_RTSP_IP}:554/stream2':
  Metadata:
    title           : Session streamed by "TP-LINK RTSP Server"
    comment         : stream2
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: h264 (High), yuvj420p(pc, bt709, progressive), 640x360, 15 fps, 15 tbr, 90k tbn, 30 tbc
    Stream #0:1: Audio: pcm_alaw, 8000 Hz, 1 channels, s16, 64 kb/s

Computer Hardware

  • OS: Mendel Linux (Debian 8)
  • Install method: Docker Compose
  • Coral Version: Coral Dev Board
  • Network Setup: Ethernet

Camera Info:

  • Manufacturer: TP-Link
  • Model: Tapo C100 (also tested with C200)
  • Resolution: Using 640x360 stream
  • FPS: 5

Additional context
I am starting Frigate from a docker container using the following docker-compose config:

version: "3.9"
services:
  frigate:
    container_name: frigate
    image: blakeblackshear/frigate:0.9.0-rc2-aarch64
    privileged: true 
    restart: unless-stopped
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - $FRIGATE_DATA_PATH/config.yml:/config/config.yml:ro
      - $FRIGATE_MEDIA_PATH:/media/frigate
    ports:
      - "5000:5000"
      - "1935:1935" # RTMP feeds
      - "1883:1883"
    environment:
      FRIGATE_RTSP_PASSWORD: $FRIGATE_RTSP_PASSWORD
      FRIGATE_RTSP_USER: $FRIGATE_RTSP_USER

My /etc/docker/daemon.json file is as follows:

{
    "default-shm-size": "256M"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpinned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions