HiveServer2 Authentication: HTTP ERROR CODE 401 - authentication

Recently we have deployed LDAP Authentication on HiveServe2 in our HDP Production Cluster.
Many users are complaining that they are receiving below error randomly:
[Code: 0, SQL State: 08S01] org.apache.thrift.transport.TTransportException: HTTP Response code: 401
Can anyone give me a hint on how to resolve it? We don't have Knox or Kerberos setup.
I have gone through the logs and this issue seems to be temporary but annoying. If we try to re-run the code a few times, it will eventually run successfully.

Related

The CGI application did not return a valid set of HTTP errors. 502.3 - Bad Gateway: Forwarder Connection Error (ARR) on Azure ASP.NET Core App

All of a sudden we are seeing this random error / exception in our web application.
Failed to load resource: the server responded with a status of 502 (Bad Gateway).
In the Log Stream, we are seeing the following details, with specific error code as 502.3 - Bad Gateway: Forwarder Connection Error (ARR).
Also, sometimes in the browser itself we see "The CGI application did not return a valid set of HTTP errors." getting displayed.
Most of the searches for these error codes refer to "IIS / Proxy Server" configuration. But, we haven't changed any such settings.
The error happens very randomly and not specific to any user action/function. Same functionality works first and on second execution immediately after first one throws this error.
How to figure out what is causing this and how to fix?
I google this question, because the program was normal at the beginning, and the subsequent 502.3 error. After I checked the information on the Internet, I feel that it can only give us an inspiration, and it cannot solve your problem immediately.
So my suggestion is that first you browse post1 and post2 I provided.
Next, proceed to Troubleshoot according to the steps of the official documentation. Specific errors require specific analysis.

ldap_error 81, Server connection lost

I have deployed OpenDJ application on one of the instances and written a java based application as well to access user details from OpenDJ using unbound LDAP SDK. All the things are up and running and working as well.
The issue occurs when the concurrent request for search user hit the OpenDJ and I get the exception as:
Error while checking the user abdulwaheed in LDAP: Error code 81,
message LDAPSearchException(resultCode=81 (server down), numEntries=0,
numReferences=0, errorMessage='The connection to server
rfhat-iam-opendj.net:1389 was closed while waiting for a response to
search request SearchRequest(baseDN='uid=abdulwaheed
,ou=people,dc=domain,dc=com', scope=BASE, deref=NEVER, sizeLimit=1,
timeLimit=0, filter='(objectClass=*)', attrs={}).')
Previously, I thought the issue can be with my java application which is not able to handle multiple concurrent requests and not able to get any free connection but after looking into error code, the error is coming from OpenDj (LDAP_ERROR 81).
I looked into the OpenDJ connection as well and seems like all the config are set to its default value (unlimited).
So, I am not sure what can be the issue and where I can look into it further?

How do I delete a Workflow Manager 1.0 child scope with permissions messed up?

I have Workflow Manager installation with an "OAuthS2SSecurityConfiguration" applied to the child workflows that I want to delete.
When I run any of the commands below, I get an "internal server error". Since I see nothing in the EventLogs or local logs, I can only assume that this is an authentication issues (I have deleted workflows in the past with no issue.)
var dcli = new WorkflowManagementClient("http://host:port/PubSubActivitiesSample")
dcli.Activities.Delete()
dcli.Workflows.Delete()
dcli.CurrentScope.Delete()
I've also tried overwriting the workflow with a null security configuration. I get an internal HTTP error on that too.
Finally I ran the following powershell command:
remove-wfscope -ScopeURI http://myhost:12291/PubSubActivitiesSample
I get an internal server error for this as well:
Remove-WFScope: An internal error occurred. For more details please see the server logs. HTTP headers received from the server: ...

WCF and IIS error 500 when using diagnostics

I have problem with WCF on IIS when using diagnostics.
When I call the service I get the following error:
System.Net.WebException: The remote
server returned an error: (500)
Internal Server Error..
If I remove "system.diagnostics" section I dont get error 500 but I get an error
The requested service,
'http://localhost/CustomerServiceSite/Customer.svc'
could not be activated. See the
server's diagnostic trace logs for
more information..
Which obviously needs diagnostics to get fixed.
Any idea why diagnostics doesnt work?
Check event log on web server - http 500 should be logged there. Also check that Account running your AppPool in IIS has access rights to file used for diagnostics.
The diagnostics will write a trace file to disk - maybe the user account WCF/ASP.NET is running under doesn't have permissions to write the file.
If I opened my service in browser (http://localhost/CustomerServiceSite/Customer.svc) I have seen the whole error.
The problem was becouse I used NHibernate and Diagnostics in wrong way. Commenting NHibernate configuration solved my problem.

Apache Internal Server Error without log entry

Are there cases where the Apache2 HTTP Server responds with an internal server error (Response code 500), yet does NOT write an entry into the server's error log file?
I experience such a case and have no idea what's going on. I already checked that the server generally logs errors by requesting a badly formed php script.
Mismatching versions of php and php-mssql caused this.