openbooks icon indicating copy to clipboard operation
openbooks copied to clipboard

Unable to connect to IRC server.

Open Ruthalas opened this issue 3 years ago • 25 comments
trafficstars

Hello! I am experiencing the following issue when attempting to use OpenBooks (via Docker). When the webUI is loaded, it gives the error: "Unable to connect to IRC server."

Here is a chunk of the log, starting from a restart of the container:

2022/09/12 10:27:40 SERVER: Base Path: /
2022/09/12 10:27:40 SERVER: OpenBooks is listening on port 80
2022/09/12 10:27:40 SERVER: Download Directory: /books
2022/09/12 10:27:40 SERVER: Open http://localhost:80/ in your browser.
2022/09/12 10:27:40 SERVER: Base Path: /
2022/09/12 10:27:40 SERVER: OpenBooks is listening on port 80
2022/09/12 10:27:40 SERVER: Download Directory: /books
2022/09/12 10:27:40 SERVER: Open http://localhost:80/ in your browser.
2022/09/12 10:27:49 SERVER: Client connected from XXX.XXX.XXX.XXX:XXXX
2022/09/12 10:27:49 CLIENT (straight_contracst_1): New client created.
2022/09/12 10:27:49 CLIENT (straight_contracts_1): CONNECT Message Received
2022/09/12 10:27:50 CLIENT (straight_contracts_1): EOF
2022/09/12 10:27:50 CLIENT (straight_contracts_1): EOF

In my docker configuration I am pulling evanbuss/openbooks:latest, so I believe I am up to date. (I don't see a version number in the webUI anywhere.) I have tried setting the name flag, but it did not change the outcome.

Any assistance would be appreciated. If there is any other information I can provide, please let me know!

Thank you for this tool!

Ruthalas avatar Sep 12 '22 17:09 Ruthalas

~Are you using a reverse proxy? This happens to me using one but not if I connect directly.~ Nevermind it happens anyways. It just takes longer to complain without the proxy.

unai-ndz avatar Oct 05 '22 12:10 unai-ndz

Having the same issue as well. I'm guessing there's a problem with the IRC.

AlexMuresan avatar Oct 28 '22 09:10 AlexMuresan

Same thing over here. Comes and goes infrequently.

I only get EOF when it fails to connect.

wisewtf avatar Oct 29 '22 19:10 wisewtf

I am unable to reproduce this issue on my end. To anyone experiencing this issue, please run OpenBooks with the --log flag so that IRC logs are saved to a file for each client connection.

Docker Compose:

command: --persist --log

evan-buss avatar Oct 29 '22 22:10 evan-buss

I opened the application to test this after enabling logging and had no issue connecting. I removed the logging and still had no issue connecting.

Possibly a temporary issue on the IRC side? Regardless, appreciate the effort. I will leave logging enabled, and report back if I encounter the issue again.

Edit: Issues persist intermittently. Perhaps it's a matter of leaving the initial session open when stopping/starting the container(?). Initially it works, but after stopping the container and starting it again I get the failed to connect.

The attached log shows the initial connection, a book search, and the stop/start/fail to reconnect happens at the end. As far as I can tell, there are no entries in the log starting with the stopping of the docker container.

ruthalas_1--2022-11-01--17-40-35.log

Ruthalas avatar Nov 02 '22 00:11 Ruthalas

Issue exists when keeping TLS authentication enabled, as IRCHighway certs seem to be self-signed. With their root CA added to the cert store or with --tls=false the connection works. Despite that, no commands seem to reach the server. User and messages also can't manually be found in the users list/chat log of the channel when connecting with a common IRC client.

ncryptedV1 avatar Nov 21 '22 13:11 ncryptedV1

Issue exists when keeping TLS authentication enabled, as IRCHighway certs seem to be self-signed. With their root CA added to the cert store or with --tls=false the connection works.

TLS connections don't validate the issuer so this shouldn't be the issue.

https://github.com/evan-buss/openbooks/blob/91bb21ac7d8d2b09e1117d1a573184b000feadb0/irc/irc.go#LL32C2-L32C2

evan-buss avatar Nov 21 '22 14:11 evan-buss

TLS connections don't validate the issuer so this shouldn't be the issue.

https://github.com/evan-buss/openbooks/blob/91bb21ac7d8d2b09e1117d1a573184b000feadb0/irc/irc.go#LL32C2-L32C2

Agreed, turned out to be a network configuration problem. Works flawlessly now.

ncryptedV1 avatar Nov 22 '22 09:11 ncryptedV1

HI, I also have same issue. How did you resolve the network issue? I use local port 8081 / container port 80 and forwarded port 8081 in my router to my synology NAS where I am running Docker and the Openbooks-container. So a bit clueless why it says "not connected".....

pjannink avatar Nov 27 '22 08:11 pjannink

Running docker run -d -p 8080:80 -v ~/Downloads:/books evanbuss/openbooks --persist also gave me this kind of error but having changed 8080:80 to 80:80 I can finally establish connection. No idea if this workaround works for everyone

MMilosz avatar Dec 01 '22 17:12 MMilosz

Does not work for me. See my setup stated above. Openbooks should create a default user according evan-buss but no signs of a userid in the low left corner of the Openbooks-webpage: it states "Not connected" there.

pjannink avatar Dec 04 '22 10:12 pjannink

I have solved it with simply adding one bit next to presist

-s "irc.irchighway.net:9999" with this I am able to connect to irchightway.net without issue. so basically i just changed default irc port

takov751 avatar Dec 20 '22 12:12 takov751

Sadly not here. I'm working with Docker GUI on Synology and Portainer, but with Docker's export/import function I could edit the cmd line in the json file and recreated the container. Edited line in the JSON:

"cmd" : "./openbooks server --dir /books --port 80 --persist -s irc.irchighway.net:9999",

According Portainer the settings are now:

CMD | ./openbooks server --dir /books --port 80 --persist -s irc.irchighway.net:9999 ENTRYPOINT | ./openbooks server --dir /books --port 80

But...still not working...Now idea how I could edit the Entrypoint... Hope someone can help me out..

pjannink avatar Dec 20 '22 13:12 pjannink

For those of you using nginx proxy manager, make sure you enable "websocket support" for openbooks. I was seeing an unable to connect error and the lower left of the page would show disconnected until I enabled websocket support.

zenjubbers avatar Jan 02 '23 07:01 zenjubbers

For those of you using nginx proxy manager, make sure you enable "websocket support" for openbooks. I was seeing an unable to connect error and the lower left of the page would show disconnected until I enabled websocket support.

How are you using openbooks with NPM? Both need to listen on docker internal port 80.

ljo123 avatar Feb 11 '23 16:02 ljo123

How are you using openbooks with NPM? Both need to listen on docker internal port 80.

Just map to an unused port on your docker then in NPM, You'd forward traffic to the docker server on said port.

For example, I use port 8023 on the docker server for the openbook container. ports: - 8023:80

Then in my NPM, I simply have it forward traffic to http://{IP of docker server}:8023

zenjubbers avatar Feb 11 '23 18:02 zenjubbers

How are you using openbooks with NPM? Both need to listen on docker internal port 80.

Just map to an unused port on your docker then in NPM, You'd forward traffic to the docker server on said port.

For example, I use port 8023 on the docker server for the openbook container. ports: - 8023:80

Then in my NPM, I simply have it forward traffic to http://{IP of docker server}:8023

Nice thanks. I was confused and thought that you could only use the internal port once like you do with external. Docker is smarter than I thought!

ljo123 avatar Feb 11 '23 20:02 ljo123

-tls=false got me a connection, but commands are not forwarded, so I was able to reproduce

Issue exists when keeping TLS authentication enabled, as IRCHighway certs seem to be self-signed. With their root CA added to the cert store or with --tls=false the connection works. Despite that, no commands seem to reach the server. User and messages also can't manually be found in the users list/chat log of the channel when connecting with a common IRC client.

I have also tried using

I have solved it with simply adding one bit next to presist

-s "irc.irchighway.net:9999" with this I am able to connect to irchightway.net without issue. so basically i just changed default irc port

but had no success

I tried a non tls port (6660) with --tls=false and after sending a search got a search submitted message, but no results

2023/02/15 22:33:42 SERVER: OpenBooks is listening on port 80 2023/02/15 22:33:42 SERVER: Download Directory: /books 2023/02/15 22:33:42 SERVER: Open http://localhost:80/ in your browser. 2023/02/15 22:33:50 SERVER: Client connected from client_ip:client_port 2023/02/15 22:33:50 CLIENT (): New client created. 2023/02/15 22:33:50 CLIENT (): CONNECT Message Received 2023/02/15 22:34:00 CLIENT (): SEARCH Message Received

**after trying another search it did work with the settings above

IMBeniamin avatar Feb 15 '23 21:02 IMBeniamin

in my case it has to do with nginx proxy manager. If I put in the ip address, it works, it connects, searches, and downloads, but it doesn't work through the proxy

peseotni avatar Mar 31 '23 07:03 peseotni

For those of you using nginx proxy manager, make sure you enable "websocket support" for openbooks. I was seeing an unable to connect error and the lower left of the page would show disconnected until I enabled websocket support.

Thanks, man. Just what I was missing!!

conortimmsy avatar Jul 08 '23 23:07 conortimmsy

Issue still persists. Not using nginx proxy manager, but the connection still drops out sporadically. Have tried running both dockerised and directly from the exe with similar results.

ShadowsDieThrice avatar Oct 01 '23 04:10 ShadowsDieThrice

I needed to add -s irc.irchighway.net:9999 to my "command" options in docker compose. seems irchighway changed their port.

roadkingvrod avatar Jan 02 '24 21:01 roadkingvrod

Without sharing your docker-compose.yaml suggestions are just a shot in the dark. I experience the same issue but could be for entirely different reasons.

Make sure you are using the right port to connect through SSL: The ports we support are 6660 to 6669 and 7000. For connections through SSL use port 6697 or 9999.

99linesofcode avatar Feb 05 '24 16:02 99linesofcode

Using TLS and a correct TLS port does not work consistently. Sometimes it connects and executes all commands properly and in the next second it cannot connect.

AlphaCraft9658 avatar Mar 08 '24 10:03 AlphaCraft9658

still an issue, right? I've tried so many ways and just worked once. this is my docker.compose.yml

openbooks: container_name: openbooks command: --persist --name my_user_name -s irc.irchighway.net:6697 image: evanbuss/openbooks:latest volumes: - /openbooks:/books ports: - 8875:80 I just had checked the both SSL IRC ports 6697 / 9999 and nothing. the NPM redirection works

tfig-dev avatar Jun 08 '24 02:06 tfig-dev