-
Notifications
You must be signed in to change notification settings - Fork 121
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
splunk sdk : com.splunk.HttpException: HTTP 401 -- call not properly authenticated #62
Comments
Can you tell us a bit more about your environment (version of Splunk, OS, using a load balancer, etc)? Also, are these the same credentials you use when you log into the web UI? |
It sounds like if you are getting a 401 that the username or password may not be correct. |
i resolved the 401 issue, i am getting now (java.lang.RuntimeException: java.lang.RuntimeException: ParseError at [row,col]:[1,1] |
Service service = new Service("hostname", portnumber); |
@radhika123456789 if you were just giving your username and password before to the connect method, it should work too. There should not be a reason for you to use basic auth. |
I need to write the search query using or condition like hostname=a or b, need to searc the query with hostname a or b.How could we write in search query using java |
Regarding "HTTP 401 -- call not properly authenticated", i noticed this is issue is comming when i use service.connect(serviceargs).HTTP 401 -- call not properly authenticated. |
Did you ever figure out your authentication problem? I'm going to assume this has been resolved. |
This issue is still present: ServiceArgs loginArgs = new ServiceArgs(); Then, I check if login is successful by having this line of code: System.out.println("Installed apps: " + service.getApplications().keySet()); exportArgs.setEarliestTime("-5"); InputStream exportSearch = service.export(searchQuery, exportArgs); Call fails at above line (service.export(searchQuery, exportArgs)) - com.splunk.HttpException: HTTP 401 -- call not properly authenticated |
@ivansd can you provide us with some details about your environment? (Splunk version, OS, load balancer, etc.) |
we are also experiencing similar issue 'com.splunk.HttpException: HTTP 401 -- call not properly authenticated' while trying to connect to Splunk.. we are spawning multiple threads(approximately 10) to access splunk and running multiple splunk queries.. Splunk version - 6.3.2 Here is code snippet. |
Since we know this code path works, the best suggestion for this issue is to open a support ticket via support@splunk.com with your Support entitlements, since it may be something specific to your environment. |
Closing due to inactivity |
HTTP 401 -- {"messages":[{"type":"WARN","text":"call not properly authenticated"}]} We are seeing this error intermittently. From what I can tell, it happens after the request is submitted to the server. I even suspect the query itself is being executed. I suspect this because our Splunk team is reporting more concurrent sessions for our user than is possible for us. Is it possible the error messes is incorrect? I ask this because we get this once in a while from a process that is running and submits the request in the same way every time. |
Hi @nmaiorana - It would help us to know a bit more about your situation: Which version of Splunk Enterprise, the Splunk Java SDK, and Java are you running on? Thanks |
@nmaiorana Even I am facing the same issue. Mainly it occurs once in a while. |
Facing similar issue. I have verified that my username and password are correct but this is mainly happening when I tried to make multiple calls at time using multiple threads. |
I am able to resolve this issue by minimising number of concurrent requests to splunk server, now it is working fine thanks |
I was getting the same error. I have fixed this problem by upgrading splunk-sdk-java library from 1.3.2 to 1.6.5 (latest one). Now it's working fine. |
I am seeing the issue even after upgrading to 1.6.5. |
try to download , use it and see if it fixes, http://dev.splunk.com/goto/sdk-java-jar , you can add this manually in your maven repo/build server/common repo . |
I get the issue, even with the jar from Splunk. |
@SurajMenon I've reopened this issue so we don't lose it. If you have some repro steps, we can take a look when we get around to it. We're always open to a PR if you're interested in contributing! |
This may be related to session expiration and the lack of threading controls in the SDK. See my other recent ticket #139. |
Is this fixed somewhere or still an issue? I still see this error. Caused by: com.splunk.HttpException: HTTP 401 -- call not properly authenticated |
Hi @Abrar-Snap, |
I am trying to search the string from splunk , i was getting 401 error.
StringBuilder searchString = new StringBuilder();
Service service = Service.connect(splunkArgs);
Job job = service.getJobs().create(searchString.toString());
The text was updated successfully, but these errors were encountered: