DVR server not starting - bind: address already in use

Hi folks:

I am having trouble with the DVR. I tried uninstalling and reinstalling a few times, also tried restarting the machine twice. Every time I install, I get the following in the log:

2023/05/03 18:50:48.314845 [SYS] Starting Channels DVR v2023.04.20.0310 (darwin-arm64 pid:1614) in /Users/danaleighton/Library/Application Support/ChannelsDVR/data
2023/05/03 18:50:48.360612 [ERR] Could not start server: listen tcp :8089: bind: address already in use
2023/05/03 18:50:48.883803 [ERR] Failed to refresh auth: missing oauth client

When I look at Activity Monitor and find the two channels processes running, the installer and the channels-dvr processes are running:

% ps -p 1251,1614 | more
PID TTY TIME CMD
1251 ?? 0:01.72 /private/var/folders/s2/lnk346z108q2jyrxg98rdllw0000gp/T/AppTranslocation/34736258-07D3-4D3F-B98B-3B82EF2EE693/d/Channels DVR Installer.app/Contents/MacOS/InstallChannelsDVR
1614 ?? 0:00.68 /Users/danaleighton/Library/Application Support/ChannelsDVR/latest/channels-dvr

When I try accessing the DVR interface via http://127.0.0.1:8089 I get a can't connect to the server error in Safari.

Any ideas?

Try:

lsof -i :8089

to see what is using that port

Nothing. :frowning:

Try with sudo

sudo lsof -Pi :8089

or netstat

netstat -an -ptcp | grep LISTEN | grep .8089

Nothing again for both commands.

OK - something weird -- I saw a process named channels-dvr that is popping up under my user with admin privileges -- and it keeps changing the PID - it keeps incrementing. But now it's gone.

Edit: Now it's back. It uses 100% cpu:

6638 ?? 1:22.62 /Users/admin/Library/Application Support/ChannelsDVR/latest/channels-dvr

Here is what netstat says about that:

tcp46 0 0 *.8089 . LISTEN

Here is what lsof says:

COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
channels- 6638 admin 9u IPv6 0x44ffab636327a5b 0t0 TCP *:8089 (LISTEN)

Which log were you looking at earlier?

What does this show:

tail -50 ~/Library/Application\ Support/ChannelsDVR/data/channels-dvr.log

Log was from the Console. I brought it up using the Channels menu-bar icon.

> admin@Danas-New-iMac ~ % tail -50 ~/Library/Application\ Support/ChannelsDVR/data/channels-dvr.log

os/signal.signal_recv()

runtime/sigqueue.go:149 +0x2c fp=0x14000a8c7b0 sp=0x14000a8c790 pc=0x104e7d98c

os/signal.loop()

os/signal/signal_unix.go:23 +0x1c fp=0x14000a8c7d0 sp=0x14000a8c7b0 pc=0x105200b9c

runtime.goexit()

runtime/asm_arm64.s:1172 +0x4 fp=0x14000a8c7d0 sp=0x14000a8c7d0 pc=0x104e81bb4

created by os/signal.Notify.func1.1

os/signal/signal.go:151 +0x2c

goroutine 63 [chan receive]:

runtime.gopark(0x140007b5718?, 0x104e7e7fc?, 0x48?, 0x57?, 0x104e2261c?)

runtime/proc.go:381 +0xe4 fp=0x140007b56c0 sp=0x140007b56a0 pc=0x104e4e1e4

runtime.chanrecv(0x14000800600, 0x140007b58a8, 0x1)

runtime/chan.go:583 +0x45c fp=0x140007b5750 sp=0x140007b56c0 pc=0x104e1b9bc

runtime.chanrecv1(0x140002d1b00?, 0x14000328390?)

runtime/chan.go:442 +0x14 fp=0x140007b5780 sp=0x140007b5750 pc=0x104e1b524

net/http.(*persistConn).addTLS(0x14000796480, {0x1066f14f0?, 0x14000225410}, {0x1400013a9f0, 0x1d}, 0x0)

net/http/transport.go:1550 +0x2dc fp=0x140007b5970 sp=0x140007b5780 pc=0x10510198c

net/http.(*Transport).dialConn(0x14000147a40, {0x1066f14f0, 0x14000225410}, {{}, 0x0, {0x140005c8040, 0x5}, {0x1400013a9f0, 0x21}, 0x0})

net/http/transport.go:1624 +0x7bc fp=0x140007b5ec0 sp=0x140007b5970 pc=0x10510245c

net/http.(*Transport).dialConnFor(0x0?, 0x14000155600)

net/http/transport.go:1456 +0x7c fp=0x140007b5fb0 sp=0x140007b5ec0 pc=0x1051010bc

net/http.(*Transport).queueForDial.func1()

net/http/transport.go:1425 +0x2c fp=0x140007b5fd0 sp=0x140007b5fb0 pc=0x10510100c

runtime.goexit()

runtime/asm_arm64.s:1172 +0x4 fp=0x140007b5fd0 sp=0x140007b5fd0 pc=0x104e81bb4

created by net/http.(*Transport).queueForDial

net/http/transport.go:1425 +0x398

goroutine 44 [IO wait]:

runtime.gopark(0xffffffffffffffff?, 0xffffffffffffffff?, 0x23?, 0x0?, 0x104ee0e60?)

runtime/proc.go:381 +0xe4 fp=0x140008f71b0 sp=0x140008f7190 pc=0x104e4e1e4

runtime.netpollblock(0x0?, 0x0?, 0x0?)

runtime/netpoll.go:527 +0x158 fp=0x140008f71f0 sp=0x140008f71b0 pc=0x104e47368

internal/poll.runtime_pollWait(0x12f1f0b28, 0x72)

runtime/netpoll.go:306 +0xa0 fp=0x140008f7220 sp=0x140008f71f0 pc=0x104e7b100

internal/poll.(*pollDesc).wait(0x14000128a80?, 0x14000822000?, 0x0)

internal/poll/fd_poll_runtime.go:84 +0x28 fp=0x140008f7250 sp=0x140008f7220 pc=0x104f01e18

internal/poll.(*pollDesc).waitRead(...)

internal/poll/fd_poll_runtime.go:89

internal/poll.(*FD).Read(0x14000128a80, {0x14000822000, 0x1800, 0x1800})

internal/poll/fd_unix.go:167 +0x200 fp=0x140008f72f0 sp=0x140008f7250 pc=0x104f03180

net.(*netFD).Read(0x14000128a80, {0x14000822000?, 0x140008f73b8?, 0x104e1f75c?})

net/fd_posix.go:55 +0x28 fp=0x140008f7340 sp=0x140008f72f0 pc=0x104fe03f8

net.(*conn).Read(0x14000372128, {0x14000822000?, 0x14000449918?, 0x140008f7440?})

net/net.go:183 +0x34 fp=0x140008f7390 sp=0x140008f7340 pc=0x104ff2e74

net.(*TCPConn).Read(0x140008f7408?, {0x14000822000?, 0x1400000f830?, 0x18?})

<autogenerated>:1 +0x2c fp=0x140008f73c0 sp=0x140008f7390 pc=0x10500772c

crypto/tls.(*atLeastReader).Read(0x1400000f830, {0x14000822000?, 0x1400000f830?, 0x0?})

crypto/tls/conn.go:788 +0x40 fp=0x140008f7410 sp=0x140008f73c0 pc=0x10503dc60

Would need to see the entire log.

I suggest you run uninstall from the installer.

Go to ~/Library/Application\ Support/ChannelsDVR

Move data to data-old

Email channels-dvr.log from data-old to [email protected]

Reinstall and it should boot up fresh and let you restore a backup

OK - well, I uninstalled, but after I did that, the log was empty. So I reinstalled, and it is working again. I will return to this thread and follow the instructions if it happens again. Thanks.

Well, the issue is back again.

THis time I get the following for the lsof and netstat command:

admin@Danas-New-iMac ~ % sudo lsof -Pi :8089
Password:
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
channels- 375 admin 9u IPv6 0xaae480ca9e129db7 0t0 TCP *:8089 (LISTEN)
channels- 375 admin 20u IPv6 0xaae480ca9e1275b7 0t0 TCP [::192.168.1.226]:8089->[::192.168.1.147]:55632 (CLOSED)
channels- 375 admin 24u IPv6 0xaae480ca9e127db7 0t0 TCP [::192.168.1.226]:8089->[::192.168.1.147]:55633 (CLOSED)
admin@Danas-New-iMac ~ % netstat -an -ptcp | grep LISTEN | grep .8089
tcp46 0 0 *.8089 . LISTEN

So - I also see two channels-dvr processes in activity monitor. One that is using 100% CPU under the user admin (that has full privileges) and one under my regular user danaleighton.

Here is the tail results:

admin@Danas-New-iMac ~ % tail -50 ~/Library/Application\ Support/ChannelsDVR/data/channels-dvr.log
github.com/soheilhy/cmux.muxListener.Accept(...)
github.com/soheilhy/[email protected]/cmux.go:262
github.com/soheilhy/cmux.(*muxListener).Accept(0x1400051ce01?)
:1 +0x64 fp=0x140005d7e00 sp=0x140005d7d80 pc=0x10197f014
crypto/tls.(*listener).Accept(0x1400000e2d0)
crypto/tls/tls.go:66 +0x30 fp=0x140005d7e50 sp=0x140005d7e00 pc=0x100f59540
net/http.(*onceCloseListener).Accept(0x1025dd4b8?)
:1 +0x30 fp=0x140005d7e70 sp=0x140005d7e50 pc=0x101001730
net/http.(*Server).Serve(0x140003520f0, {0x1025d8d50, 0x1400000e2d0})
net/http/server.go:3065 +0x304 fp=0x140005d7fa0 sp=0x140005d7e70 pc=0x100fdd9d4
main.(*httpServer).Start.func4()
github.com/fancybits/channels-server/http.go:836 +0x30 fp=0x140005d7fd0 sp=0x140005d7fa0 pc=0x101dcbda0
runtime.goexit()
runtime/asm_arm64.s:1172 +0x4 fp=0x140005d7fd0 sp=0x140005d7fd0 pc=0x100d6dbb4
created by main.(*httpServer).Start
github.com/fancybits/channels-server/http.go:836 +0x604
goroutine 39 [select]:
runtime.gopark(0x140005d8e28?, 0x2?, 0x0?, 0x20?, 0x140005d8e14?)
runtime/proc.go:381 +0xe4 fp=0x140005d8cb0 sp=0x140005d8c90 pc=0x100d3a1e4
runtime.selectgo(0x140005d8e28, 0x140005d8e10, 0x20?, 0x0, 0x2b2a7dc800000030?, 0x1)
runtime/select.go:327 +0x690 fp=0x140005d8dd0 sp=0x140005d8cb0 pc=0x100d4b300
github.com/soheilhy/cmux.muxListener.Accept(...)
github.com/soheilhy/[email protected]/cmux.go:262
github.com/soheilhy/cmux.(*muxListener).Accept(0x1400064c4e0?)
:1 +0x64 fp=0x140005d8e50 sp=0x140005d8dd0 pc=0x10197f014
net/http.(*onceCloseListener).Accept(0x140008f7680?)
:1 +0x30 fp=0x140005d8e70 sp=0x140005d8e50 pc=0x101001730
net/http.(*Server).Serve(0x140003520f0, {0x1025dc530, 0x140001ae6a0})
net/http/server.go:3065 +0x304 fp=0x140005d8fa0 sp=0x140005d8e70 pc=0x100fdd9d4
main.(*httpServer).Start.func5()
github.com/fancybits/channels-server/http.go:839 +0x30 fp=0x140005d8fd0 sp=0x140005d8fa0 pc=0x101dcbd30
runtime.goexit()
runtime/asm_arm64.s:1172 +0x4 fp=0x140005d8fd0 sp=0x140005d8fd0 pc=0x100d6dbb4
created by main.(*httpServer).Start
github.com/fancybits/channels-server/http.go:839 +0x6a8
goroutine 40 [IO wait]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
runtime/proc.go:381 +0xe4 fp=0x140005d4ca0 sp=0x140005d4c80 pc=0x100d3a1e4
runtime.netpollblock(0x140005d4d38?, 0xdf27d4?, 0x1?)
runtime/netpoll.go:527 +0x158 fp=0x140005d4ce0 sp=0x140005d4ca0 pc=0x100d33368
internal/poll.runtime_pollWait(0x12b0d7768, 0x72)
runtime/netpoll.go:306 +0xa0 fp=0x140005d4d10 sp=0x140005d4ce0 pc=0x100d67100
internal/poll.(*pollDesc).wait(0x140006f6100?, 0x0?, 0x0)
internal/poll/fd_poll_runtime.go:84 +0x28 fp=0x140005d4d40 sp=0x140005d4d10 pc=0x100dede18
internal/poll.(*pollDesc).waitRead(...)
internal/poll/fd_poll_runtime.go:89
internal/poll.(*FD).Accept(0x0)
internal/poll/fd_unix.go:614 +0x250 fp=0x140005d4df0 sp=0x140005d4d40 pc=0x100df28c0

Please email the log file to [email protected]

Sorry, but again, after doing the uninstall, the log was empty (the data-old directory also disappeared) . Next time it happens I'll send the log before I do the uninstall.

After I killed the running processes and ran the installer again, I was able to restore from the backup.

Another weird thing - the uninstall did not stop the running processes. I had to kill them manually, then run the installer again to get it to start back up again.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.