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.57k stars 1.06k forks source link

OME Edge does not resolve hostname to IP #1051

Closed zapf2000 closed 1 year ago

zapf2000 commented 1 year ago

A few hours ago I updated from OME v15.0 to the latest master branche via git clone. I updated both origin and edge and did run the prerequisites.sh script before compilation. After starting both servers, I pushed a RTMP stream to origin and tried to watch over edge (over origin it works fine). If I used my dynamic dns domainname in edge, there is a fail in log:

[2023-03-01 20:28:12.536] E [SPRtcSig-t3334:1502] OvtStream | ovt_stream.cpp:209 | Cannot connect to origin server ([errno] Network is unreachable (101)) : XXXXXX.dyndns1.de:9000 [2023-03-01 20:28:12.538] W [SPOvtProvider:2337] Socket | socket.cpp:764 | [#42] [0x7ff0a7e08510] Could not get option: 4 (result: -1)

If I use the real IP it works fine. Doing a ping to the dyndns hostname returns the correct IP. As it did work fine with the previous version, I wonder if there is a bug or I'm stupid perhaps?

dimiden commented 1 year ago

@zapf2000 I would appreciate it if you could give me more hints so that I can check this problem.

  1. Are IPv6 address(AAAA record) and IPv4 address(A record) set together in your domain?
  2. Can your server access that IPv4(or IPv6) address?
zapf2000 commented 1 year ago
  1. I only set IPv4 address in edge config, but there are AAAA and A records set up in DNS.
  2. Yes, the origin server can be reached with other applications without any problems.

I used the same edge config in the v15.1 version. There was no IPv6 support in v15.0, so I didn't set up IPv6.

dimiden commented 1 year ago

@zapf2000 Thanks for the information. This issue seems to have occurred when attempting to use an IPv6 address on an Edge that cannot use IPv6. Until I solve this issue, please consider removing the AAAA record or using an IP address if possible.

GitHubDist commented 1 year ago

@zapf2000 This issue has been resolved in aa7f43e7b49059c28cf55315a86fff2385676be1. Thank you!

zapf2000 commented 1 year ago

working fine now :)

zapf2000 commented 1 year ago

I tried out the current github release and exactly the same problem is back now. No IP for the hostname. Same config, same constellation, same logs.

naanlizard commented 1 year ago

Perhaps the docker image generation is broken somehow? I also had a bug supposedly fixed but it didn't actually fix it when I tried

getroot commented 1 year ago

@zapf2000 The modules associated with this patch have not been modified since. What version do you mean by "current github release"? Please provide ovenmediaengine.log log file.

zapf2000 commented 1 year ago

Perhaps the docker image generation is broken somehow? I also had a bug supposedly fixed but it didn't actually fix it when I tried

I don't run it in docker, I complied myself.

zapf2000 commented 1 year ago

@zapf2000 The modules associated with this patch have not been modified since. What version do you mean by "current github release"? Please provide ovenmediaengine.log log file.

I just pulled the current code (git clone https://github.com/AirenSoft/OvenMediaEngine). Here is what I get:

[Client] HttpConnection(0x7f0c76601010) : HTTP/2 <ClientSocket: 0x7f0c78ed8410, #4, Connected, TCP, Nonblocking, 91.22.74.142:40916> TLS(Enabled) [Duration] 7 [Request] URL(https://XXXXXXXX.de:3334/app/live/audio.m3u8) Method(GET) Version(2) Request Time(2023-05-31T19:50:11.779+02:00) [Response] Status(404) Sent Size(0) Response Time(2023-05-31T19:50:11.787+02:00)

[2023-05-31 19:58:31.773] I [SPRtcSig-t3334:232842] Publisher | publisher.cpp:187 | Try to pull stream from local origin map: [#default#app/live] [2023-05-31 19:58:31.775] I [SPRtcSig-t3334:232842] Orchestrator | orchestrator.cpp:692 | Trying to pull stream [#default#app/live] from provider using origin map: PullProvider [2023-05-31 19:58:31.790] E [SPRtcSig-t3334:232842] OvtStream | ovt_stream.cpp:209 | Cannot connect to origin server ([errno] Network is unreachable (101)) : XXXXXX.dyndns1.de:8999 [2023-05-31 19:58:31.791] E [SPRtcSig-t3334:232842] OvtStream | ovt_stream.cpp:209 | Cannot connect to origin server ([errno] Network is unreachable (101)) : XXXXXX.dyndns1.de:8999 [2023-05-31 19:58:31.791] W [SPOvtProvider:232911] Socket | socket.cpp:764 | [#40] [0x7f0c76605510] Could not get option: 4 (result: -1) [2023-05-31 19:58:31.792] E [SPRtcSig-t3334:232842] OvtStream | ovt_stream.cpp:209 | Cannot connect to origin server ([errno] Network is unreachable (101)) : XXXXXX.dyndns1.de:8999 [2023-05-31 19:58:31.792] I [SPRtcSig-t3334:232842] Provider | stream.cpp:63 | #default#app/live(108) has been stopped playing stream [2023-05-31 19:58:31.792] E [SPRtcSig-t3334:232842] Provider | provider.cpp:153 | OVTProvider Application could not create [live] stream. [2023-05-31 19:58:31.792] E [SPRtcSig-t3334:232842] Orchestrator | orchestrator.cpp:755 | Could not pull stream [#default#app/live] from provider: PullProvider [2023-05-31 19:58:31.793] I [SPRtcSig-t3334:232842] Publisher | publisher.cpp:191 | Try to pull stream from origin map store: [#default#app/live] [2023-05-31 19:58:31.793] E [SPRtcSig-t3334:232842] LLHLS Publisher | llhls_publisher.cpp:348 | Could not pull the stream : live [2023-05-31 19:58:31.793] E [SPRtcSig-t3334:232842] HttpServer | http_exchange.cpp:43 |

and here with the old version (v0.15.0), where everything works fine:

[2023-05-31 20:37:44.035] I [OvenMediaEngine:327586] APIServer | api_server.cpp:113 | API Server is listening on YYYYYYYYYYYY:8081/TCP... [2023-05-31 20:37:48.656] I [SPRtcSig-T3334:327592] Publisher | publisher.cpp:186 | Try to pull stream from local origin map: [#default#app/live] [2023-05-31 20:37:48.657] I [SPRtcSig-T3334:327592] Orchestrator | orchestrator.cpp:708 | Trying to pull stream [#default#app/live] from provider using origin map: PullProvider [2023-05-31 20:37:48.707] I [SPRtcSig-T3334:327592] Provider | stream.cpp:59 | OVTProvider Application has started to play [live(100)] stream : ovt://XXXXXXX.dyndns1.de:8999/app/live [2023-05-31 20:37:48.707] I [SPRtcSig-T3334:327592] Provider | stream.cpp:49 | #default#app/live(100) has been started stream [2023-05-31 20:37:48.707] I [SPRtcSig-T3334:327592] MediaRouter | mediarouter_application.cpp:255 | [#default#app/live(100)] Trying to create a stream [2023-05-31 20:37:48.707] I [SPRtcSig-T3334:327592] MediaRouter | mediarouter_stream.cpp:54 | [#default#app/live(100)] Trying to create a mediarouter stream [2023-05-31 20:37:48.707] I [SPRtcSig-T3334:327592] Monitor | application_metrics.cpp:57 | Create StreamMetrics(live/d05a924e-f3a6-4e2f-b46f-1aaaa5185c5c/default/#default#app/live/i) for monitoring [2023-05-31 20:37:48.708] I [SPRtcSig-T3334:327592] MediaRouter | mediarouter_application.cpp:315 | [#default#app/live(100)] Stream has been created [Stream Info] id(100), msid(0), output(live), SourceType(Ovt), RepresentationType(Relay), Created Time (Wed May 31 20:37:48 2023) UUID(d05a924e-f3a6-4e2f-b46f-1aaaa5185c5c/default/#default#app/live/i)

Origin Stream UUID : 28a3b5f5-cec4-4c44-b0d3-9762cab69cc7/default/#default#app/live/i

    Video Track #0: Name(bypass_video) Bitrate(5.00Mb) Codec(1,H264,Auto) BSF(Unknown) Resolution(1920x1080) Framerate(30.00fps) KeyInterval(0) BFrames(0) timebase(1/1000)
    Video Track #1: Name(720p) Bitrate(2.00Mb) Codec(1,H264,Auto) BSF(Unknown) Resolution(1280x720) Framerate(30.00fps) KeyInterval(0) BFrames(0) timebase(1/90000)
    Audio Track #2: Name(bypass_audio) Bitrate(320.00Kb) Codec(6,AAC,Auto) BSF(Unknown) Samplerate(48.0K) Format(fltp, 32) Channel(stereo, 2) timebase(1/1000)
    Audio Track #3: Name(opus) Bitrate(192.00Kb) Codec(8,OPUS,Auto) BSF(Unknown) Samplerate(48.0K) Format(s16, 16) Channel(stereo, 2) timebase(1/48000)
    Audio Track #4: Name(aac48) Bitrate(48.00Kb) Codec(6,AAC,Auto) BSF(Unknown) Samplerate(48.0K) Format(s16, 16) Channel(stereo, 2) timebase(1/48000)
    Audio Track #5: Name(opus_low) Bitrate(48.00Kb) Codec(8,OPUS,Auto) BSF(Unknown) Samplerate(48.0K) Format(s16, 16) Channel(stereo, 2) timebase(1/48000)
    Data  Track #6: Name(yUQLtnXM) Codec(0,Unknown,Auto) BSF(Unknown) timebase(1/1000)

[2023-05-31 20:37:48.708] I [SPRtcSig-T3334:327592] WebRTC Publisher | rtc_stream.cpp:192 | WebRTC Stream has been created : live/100 Rtx(false) Ulpfec(false) JitterBuffer(false) PlayoutDelay(false min:0 max: 0) [2023-05-31 20:37:48.708] I [SPRtcSig-T3334:327592] Publisher | stream.cpp:204 | WebRTC Publisher Application application has started [live(100)] stream (MSID : 0) [2023-05-31 20:37:48.709] I [SPRtcSig-T3334:327592] LLHLS Publisher | llhls_stream.cpp:94 | LLHlsStream(#default#app/live) - Ignore unsupported codec(OPUS) [2023-05-31 20:37:48.709] I [SPRtcSig-T3334:327592] LLHLS Publisher | llhls_stream.cpp:94 | LLHlsStream(#default#app/live) - Ignore unsupported codec(OPUS) [2023-05-31 20:37:48.709] I [SPRtcSig-T3334:327592] LLHLS Publisher | llhls_stream.cpp:189 | LLHlsStream has been created : live/100 OriginMode(false) Chunk Duration(0.50) Segment Duration(6) Segment Count(10) [2023-05-31 20:37:48.709] I [SPRtcSig-T3334:327592] Publisher | stream.cpp:204 | LLHLS Publisher Application application has started [live(100)] stream (MSID : 0) [2023-05-31 20:37:48.709] I [SPRtcSig-T3334:327592] HLS | hls_packetizer.cpp:152 | [#default#app/live] HLS: Packetizer will be reset: 0 [2023-05-31 20:37:48.709] I [SPRtcSig-T3334:327592] Publisher | stream.cpp:204 | HLS Publisher Application application has started [live(100)] stream (MSID : 0) [2023-05-31 20:37:48.710] I [SPRtcSig-T3334:327592] Publisher | stream.cpp:204 | DASH Publisher Application application has started [live(100)] stream (MSID : 0) [2023-05-31 20:37:48.710] I [SPRtcSig-T3334:327592] Publisher | stream.cpp:204 | OVTPublisher Application application has started [live(100)] stream (MSID : 0) [2023-05-31 20:37:48.710] I [SPRtcSig-T3334:327592] Publisher | stream.cpp:204 | MPEGTSPushPublisher Application application has started [live(100)] stream (MSID : 0) [2023-05-31 20:37:48.711] I [SPRtcSig-T3334:327592] Publisher | stream.cpp:204 | RTMPPushPublisher Application application has started [live(100)] stream (MSID : 0)

dimiden commented 1 year ago

@zapf2000 There have been cases where I attempted to connect using the address from the AAAA record while both A and AAAA records were present in the DNS, but for some reason, the connection was not successful. I anticipate that you have encountered this situation, so I kindly request you to verify if the patch I applied, which prioritizes the A record over the AAAA record, is working correctly for you. https://github.com/AirenSoft/OvenMediaEngine/commit/829592d7a90e1f7fb721559b209764c5a3ac265a

zapf2000 commented 1 year ago

@zapf2000 There have been cases where I attempted to connect using the address from the AAAA record while both A and AAAA records were present in the DNS, but for some reason, the connection was not successful. I anticipate that you have encountered this situation, so I kindly request you to verify if the patch I applied, which prioritizes the A record over the AAAA record, is working correctly for you. 829592d

I can confirm that it's working with the patch. Thank you very much :)

getroot commented 1 year ago

This issue has been resolved and included in the 0.15.13 release.