Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to connect to IRC server. #102

Open
Ruthalas opened this issue Sep 12, 2022 · 25 comments
Open

Unable to connect to IRC server. #102

Ruthalas opened this issue Sep 12, 2022 · 25 comments
Labels
bug Something isn't working

Comments

@Ruthalas
Copy link

Ruthalas commented Sep 12, 2022

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!

@unai-ndz
Copy link

unai-ndz commented Oct 5, 2022

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.

@AlexMuresan
Copy link

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

@evan-buss evan-buss added the bug Something isn't working label Oct 29, 2022
@wisewtf
Copy link

wisewtf commented Oct 29, 2022

Same thing over here. Comes and goes infrequently.

I only get EOF when it fails to connect.

@evan-buss
Copy link
Owner

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

@Ruthalas
Copy link
Author

Ruthalas commented Nov 2, 2022

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

@ncryptedV1
Copy link
Contributor

ncryptedV1 commented Nov 21, 2022

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.

@evan-buss
Copy link
Owner

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

@ncryptedV1
Copy link
Contributor

ncryptedV1 commented Nov 22, 2022

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.

@pjannink
Copy link

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".....

@MMilosz
Copy link

MMilosz commented Dec 1, 2022

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

@pjannink
Copy link

pjannink commented Dec 4, 2022

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.

@takov751
Copy link

takov751 commented Dec 20, 2022

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

@pjannink
Copy link

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..

@zenjubbers
Copy link

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.

@ljo123
Copy link

ljo123 commented Feb 11, 2023

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.

@zenjubbers
Copy link

zenjubbers commented Feb 11, 2023

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

@ljo123
Copy link

ljo123 commented Feb 11, 2023

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!

@IMBeniamin
Copy link

IMBeniamin commented Feb 15, 2023

-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

@peseotni
Copy link

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

@conortimmsy
Copy link

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!!

@ShadowsDieThrice
Copy link

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.

@roadkingvrod
Copy link

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

@99linesofcode
Copy link

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.

@AlphaCraft9658
Copy link

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.

@tfig-dev
Copy link

tfig-dev commented Jun 8, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests