question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Post message IllegalStateException

See original GitHub issue

I tried to post a message to a private channel (conversation) and set the text, but I get an illegal state exception:

ERROR com.hubspot.slack.client.interceptors.http.DefaultHttpResponseDebugger: REQ<7> [chat_postMessage]: Failed interaction

IllegalStateException: SlackError{type=UNKNOWN, error=invalid_arguments}

{
  "ok" : false,
  "error" : "invalid_arguments",
  "deprecated_argument" : "as_user",
  "warning" : "missing_charset",
  "response_metadata" : {
    "warnings" : [ "missing_charset" ]
  }
}

Here is what I tried:

Result<ChatPostMessageResponse, SlackError> postResult = slackClient.postMessage(
         ChatPostMessageParams.builder()
                   .setText("hey there")
                   .setChannelId(getChannelId(channelName))
                   .build()
).join();

I’ve also tried passing in the channelName as the slack api suggests and followed the examples in this library but still gave me the same error.

Could anyone please take a look?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7

github_iconTop GitHub Comments

4reactions
hikuleycommented, Mar 20, 2020

I’m getting same error like the above error.

3reactions
victoriaaa234commented, Feb 11, 2020

@szabowexler I just patched up the new release 1.7-SNAPSHOT, but unfortunately i still get this error 😦 not sure how to proceed. could you please take a look? It’s the same code as I wrote previously ^

{
  "ok" : false,
  "error" : "invalid_arguments",
  "deprecated_argument" : "as_user",
  "warning" : "missing_charset",
  "response_metadata" : {
    "warnings" : [ "missing_charset" ]
  }
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Spring Boot exception while trying to send email:java.lang ...
The problem is that your Email class is a Spring-managed bean (due to it being annotated with @Component ). This means that Spring...
Read more >
How to Fix The IllegalStateException in Java - Rollbar
An IllegalStateException is a runtime exception in Java that is thrown to indicate that a method has been invoked at the wrong time....
Read more >
How to Solve java.lang.IllegalStateException in Java main ...
Generally, this method is used to indicate a method is called at an illegal or inappropriate time. Example: After starting a thread we...
Read more >
E-WL: WebLogic Log Shows Message "BEA-101020 java.lang ...
The WebLogic log sometimes posts message "java.lang.IllegalStateException: Response already committed". Below is an example of the full ...
Read more >
unable to send over websocket java.lang.IllegalStateException
SocketTimeoutException [2020-03-26T19:46:36,477] <ws-notify> WARN api - unable to send message [2020-03-26T19:46:36,479] <ws-notify> WARN api - unable to ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found