m1k1o / neko

A self hosted virtual browser that runs in docker and uses WebRTC.
https://neko.m1k1o.net/
Apache License 2.0
7.51k stars 550 forks source link

Neko Breaks (cannot login anymore) if dynamic Ip changes #403

Open jameskitt616 opened 4 months ago

jameskitt616 commented 4 months ago

I noticed if my dynamic IP changes, while the room was started, Neko breaks and you cannot login anymore. Here is the Error log

2024-07-09 20:24:49,635 DEBG 'neko' stdout output:
8:24PM INF creating pipeline codec=opus module=capture src="pulsesrc device=audio_output.monitor ! audio/x-raw,channels=2 ! audioconvert ! opusenc inband-fec=true bitrate=320000 ! appsink name=appsinkaudio" submodule=stream-sink video_id=audio

2024-07-09 20:24:49,636 DEBG 'pulseaudio' stdout output:
I: [pulseaudio] client.c: Created 2 "Native client (UNIX socket client)"
I: [pulseaudio] protocol-native.c: Client authenticated anonymously.

2024-07-09 20:24:49,637 DEBG 'neko' stdout output:
8:24PM INF first listener, starting module=capture submodule=stream-sink video_id=audio

2024-07-09 20:24:49,637 DEBG 'neko' stdout output:
8:24PM INF creating pipeline codec=h264 module=capture src="ximagesrc display-name=:99.0 show-pointer=true use-damage=false ! video/x-raw,framerate=30/1 ! videoconvert ! queue ! video/x-raw,format=NV12 ! vaapih264enc rate-control=vbr bitrate=6000 keyframe-period=180 quality-level=7 ! video/x-h264,stream-format=byte-stream,profile=constrained-baseline ! appsink name=appsinkvideo" submodule=stream-sink video_id=video

2024-07-09 20:24:49,638 DEBG 'pulseaudio' stdout output:
I: [pulseaudio] source-output.c: Created output 2 "Record Stream" on audio_output.monitor with sample spec s16le 2ch 48000Hz and channel map front-left,front-right
I: [pulseaudio] source-output.c:     media.name = "Record Stream"
I: [pulseaudio] source-output.c:     application.name = "neko"
I: [pulseaudio] source-output.c:     native-protocol.peer = "UNIX socket client"
I: [pulseaudio] source-output.c:     native-protocol.version = "34"
I: [pulseaudio] source-output.c:     application.process.id = "36"
I: [pulseaudio] source-output.c:     application.process.user = "neko"
I: [pulseaudio] source-output.c:     application.process.host = "neko-rooms-James"
I: [pulseaudio] source-output.c:     application.process.binary = "neko"
I: [pulseaudio] source-output.c:     application.language = "C"

2024-07-09 20:24:49,639 DEBG 'pulseaudio' stdout output:
I: [pulseaudio] source-output.c:     window.x11.display = ":99.0"
I: [pulseaudio] source-output.c:     application.process.machine_id = "f7eca9e60bbdedcd8dbc6857666d96dc"
I: [pulseaudio] protocol-native.c: Final latency 20.00 ms = 10.00 ms + 10.00 ms

2024-07-09 20:24:49,641 DEBG 'neko' stdout output:
50:37:55.213938332    36 0x7cf0e4002210 WARN                   vaapi gstvaapiutils.c:78:gst_vaapi_warning: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null)

2024-07-09 20:24:49,642 DEBG 'neko' stdout output:
50:37:55.215011506    36 0x7cf0e4002210 WARN                   vaapi gstvaapiutils.c:78:gst_vaapi_warning: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null)

2024-07-09 20:24:49,646 DEBG 'neko' stdout output:
8:24PM INF first listener, starting module=capture submodule=stream-sink video_id=video

2024-07-09 20:24:49,653 DEBG 'neko' stdout output:
8:24PM INF signaling state changed to have-local-offer module=webrtc submodule=pion subsystem=pc
8:24PM WRN negotiation is needed module=webrtc
8:24PM ERR creating offer failed error="InvalidModificationError: invalid proposed signaling state transition: have-local-offer->SetLocal(offer)->have-local-offer" module=webrtc

2024-07-09 20:24:49,654 DEBG 'neko' stdout output:
8:24PM INF signal update - LocalCandidate id=BKuit5-SdIOT25YmGYwulblCeDzfJGfi module=session
8:24PM INF sent all ICECandidates module=webrtc

2024-07-09 20:24:49,661 DEBG 'neko' stdout output:
8:24PM INF signal update - RemoteAnswer id=BKuit5-SdIOT25YmGYwulblCeDzfJGfi module=session

2024-07-09 20:24:49,664 DEBG 'neko' stdout output:
8:24PM INF signaling state changed to stable module=webrtc submodule=pion subsystem=pc

2024-07-09 20:24:49,665 DEBG 'neko' stdout output:
8:24PM INF signal update - RemoteCandidate id=BKuit5-SdIOT25YmGYwulblCeDzfJGfi module=session
8:24PM INF Setting new connection state: Checking module=webrtc submodule=pion subsystem=ice
8:24PM INF ICE connection state changed: checking module=webrtc submodule=pion subsystem=pc
8:24PM INF connection state has changed connection_state=checking module=webrtc

2024-07-09 20:25:01,707 DEBG 'neko' stdout output:
8:25PM INF Setting new connection state: Failed module=webrtc submodule=pion subsystem=ice
8:25PM INF ICE connection state changed: failed module=webrtc submodule=pion subsystem=pc

2024-07-09 20:25:01,708 DEBG 'neko' stdout output:
8:25PM INF connection state has changed connection_state=failed module=webrtc
8:25PM INF peer connection state changed: failed module=webrtc submodule=pion subsystem=pc
8:25PM WRN peer failed id=BKuit5-SdIOT25YmGYwulblCeDzfJGfi module=webrtc

2024-07-09 20:25:01,709 DEBG 'neko' stdout output:
8:25PM WRN Failed to discover mDNS candidate 2789edde-5b51-4a56-81f7-42dcd689cb31.local: mDNS: connection is closed module=webrtc submodule=pion subsystem=ice
8:25PM INF Setting new connection state: Closed module=webrtc submodule=pion subsystem=ice
8:25PM INF peer connection state changed: closed module=webrtc submodule=pion subsystem=pc
8:25PM INF ICE connection state changed: closed module=webrtc submodule=pion subsystem=pc
8:25PM INF connection state has changed connection_state=closed module=webrtc
8:25PM WRN Failed to start manager: connecting canceled by caller module=webrtc submodule=pion subsystem=pc
8:25PM WRN Failed to start SCTP: DTLS not established module=webrtc submodule=pion subsystem=pc
8:25PM WRN undeclaredMediaProcessor failed to open SrtcpSession: the DTLS transport has not started yet module=webrtc submodule=pion subsystem=pc
8:25PM WRN undeclaredMediaProcessor failed to open SrtpSession: the DTLS transport has not started yet module=webrtc submodule=pion subsystem=pc
8:25PM INF peer closed id=BKuit5-SdIOT25YmGYwulblCeDzfJGfi module=webrtc

2024-07-09 20:25:01,717 DEBG 'neko' stdout output:
50:38:07.289709341    36 0x7cf034005f00 WARN                audiosrc gstaudiosrc.c:227:audioringbuffer_thread_func:<pulsesrc2> error reading data -1 (reason: Success), skipping segment

2024-07-09 20:25:01,723 DEBG 'pulseaudio' stdout output:
I: [pulseaudio] source-output.c: Freeing output 2 "Record Stream"
I: [pulseaudio] client.c: Freed 2 "neko"
I: [pulseaudio] protocol-native.c: Connection died.

2024-07-09 20:25:01,726 DEBG 'neko' stdout output:
8:25PM INF destroying pipeline module=capture submodule=stream-sink video_id=audio
8:25PM INF last listener, stopping module=capture submodule=stream-sink video_id=audio

2024-07-09 20:25:01,750 DEBG 'neko' stdout output:
8:25PM INF destroying pipeline module=capture submodule=stream-sink video_id=video
8:25PM INF last listener, stopping module=capture submodule=stream-sink video_id=video

2024-07-09 20:25:01,752 DEBG 'neko' stdout output:
8:25PM INF destroying session module=session session_id=BKuit5-SdIOT25YmGYwulblCeDzfJGfi
m1k1o commented 4 months ago

Known issue, discussion open here:

https://github.com/m1k1o/neko-rooms/issues/62

But its good to keep the issue open on neko itself. Since neko rooms just passes ip to the neko as env it cannot do anything else as env variables cannot be changed upon starting the container. There might be other solutions - get ip regularly, resolve IP using hostname.

jameskitt616 commented 4 months ago

Pretty sure i had that same issue on regular standalone neko. Before i used neko rooms.

jameskitt616 commented 4 months ago

Maybe it's possible to pass an hostname/domain to neko and it re-resovles the IP in case of DNS warning? or sth similar to this.

m1k1o commented 4 months ago

Maybe it's possible to pass an hostname/domain to neko and it re-resovles the IP in case of DNS warning? or sth similar to this.

https://github.com/m1k1o/neko/issues/402

That would be the next step.