simple-slack-api icon indicating copy to clipboard operation
simple-slack-api copied to clipboard

connect() freezes

Open mbfbsae90 opened this issue 7 years ago • 10 comments

I'm calling:

	Session = SlackSessionFactory.createWebSocketSlackSession(token);
	try {
		Session.connect();
	} catch (IOException e) {
		e.printStackTrace();
		Session = null;
	}

But connect() never comes back... I step thru to the statement: websocketSession = client.connectToServer(new Endpoint() .... in SlackWebSocketSessionImpl.connectImpl()

I have no proxy. Why would it just hang and not return anything/fail?

Thx, Mark

mbfbsae90 avatar Mar 24 '17 20:03 mbfbsae90

Same issue here. Trying to debug

SenhorCastor avatar Mar 30 '17 16:03 SenhorCastor

Interesting enough:

    private static final String SLACK_HTTPS_AUTH_URL = "https://slack.com/api/rtm.start?token=";

    public static void main(String [] args) throws IOException {
        String authToken = "TOKEN";
        HttpClient httpClient = HttpClientBuilder.create().build();
        HttpGet request = new HttpGet(SLACK_HTTPS_AUTH_URL + authToken);
        HttpResponse response;
        response = httpClient.execute(request);
        System.out.print(response.getStatusLine().getStatusCode());
    }

actually works

SenhorCastor avatar Mar 30 '17 16:03 SenhorCastor

Failure when running the connect from the library:

WARN  [2017-03-30 16:32:59,605] io.split.qos.server.integrations.slack.SlackCommon: Could not create session with token XXXX, Slack Integration will not broadcast at all
! java.io.EOFException: SSL peer shut down incorrectly
! at sun.security.ssl.InputRecord.read(InputRecord.java:505) ~[na:1.8.0_51]
! at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:973) ~[na:1.8.0_51]
! ... 29 common frames omitted
! Causing: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake

SenhorCastor avatar Mar 30 '17 16:03 SenhorCastor

any news on that issue...?

jk14n6 avatar May 04 '17 20:05 jk14n6

I have the issue as well.

adammertzenich avatar May 12 '17 18:05 adammertzenich

I also have this issue. I used it first on my Slack team that has a handful of users and it worked fine. I then tried to connect to a team that is much much bigger and it just hangs

a19i23 avatar May 18 '17 15:05 a19i23

I met a "solution" to this: I just have commented the call to establishWebsocketConnection() in the method connectImpl of the class SlackWebSocketSessionImpl.

Arkanute avatar Aug 02 '17 14:08 Arkanute

Looking at the message history, it seems to be linked to the websocket connection. It can depends on your WebSocketContainer. With the actual information I have I can't give any further input nor provide a fix

bcorne avatar Oct 26 '17 11:10 bcorne

The solution proposed by @Arkanute works! Thank you!

noeliajimenezg avatar Apr 25 '18 18:04 noeliajimenezg

Have the same issue. Would it be possible to add a timeout value instead of letting the connection hang?

yhuangbl avatar May 23 '18 18:05 yhuangbl