matthuisman / docker-kodi-headless

A headless install of kodi in a docker container
GNU General Public License v3.0
136 stars 13 forks source link

Websocks Connection Lost #49

Closed jsmith432 closed 6 months ago

jsmith432 commented 6 months ago

I installed the container and am getting a "websocks connection lost" error. The only change I made was on port "myport:8080", which I am exposing to another port. There are no messages in the container log, and it isn't reading the database updates, although they loaded after restart. Is there another log that I can look into? Any other steps or recommendation?

matthuisman commented 6 months ago

did you update the advanced settings port to match? Otherwise there webapp will be trying to connect to wrong port

matthuisman commented 6 months ago

ive updated https://github.com/matthuisman/docker-kodi-headless readme.

Make external port and internal port match and then update / override advancedsettings with the ports

jsmith432 commented 6 months ago

That is not the issue, though. The advancedsettings.xml port is the docker host port. If I change that I also need to change "myport:myport", and that doesn't work either. I changed 9020, that changed the "internal" port to "9020", which made the webui inaccessible. I then change the port map to 9020:9020 and that made the UI acessible again but my library did not load and the same error happened.

matthuisman commented 6 months ago

not sure sorry. keep trying and hopefully you figure it out :)

jsmith432 commented 6 months ago

Looks like there is something hardcoded to port 8080 and it wont work if you change the "exposed" port.

matthuisman commented 6 months ago

Again, did you change both external and internal to be the same and then update advancedsettings?? Their web GUI uses Ajax to talk to itself. If it thinks it's running on port 8080, it'll try open a connection from your browser to 8080 = fail.

So it needs to know the external port. But it has no concept of that, therefore make external and internal the same and let it know what port that is. Therefore it'll start the server internally on 9020 but also use that port when trying to talk to itself externally

jsmith432 commented 6 months ago

I tried 9020:9020, changing the port to 9020 in advanced settings. It loads, but it gives the same websocket error. Ultimately, I can only make it work if it is all 8080.

matthuisman commented 6 months ago

Check the requests the website is trying to make using Chrome web tools or something

On Sat, 16 Mar 2024, 10:07 jsmith432, @.***> wrote:

I tried 9020:9020, changing the port to 9020 in advanced settings. It loads, but it gives the same websocket error. Ultimately, I can only make it work if it is all 8080.

— Reply to this email directly, view it on GitHub https://github.com/matthuisman/docker-kodi-headless/issues/49#issuecomment-2000440190, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABPQAKL23UR323ZYAFN6WRTYYNPIBAVCNFSM6AAAAABEXE2F42VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBQGQ2DAMJZGA . You are receiving this because you modified the open/close state.Message ID: @.***>

jsmith432 commented 6 months ago

with 9020:9020 and advancedsettings 9020 for webport: Screenshot 2024-03-15 161408

with 8080:8080 and advancedsettings 8080 for webport: Screenshot 2024-03-15 161550

matthuisman commented 6 months ago

oh. the websocket port != the web server port. There are two ports

I host my web server on 8081 and websocket on 9090 (you need both)

image image

jsmith432 commented 6 months ago

Both these scenarios do not work for me:

Scenario 1: 9020:9020 Docker: Screenshot 2024-03-16 221254 Advanced: Screenshot 2024-03-16 221302 Error: Screenshot 2024-03-16 221309

Scenario 2: 9020:9020 Docker Screenshot 2024-03-16 221115 Advanced: Screenshot 2024-03-16 221151 Error: Screenshot 2024-03-16 220901

matthuisman commented 6 months ago

are you sure your advancedsettings are overriding etc? Have you checked the kodi log. that spits out the advanced settings and where its starting the webserver etc

/config/.kodi/temp/kodi.log

jsmith432 commented 6 months ago

Yes, it is overriding. If I did 9020:9020 and it didn't the UI wouldn't come up at all but I do see it on the kodi log.

matthuisman commented 6 months ago

what version of kodi using? Im using Nexus and could change ports fine

matthuisman commented 6 months ago

can you try 8081 just for fun and see if works?

matthuisman commented 6 months ago

ok. so the web interface is hard-coded to 9090 - it doesnt check the actual kodi setting (https://github.com/xbmc/chorus2/blob/4f360685fb9c000c3e5db6b389eb9b83b8d678dc/src/js/app.coffee#L8)

So, if using the Chorus2 interface, you will need to stick with 9090:9090 for tcpport

matthuisman commented 6 months ago

also, looks like the webinterface has its own addon settings: http://nas.kodi.mjh.nz:9020/addons/webinterface.default/#settings/web

Maybe there is a setting in there that can fix the issue for you

matthuisman commented 6 months ago

maybe tcpport isnt even related to this websocket. I think the websocket is part of the WEB INTERFACE addon. Not kodi itself.

tcpport i believe may just be a port to use JSON RPC (not websocket)

So, maybe your getting a conflict. Try setting tcpport to just something random. dont worry about forwarding port for it. Then keep 9090:9090 for the websocket and make sure the interface setting for websocket is 9090

Hmm, https://kodi.wiki/view/JSON-RPC_API mentions the WS. So maybe you just need to check that web interface setting is also 9090 and maybe change the hostname to suite your setup

jsmith432 commented 6 months ago

I tested both nexus and omega. For the time being I moved the other container from 8080, so I can at least try to test kodi-headless in 8080 for the time being. Somewhere maybe on the initialization of the first time it wrote 8080 and I have to complete delete all and restart from scratch but will do that later. Thanks for your patience.

matthuisman commented 6 months ago

Also try without shared volume (ie fresh) Make sure no old settings etc causing issues

On Sun, 17 Mar 2024, 17:36 jsmith432, @.***> wrote:

I tested both nexus and omega. For the time being I moved the other container from 8080, so I can at least try to test kodi-headless in 8080 for the time being. Somewhere maybe on the initialization of the first time it wrote 8080 and I have to complete delete all and restart from scratch but will do that later. Thanks for your patience.

— Reply to this email directly, view it on GitHub https://github.com/matthuisman/docker-kodi-headless/issues/49#issuecomment-2002304667, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABPQAKNB7IC7Y2RZN3WGY4DYYUMV3AVCNFSM6AAAAABEXE2F42VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBSGMYDINRWG4 . You are receiving this because you modified the open/close state.Message ID: @.***>

HeresJonny commented 4 months ago

Similar problem here. I chose the non-standard port 8086 instead of 8080. While connection to the webgui basically works, some actions like changing settings trigger a "lost websocket" message while the GUI keeps on being accessible. I can't teeö of tjere adverse affects so I haven't pursued it further. One thing I noticed is that I can't seem to change the setting for addon updates to use "unknown sources". It always stays deactivated.

jonwaland commented 3 months ago

I'm running kodi (nexus previously, and now omega) with the following:

services:
  kodi:
    container_name: kodi
    image: matthuisman/kodi-headless:Omega
    restart: unless-stopped
    volumes:
      - /home/walaj/docker/kodi/config/.kodi:/config/.kodi
    ports:
      - 9777:9777/udp
      - 9090:9090
      - 8081:8080
    environment:
      - TZ=Australia/Sydney
      - PGID=1000
      - PUID=1000

note that only internal port 8080 is remapped (to 8081 external)

I don't have JSONRPC set in the advancedsettings xml.

I don't have issues with Chorus2.

The only setting that is required to let Chorus2 work correctly (for me) is to enable Reverse Proxy support. This may or may not be the issue here....