SenexCrenshaw / xTeVe

M3U Proxy and EPG aggregator for Plex DVR and Emby Live TV
MIT License
88 stars 10 forks source link

Incorrect port when run under Kubernetes #63

Open mergwyn opened 1 year ago

mergwyn commented 1 year ago

I am trying to move my docker configuration into Kubernetes and I have come across an issue where the 'port' is not being detected correctly. Rather than 34400 the port is being set to tcp://10.152.183.69:34400.

I have tried with he xTeve-project/xTeve container and this does setup the port correctly

I release that most of the effort is going into StreamMaster, but I thought that I would raise this issue to see if it might be a relatively straightforward fix. I also appreciate that there don't seem to be many users trying to do what I am

Describe the bug A clear and concise description of what the bug is.

Server:

To Reproduce Steps to reproduce the behavior:

  1. Create a Kubernetes deployment using chart from
  2. Access logs and see error below
  3. The port is also set incorrectly in settings.json

Expected behavior The port should be set

Logs

2023/04/25 15:20:46 [xTeVe] [WARNING] Don't run this as Root!
2023/04/25 15:20:46 [xTeVe] Version:                2.5.3 Build: 3
2023/04/25 15:20:46 [xTeVe] Database Version:       2.3.0
2023/04/25 15:20:46 [xTeVe] System Folder:          /home/xteve/conf/
2023/04/25 15:20:46 [xTeVe] Load Settings:          /home/xteve/conf/settings.json
2023/04/25 15:20:46 [xTeVe] System IP Addresses:    IPv4: 3 | IPv6: 3
2023/04/25 15:20:46 [xTeVe] Hostname:               xteve-9f4898954-vmqgt
2023/04/25 15:20:46 [xTeVe] Temporary Folder:       /tmp/xteve/2023-04-I6WC-2ACMEU/
2023/04/25 15:20:46 [xTeVe] GitHub:                 https://github.com/SenexCrenshaw
2023/04/25 15:20:46 [xTeVe] Git Branch:             master [SenexCrenshaw]
2023/04/25 15:20:46 [xTeVe] SSDP / DLNA:            true
2023/04/25 15:20:46 [xTeVe] [WARNING] Updates have been disabled by the developer
2023/04/25 15:20:46 [xTeVe] UUID:                   2023-04-I6WC-2ACMEU
2023/04/25 15:20:46 [xTeVe] Tuner (Plex / Emby):    1
2023/04/25 15:20:46 [xTeVe] EPG Source:             XEPG
2023/04/25 15:20:46 [xTeVe] Plex Channel Limit:     480
2023/04/25 15:20:46 [xTeVe] Unfiltered Chan. Limit: 2000
2023/04/25 15:20:46 [xTeVe] Backup Path:            /home/xteve/conf/backup/
2023/04/25 15:20:46 [xTeVe] Backup file:            /home/xteve/conf/backup/xteve_auto_backup_20230425_1520.zip
2023/04/25 15:20:46 [xTeVe] Open:                   /data/iceflashott.m3u
2023/04/25 15:20:46 [xTeVe] Check File:             /data/iceflashott.m3u
2023/04/25 15:20:46 [xTeVe] Save File:              /data/iceflashott.m3u [ID: MO1C29XUH5HHMRIEFUP5]
2023/04/25 15:20:46 [xTeVe] Download:               http://line.4k-feast.com/xmltv.php?username=<user>&password=<pass>
2023/04/25 15:21:03 [xTeVe] Check File:             http://line.4k-feast.com/xmltv.php?username=<user>&password=<pass>
2023/04/25 15:21:08 [xTeVe] Save File:              http://line.4k-feast.com/xmltv.php?username=<user>&password=<pass> [ID:XXCI9YMMLSQF1SF8ZZKV]
2023/04/25 15:21:08 [xTeVe] All streams:            124
2023/04/25 15:21:08 [xTeVe] Active streams:         71
2023/04/25 15:21:08 [xTeVe] Filter:                 1
2023/04/25 15:21:08 [xTeVe] XEPG:                   Parse XMLTV file: XMLTV
2023/04/25 15:21:14 [xTeVe] XEPG:                   Update database
2023/04/25 15:21:15 [xTeVe] XEPG:                   Save DB file
2023/04/25 15:21:15 [xTeVe] XEPG:                   Map channels
2023/04/25 15:21:15 [xTeVe] XEPG:                   Cleanup database
2023/04/25 15:21:15 [xTeVe] XEPG Channels:          0
2023/04/25 15:21:15 [xTeVe] [WARNING] There are no channels mapped, use the mapping menu to assign EPG data to the channels.
2023/04/25 15:21:15 [xTeVe] Web server:             Starting
2023/04/25 15:21:15 [xTeVe] DVR IP:                 xteve-new.example.com:tcp://10.152.183.69:34400
2023/04/25 15:21:15 [xTeVe] Web Interface:          http://xteve-new.example.com:tcp://10.152.183.69:34400/web/ | xTeVe is also available via the other 5 IP's.
2023/04/25 15:21:15 [xTeVe] [ERROR] listen tcp: address :tcp://10.152.183.69:34400: too many colons in address (Web server could not be started.) - EC: 1001
2023/04/25 15:21:15 [xTeVe] XEPG:                   Create XMLTV file (/home/xteve/conf/data/xteve.xml)
2023/04/25 15:21:15 [xTeVe] XEPG:                   Compress XMLTV file (/home/xteve/conf/data/xteve.xml.gz)
2023/04/25 15:21:15 [xTeVe] XEPG:                   Create M3U file (/home/xteve/conf/data/xteve.m3u)
2023/04/25 15:21:15 [xTeVe] XEPG:                   Ready to use

Output fromip a

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
3: eth0@if91: <BROADCAST,MULTICAST,UP,LOWER_UP,M-DOWN> mtu 1500 qdisc noqueue state UP 
    link/ether 26:ba:c5:ad:75:4d brd ff:ff:ff:ff:ff:ff
    inet 10.1.102.122/32 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::24ba:c5ff:fead:754d/64 scope link 
       valid_lft forever preferred_lft forever

Note the kubernetes service is 10.152.183.69 whilst the pod address is 10.1.102.122

Additional context I am attempting to run xteve through the pod-gateway which has a vpn sidecar but I experience the same behaviour if I run without the gateway.

clemcvlcs commented 1 year ago

I had the same issue, the initial generation of the settings.json doesn't fit with k8s ip addressing. I didn't dig in the code to find a way to properly solve this, but my workaround was to:

Note: I also needed to overwrite the Dockerfile Entrypoint in my deployment. Not sure why this step was needed, maybe my volume mount was not correct. I've added the following in my deployment.yaml :

spec:
containers:
- command:
- sh
- -c
- /home/xteve/bin/xteve -port=34400 -config=/home/xteve/conf
mergwyn commented 1 year ago

Many thanks for the hint - setting the port on the command line works around the problem for me. Manually the configuration file always seemed to get overwritten by the derived port.