AirenSoft / OvenMediaEngine

OvenMediaEngine (OME) is a Sub-Second Latency Live Streaming Server with Large-Scale and High-Definition. #WebRTC #LLHLS
https://airensoft.com/ome.html
GNU Affero General Public License v3.0
2.59k stars 1.06k forks source link

http:HttpError throws a SIGABRT to OME #676

Closed sephentos closed 2 years ago

sephentos commented 2 years ago

If you produce an httpError, OME gets a SIGABRT and shuts down completely. The problem has only appeared since the last update.

edge_1  | terminate called after throwing an instance of 'http::HttpError'
edge_1  |   what():  [HTTP] Authorization header is required to call API (403)
edge_1  | [2022-02-22 03:30:54.612] C [SPAPISvr-T8081:22] OvenMediaEngine | signals.cpp:114  | OME received signal 6 (SIGABRT), interrupt.

image

I only discovered this error by accident when I tried to access the API via GET with the browser without an authorization header e.g. by accessing (which of course makes no sense, I know) http://xxxx:8081/v1/stats/current/vhosts/default/apps/app/streams/stream.

Proper access with an authorization header works without any issues.


OS: Debian 10 Running on docker (OME v0.13.0)

Full log:

user@server:/home/ome# docker-compose up

Starting ome_edge ... done
Attaching to ome_edge

edge_1  | [2022-02-22 03:30:43.389] I [OvenMediaEngine:1] Config | config_manager.cpp:205  | Trying to set logfile in directory... (/var/log/ovenmediaengine)
edge_1  | [2022-02-22 03:30:43.389] I [OvenMediaEngine:1] Config | config_manager.cpp:227  | Trying to load configurations... (edge_conf/Server.xml)
edge_1  | [2022-02-22 03:30:43.394] I [OvenMediaEngine:1] OvenMediaEngine | banner.cpp:23   | OvenMediaEngine v0.13.0 () is started on [domain] (Linux x86_64 - 4.                                                                                 19.0-18-amd64, #1 SMP Debian 4.19.208-1 (2021-09-29))
edge_1  | [2022-02-22 03:30:43.394] I [OvenMediaEngine:1] OvenMediaEngine | banner.cpp:27   | With modules:
edge_1  | [2022-02-22 03:30:43.394] I [OvenMediaEngine:1] OvenMediaEngine | banner.cpp:28   |   FFmpeg 4.4.1
edge_1  | [2022-02-22 03:30:43.394] I [OvenMediaEngine:1] OvenMediaEngine | banner.cpp:29   |     Configuration: --prefix=/opt/ovenmediaengine --extra-cflags='-I/opt/ovenmediaengine/                                                                                 include ' --extra-ldflags='-L/opt/ovenmediaengine/lib -Wl,-rpath,/opt/ovenmediaengine/lib' --extra-libs=-ldl --enable-shared --disable-static --disable-debug --disable-doc --disable-                                                                                 programs --disable-avdevice --disable-dct --disable-dwt --disable-lsp --disable-lzo --disable-rdft --disable-faan --disable-pixelutils --enable-zlib --enable-libopus --enable-libvpx                                                                                  --enable-libfdk_aac --enable-libopenh264 --enable-openssl --disable-nvdec --disable-nvdec --disable-vaapi --disable-vdpau --disable-cuda-llvm --disable-cuvid --disable-ffnvcodec --di                                                                                 sable-everything --disable-fast-unaligned --enable-encoder='libvpx_vp8,libopus,libfdk_aac,libopenh264,mjpeg,png' --enable-decoder='aac,aac_latm,aac_fixed,h264,hevc,opus,vp8' --enable                                                                                 -parser='aac,aac_latm,aac_fixed,h264,hevc,opus,vp8' --enable-network --enable-protocol=tcp --enable-protocol=udp --enable-protocol='rtp,file,rtmp,tls,rtmps' --enable-demuxer=rtsp --e                                                                                 nable-muxer='mp4,webm,mpegts,flv,mpjpeg' --enable-filter='asetnsamples,aresample,aformat,channelmap,channelsplit,scale,transpose,fps,settb,asettb,format'
edge_1  | [2022-02-22 03:30:43.394] I [OvenMediaEngine:1] OvenMediaEngine | banner.cpp:30   |     libavformat: 58.76.100
edge_1  | [2022-02-22 03:30:43.394] I [OvenMediaEngine:1] OvenMediaEngine | banner.cpp:31   |     libavcodec: 58.134.100
edge_1  | [2022-02-22 03:30:43.394] I [OvenMediaEngine:1] OvenMediaEngine | banner.cpp:32   |     libavutil: 56.70.100
edge_1  | [2022-02-22 03:30:43.394] I [OvenMediaEngine:1] OvenMediaEngine | banner.cpp:33   |     libavfilter: 7.110.100
edge_1  | [2022-02-22 03:30:43.394] I [OvenMediaEngine:1] OvenMediaEngine | banner.cpp:34   |     libswresample: 3.9.100
edge_1  | [2022-02-22 03:30:43.395] I [OvenMediaEngine:1] OvenMediaEngine | banner.cpp:35   |     libswscale: 5.9.100
edge_1  | [2022-02-22 03:30:43.395] I [OvenMediaEngine:1] OvenMediaEngine | banner.cpp:36   |   SRT: 1.4.4
edge_1  | [2022-02-22 03:30:43.395] I [OvenMediaEngine:1] OvenMediaEngine | banner.cpp:37   |   SRTP: libsrtp2 2.4.2
edge_1  | [2022-02-22 03:30:43.395] I [OvenMediaEngine:1] OvenMediaEngine | banner.cpp:38   |   OpenSSL: OpenSSL 3.0.1 14 Dec 2021
edge_1  | [2022-02-22 03:30:43.395] I [OvenMediaEngine:1] OvenMediaEngine | banner.cpp:39   |     Configuration: compiler: gcc -fPIC -pthread -m64 -Wa,--noexecstack -Wall -O3 -DOPENS                                                                                 SL_USE_NODELETE -DL_ENDIAN -DOPENSSL_PIC -DOPENSSL_BUILDING_OPENSSL -DNDEBUG
edge_1  | [2022-02-22 03:30:43.395] I [OvenMediaEngine:1] OvenMediaEngine | banner.cpp:40   |   JsonCpp: 1.9.3
edge_1  | [2022-02-22 03:30:43.395] I [OvenMediaEngine:1] OvenMediaEngine | banner.cpp:41   |   jemalloc: 5.2.1-0-gea6b3e973b477b8061e0076bb257dbd7f3faa756
edge_1  | [2022-02-22 03:30:43.395] W [OvenMediaEngine:1] OvenMediaEngine | main.cpp:85   | Could not resolve public IP address from stun server
edge_1  | [2022-02-22 03:30:43.400] I [OvenMediaEngine:1] OvenMediaEngine | main.cpp:111  | Trying to create MediaRouter...
edge_1  | [2022-02-22 03:30:43.400] I [OvenMediaEngine:1] MediaRouter | mediarouter.cpp:40   | Mediarouter has been started.
edge_1  | [2022-02-22 03:30:43.400] I [OvenMediaEngine:1] OvenMediaEngine | main.cpp:114  | Trying to create WebRTC Publisher...
edge_1  | [2022-02-22 03:30:43.400] I [OvenMediaEngine:1] Signalling.P2P | rtc_p2p_manager.cpp:27   | P2P is disabled in the configuration
edge_1  | [2022-02-22 03:30:43.401] I [OvenMediaEngine:1] ICE | ice_port.cpp:86   | ICE port is bound to 0.0.0.0:10000/UDP (0x5644e44748e0)
edge_1  | [2022-02-22 03:30:43.402] I [OvenMediaEngine:1] ICE | ice_port.cpp:86   | ICE port is bound to 0.0.0.0:10001/UDP (0x5644e4558830)
edge_1  | [2022-02-22 03:30:43.402] I [OvenMediaEngine:1] ICE | ice_port.cpp:86   | ICE port is bound to 0.0.0.0:10002/UDP (0x5644e455cd20)
edge_1  | [2022-02-22 03:30:43.402] I [OvenMediaEngine:1] ICE | ice_port.cpp:86   | ICE port is bound to 0.0.0.0:10003/UDP (0x5644e45611d0)
edge_1  | [2022-02-22 03:30:43.402] I [OvenMediaEngine:1] ICE | ice_port.cpp:86   | ICE port is bound to 0.0.0.0:10004/UDP (0x5644e4565750)
edge_1  | [2022-02-22 03:30:43.402] I [OvenMediaEngine:1] ICE | ice_port.cpp:86   | ICE port is bound to 0.0.0.0:10005/UDP (0x5644e4569c80)
edge_1  | [2022-02-22 03:30:43.403] I [OvenMediaEngine:1] ICE | ice_port.cpp:128  | ICE port is bound to *:3479/TCP (0x5644e456eff0)
edge_1  | [2022-02-22 03:30:43.403] I [OvenMediaEngine:1] ICE | ice_port_manager.cpp:94   | RelayServer is created successfully: host:3479?transport=tcp
edge_1  | [2022-02-22 03:30:43.403] I [OvenMediaEngine:1] WebRTC Publisher | webrtc_publisher.cpp:148  | WebRTC Publisher is listening on *:3334, TLS: *:5556...
edge_1  | [2022-02-22 03:30:43.403] I [OvenMediaEngine:1] Publisher | publisher.cpp:18   | WebRTC Publisher has been started.
edge_1  | [2022-02-22 03:30:43.403] I [OvenMediaEngine:1] OvenMediaEngine | main.cpp:115  | Trying to create HLS Publisher...
edge_1  | [2022-02-22 03:30:43.403] I [OvenMediaEngine:1] HLS | hls_publisher.cpp:38   | HLS Publisher is disabled by configuration
edge_1  | [2022-02-22 03:30:43.403] I [OvenMediaEngine:1] OvenMediaEngine | main.cpp:116  | Trying to create MPEG-DASH Publisher...
edge_1  | [2022-02-22 03:30:43.403] I [OvenMediaEngine:1] DASH | dash_publisher.cpp:36   | DASH Publisher is disabled by configuration
edge_1  | [2022-02-22 03:30:43.403] I [OvenMediaEngine:1] OvenMediaEngine | main.cpp:117  | Trying to create Low-Latency MPEG-DASH Publisher...
edge_1  | [2022-02-22 03:30:43.404] I [OvenMediaEngine:1] LLDASH | cmaf_publisher.cpp:37   | LLDASH Publisher is disabled by configuration
edge_1  | [2022-02-22 03:30:43.404] I [OvenMediaEngine:1] OvenMediaEngine | main.cpp:118  | Trying to create OVT Publisher...
edge_1  | [2022-02-22 03:30:43.404] I [OvenMediaEngine:1] OVT | ovt_publisher.cpp:38   | OVTPublisher is disabled by configuration
edge_1  | [2022-02-22 03:30:43.404] I [OvenMediaEngine:1] OvenMediaEngine | main.cpp:119  | Trying to create File Publisher...
edge_1  | [2022-02-22 03:30:43.404] I [OvenMediaEngine:1] Publisher | publisher.cpp:18   | FilePublisher has been started.
edge_1  | [2022-02-22 03:30:43.404] I [OvenMediaEngine:1] OvenMediaEngine | main.cpp:120  | Trying to create MpegtsPush Publisher...
edge_1  | [2022-02-22 03:30:43.404] I [OvenMediaEngine:1] Publisher | publisher.cpp:18   | MPEGTSPushPublisher has been started.
edge_1  | [2022-02-22 03:30:43.404] I [OvenMediaEngine:1] OvenMediaEngine | main.cpp:121  | Trying to create RtmpPush Publisher...
edge_1  | [2022-02-22 03:30:43.404] I [OvenMediaEngine:1] Publisher | publisher.cpp:18   | RTMPPushPublisher has been started.
edge_1  | [2022-02-22 03:30:43.404] I [OvenMediaEngine:1] OvenMediaEngine | main.cpp:122  | Trying to create Thumbnail Publisher...
edge_1  | [2022-02-22 03:30:43.405] I [OvenMediaEngine:1] Thumbnail | thumbnail_publisher.cpp:45   | ThumbnailPublisher is disabled by configuration
edge_1  | [2022-02-22 03:30:43.405] I [OvenMediaEngine:1] OvenMediaEngine | main.cpp:125  | Trying to create Transcoder...
edge_1  | [2022-02-22 03:30:43.405] I [OvenMediaEngine:1] OvenMediaEngine | main.cpp:128  | Trying to create WebRTC Provider...
edge_1  | [2022-02-22 03:30:43.405] I [OvenMediaEngine:1] WebRTC Provider | webrtc_provider.cpp:50   | WebRTCProvider is disabled by configuration
edge_1  | [2022-02-22 03:30:43.405] I [OvenMediaEngine:1] OvenMediaEngine | main.cpp:129  | Trying to create MPEG-TS Provider...
edge_1  | [2022-02-22 03:30:43.405] I [OvenMediaEngine:1] MpegtsProvider | mpegts_provider.cpp:97   | MPEGTSProvider is disabled by configuration
edge_1  | [2022-02-22 03:30:43.405] I [OvenMediaEngine:1] OvenMediaEngine | main.cpp:130  | Trying to create SRT Provider...
edge_1  | [2022-02-22 03:30:43.405] I [OvenMediaEngine:1] SrtProvider | srt_provider.cpp:49   | SrtProvider is disabled by configuration
edge_1  | [2022-02-22 03:30:43.405] I [OvenMediaEngine:1] OvenMediaEngine | main.cpp:131  | Trying to create RTMP Provider...
edge_1  | [2022-02-22 03:30:43.405] I [OvenMediaEngine:1] RTMPProvider | rtmp_provider.cpp:81   | RTMPProvider is disabled by configuration
edge_1  | [2022-02-22 03:30:43.405] I [OvenMediaEngine:1] OvenMediaEngine | main.cpp:132  | Trying to create OVT Provider...
edge_1  | [2022-02-22 03:30:43.405] I [OvenMediaEngine:1] Provider | provider.cpp:37   | OVTProvider has been started.
edge_1  | [2022-02-22 03:30:43.406] I [OvenMediaEngine:1] OvenMediaEngine | main.cpp:133  | Trying to create RTSPC Provider...
edge_1  | [2022-02-22 03:30:43.406] I [OvenMediaEngine:1] Provider | provider.cpp:37   | RTSPCProvider has been started.
edge_1  | [2022-02-22 03:30:43.406] I [OvenMediaEngine:1] OvenMediaEngine | main.cpp:140  | All modules are initialized successfully
edge_1  | [2022-02-22 03:30:43.406] I [OvenMediaEngine:1] Monitor | monitoring.cpp:72   | OvenMediaEngine(226f008e-a827-4f96-a23a-4d96a97aae69) ServerMetric has been started for moni                                                                                 toring - 2022-02-22T03:30:43.406+00:00
edge_1  | [2022-02-22 03:30:43.406] I [OvenMediaEngine:1] Monitor | server_metrics.cpp:55   | Create HostMetrics(default/226f008e-a827-4f96-a23a-4d96a97aae69/default) for monitoring
edge_1  | [2022-02-22 03:30:43.407] I [OvenMediaEngine:1] APIServer | api_server.cpp:113  | API Server is listening on *:8081/TCP...
edge_1  | terminate called after throwing an instance of 'http::HttpError'
edge_1  |   what():  [HTTP] Authorization header is required to call API (403)
edge_1  | [2022-02-22 03:30:54.612] C [SPAPISvr-T8081:22] OvenMediaEngine | signals.cpp:114  | OME received signal 6 (SIGABRT), interrupt.
getroot commented 2 years ago

Thank you for reporting the bug. We will fix it soon!

dimiden commented 2 years ago

@sephentos Thank you very much! It was a problem caused by the omission of the exception handler in the last modification, and I just fixed this issue.

sephentos commented 2 years ago

Thank you too! Tested it and can confirm that the problem is now fixed :)