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

Error using module #1

Open
robalexclark opened this issue Mar 11, 2022 · 1 comment
Open

Error using module #1

robalexclark opened this issue Mar 11, 2022 · 1 comment

Comments

@robalexclark
Copy link

Hello,

We are trying to use your module to send Mendix logs to splunk but are getting the following error:

11:28:26 AMAPPERRORJamLogSplunk: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 10 path $
11:28:26 AMAPPERRORJamLogSplunk: com.splunk.logging.HttpEventCollectorErrorHandler$ServerErrorException: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 10 path $
11:28:26 AMAPPINFOat com.splunk.logging.HttpEventCollectorSender$3.failed(HttpEventCollectorSender.java:400)
11:28:26 AMAPPINFOat com.splunk.logging.HttpEventCollectorSender$4.onFailure(HttpEventCollectorSender.java:444)
11:28:26 AMAPPINFOat okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:525)
11:28:26 AMAPPINFOat java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
11:28:26 AMAPPINFOat java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
11:28:26 AMAPPINFOat java.base/java.lang.Thread.run(Unknown Source)

This happens both in local dev and deployed mendix app.

Any ideas?

@martijnraats
Copy link
Contributor

Hello,

The library is expecting a JSON message from the splunk server, but receiving something else, most likely an error message. Unfortunately the response body is not logged.

You could debug the onError method (line 104 on jamlogsplunk/actions/RegisterLogSubscriber.java) to find out the exact response.

Or add something like this:

  String message = exception.getMessage();
  if (exception instanceof HttpEventCollectorErrorHandler.ServerErrorException) {
    message += ", reply = " + ((HttpEventCollectorErrorHandler.ServerErrorException) exception).getReply();
  }

Regards Martijn

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants