Datahub UI: redirected to login page after successful login
See original GitHub issueI am trying to do mini POC in my environment. I am using OpenLDAP as test environment and already created user named testuser
The problem was:
- Login via login page
- Redirected to Browse (successfully logged in) After a second, the UI redirected back to Login page
- It seems that (GET)
/api/v1/user/me
has problem in my machine - I already onboard LDAP users via ldap etl
- Already checked those users exists in MySQL database table metadata_aspect
Do I have something missing?
Frontend: Login is OK
curl -c cookie.txt -d '{"username":"testuser", "password":"testuser"}' -H 'Content-Type: application/json' http://localhost:9001/authenticate | jq
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 138 100 92 100 46 2628 1314 --:--:-- --:--:-- --:--:-- 3942
{
"status": "ok",
"data": {
"username": "testuser",
"uuid": "1bae2a15-63f5-4dfb-a5df-5db0591f0f16"
}
}
Frontend: /api/v1/user/me not working
curl -b cookie.txt http://localhost:9001/api/v1/user/me
<!DOCTYPE html>
<html lang="en">
<head>
<title>Error</title>
<style>
html, body, pre {
margin: 0;
padding: 0;
font-family: Monaco, 'Lucida Console', monospace;
background: #ECECEC;
}
h1 {
margin: 0;
background: #A31012;
padding: 20px 45px;
color: #fff;
text-shadow: 1px 1px 1px rgba(0,0,0,.3);
border-bottom: 1px solid #690000;
font-size: 28px;
}
p#detail {
margin: 0;
padding: 15px 45px;
background: #F5A0A0;
border-top: 4px solid #D36D6D;
color: #730000;
text-shadow: 1px 1px 1px rgba(255,255,255,.3);
font-size: 14px;
border-bottom: 1px solid #BA7A7A;
}
</style>
</head>
<body>
<h1>Oops, an error occurred</h1>
<p id="detail">
This exception has been logged with id <strong>7hfh7ni6c</strong>.
</p>
</body>
</html>
Below is datahub-frontend logs:
04:55:14 [application-akka.actor.default-dispatcher-217] ERROR application -
! @7hfh86caf - Internal server error, for (GET) [/api/v1/user/me] ->
play.api.UnexpectedException: Unexpected exception[NullPointerException: null]
at play.api.http.HttpErrorHandlerExceptions$.throwableToUsefulException(HttpErrorHandler.scala:247)
at play.api.http.DefaultHttpErrorHandler.onServerError(HttpErrorHandler.scala:176)
at play.core.server.AkkaHttpServer$$anonfun$2.applyOrElse(AkkaHttpServer.scala:363)
at play.core.server.AkkaHttpServer$$anonfun$2.applyOrElse(AkkaHttpServer.scala:361)
at scala.concurrent.Future$$anonfun$recoverWith$1.apply(Future.scala:346)
at scala.concurrent.Future$$anonfun$recoverWith$1.apply(Future.scala:345)
at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:36)
at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:55)
at akka.dispatch.BatchingExecutor$BlockableBatch$$anonfun$run$1.apply$mcV$sp(BatchingExecutor.scala:91)
at akka.dispatch.BatchingExecutor$BlockableBatch$$anonfun$run$1.apply(BatchingExecutor.scala:91)
at akka.dispatch.BatchingExecutor$BlockableBatch$$anonfun$run$1.apply(BatchingExecutor.scala:91)
at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:72)
at akka.dispatch.BatchingExecutor$BlockableBatch.run(BatchingExecutor.scala:90)
at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:40)
at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(ForkJoinExecutorConfigurator.scala:43)
at akka.dispatch.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
at akka.dispatch.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
at akka.dispatch.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
at akka.dispatch.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
Caused by: java.lang.NullPointerException: null
at com.linkedin.datahub.util.CorpUserUtil.toCorpUserView(CorpUserUtil.java:39)
at controllers.api.v1.User.getLoggedInUser(User.java:61)
at router.Routes$$anonfun$routes$1$$anonfun$applyOrElse$12$$anonfun$apply$12.apply(Routes.scala:791)
at router.Routes$$anonfun$routes$1$$anonfun$applyOrElse$12$$anonfun$apply$12.apply(Routes.scala:791)
at play.core.routing.HandlerInvokerFactory$$anon$3.resultCall(HandlerInvoker.scala:134)
at play.core.routing.HandlerInvokerFactory$$anon$3.resultCall(HandlerInvoker.scala:133)
at play.core.routing.HandlerInvokerFactory$JavaActionInvokerFactory$$anon$8$$anon$2$$anon$1.invocation(HandlerInvoker.scala:108)
at play.core.j.JavaAction$$anon$1.call(JavaAction.scala:88)
at play.http.DefaultActionCreator$1.call(DefaultActionCreator.java:31)
at play.mvc.Security$AuthenticatedAction.call(Security.java:69)
at play.core.j.JavaAction$$anonfun$9.apply(JavaAction.scala:138)
at play.core.j.JavaAction$$anonfun$9.apply(JavaAction.scala:138)
at scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(Future.scala:24)
at scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24)
at play.core.j.HttpExecutionContext$$anon$2.run(HttpExecutionContext.scala:56)
at play.api.libs.streams.Execution$trampoline$.execute(Execution.scala:70)
at play.core.j.HttpExecutionContext.execute(HttpExecutionContext.scala:48)
at scala.concurrent.impl.Future$.apply(Future.scala:31)
at scala.concurrent.Future$.apply(Future.scala:494)
at play.core.j.JavaAction.apply(JavaAction.scala:138)
at play.api.mvc.Action$$anonfun$apply$2.apply(Action.scala:96)
at play.api.mvc.Action$$anonfun$apply$2.apply(Action.scala:89)
at play.api.libs.streams.StrictAccumulator$$anonfun$mapFuture$2$$anonfun$1.apply(Accumulator.scala:174)
at play.api.libs.streams.StrictAccumulator$$anonfun$mapFuture$2$$anonfun$1.apply(Accumulator.scala:174)
at scala.util.Try$.apply(Try.scala:192)
at play.api.libs.streams.StrictAccumulator$$anonfun$mapFuture$2.apply(Accumulator.scala:174)
at play.api.libs.streams.StrictAccumulator$$anonfun$mapFuture$2.apply(Accumulator.scala:170)
at scala.Function1$$anonfun$andThen$1.apply(Function1.scala:52)
at play.api.libs.streams.StrictAccumulator.run(Accumulator.scala:207)
at play.core.server.AkkaHttpServer$$anonfun$14.apply(AkkaHttpServer.scala:357)
at play.core.server.AkkaHttpServer$$anonfun$14.apply(AkkaHttpServer.scala:355)
at akka.http.scaladsl.util.FastFuture$.akka$http$scaladsl$util$FastFuture$$strictTransform$1(FastFuture.scala:41)
at akka.http.scaladsl.util.FastFuture$$anonfun$transformWith$extension1$1.apply(FastFuture.scala:51)
at akka.http.scaladsl.util.FastFuture$$anonfun$transformWith$extension1$1.apply(FastFuture.scala:50)
... 13 common frames omitted
GMS: Get all user is OK
curl -H 'X-RestLi-Protocol-Version:2.0.0' -H 'X-RestLi-Method: get_all' 'http://localhost:8080/corpUsers' | jq
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1216 100 1216 0 0 46769 0 --:--:-- --:--:-- --:--:-- 46769
{
"elements": [
...
{
"username": "testuser",
"info": {
"departmentName": "Data Science & Engineering",
"firstName": "Test",
"lastName": "User",
"displayName": "Test User",
"active": true,
"fullName": "Test User",
"title": "Test User",
"managerUrn": "urn:li:corpuser:*******",
"email": "testuser@bizzy.co.id"
}
}
],
"paging": {
"count": 10,
"start": 0,
"links": []
}
}
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Datahub UI: redirected to login page after successful ... - GitHub
I am trying to do mini POC in my environment. I am using OpenLDAP as test environment and already created user named testuser...
Read more >Tech Deep Dive: DataHub Metadata Service Authentication
If the cookie was invalid, the user would be redirected to the DataHub native login screen (for JAAS authentication) or to a third-party...
Read more >Frontend pages redirects to login page after successful login.
Redirected to the logging page while accessing restricted pages, even after entering valid credentials.
Read more >NiFi login redirect issue: 'Success - You are already logged in'
I can login, and authenticate successfully, but I seem to hit a strange redirect loop on login. I simply endlessly redirect to:.
Read more >Redirecting to original page after successful login returns raw ...
You can return the redirect url to response. public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think I know what’s happening here. One of the midtier logic assumes the presence of
CorpUserEditableInfo
aspect all the times. Will provide fix.Thanks for the additional info. Looks like the frontend is assuming the existence of the
com.linkedin.identity.CorpUserEditableInfo
, which seems incorrect to me. @nagarjunakanamarlapudi could you take a look at this? Thanks.