Ticket #757 (closed Defect: fixed)

Opened 6 years ago

Last modified 6 years ago

"testuser" cannot log in to demo installation anymore

Reported by: Malte Owned by: JuergeN
Priority: Blocker Milestone: Release 4.5
Component: Demo server (demo.deepamehta.de) Version: 4.4
Keywords: Cc: jri
Complexity: 2 Area: Communications
Module:

Description

Hi, seems that the password for "testuser" at demo.deepamehta.de changed.
Could one please update the login infos on the website so people can log in and start with "Type Building"? That would be great!

Thanks for your support!

Change History

comment:1 follow-up: ↓ 3 Changed 6 years ago by JuergeN

Hi Malte,

actually I haven't changed anything at my end. I would guess that it does not work since the last update of DeepaMehta (4.4.1). The script that creates the user is this one:

# Create user 'testuser' in dm4nightly instance
echo -n "   Creating testuser ... "
 curl -X POST -H 'Content-Type: application/json' -H 'Authorization: Basic YWRtaW46' -H 'Cookie: dm4_workspace_id=1797
     type_uri: "dm4.accesscontrol.user_account",
     composite: {
         dm4.accesscontrol.username: "testuser",
         dm4.accesscontrol.password:
 "-SHA256-13d249f2cb4127b40cfa757866850278793f814ded3c587fe5889e889a7a9f6c"
     }
 }' http://localhost:8083/core/topic -i # >/dev/null 2>&1.
echo "done."
echo -e "\n"

When I execute it there are errors.

  • curl:
       Creating testuser ... HTTP/1.1 500 Internal Server Error
    Set-Cookie: JSESSIONID=19lotos8q65xc1lnoh0j1fwom1;Path=/
    Content-Type: text/html;charset=ISO-8859-1
    Cache-Control: must-revalidate,no-cache,no-store
    Content-Length: 1399
    Server: Jetty(8.y.z-SNAPSHOT)
    
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
    <title>Error 500 Internal Server Error</title>
    </head>
    <body><h2>HTTP ERROR 500</h2>
    <p>Problem accessing /core/topic. Reason:
    <pre>    Internal Server Error</pre></p><hr /><i><small>Powered by Jetty://</small></i><br/>                                                
    <br/>                                                
    <br/>                                                
    <br/>                                                
    <br/>                                                
    <br/>                                                
    <br/>                                                
    <br/>                                                
    <br/>                                                
    <br/>                                                
    <br/>                                                
    <br/>                                                
    <br/>                                                
    <br/>                                                
    <br/>                                                
    <br/>                                                
    <br/>                                                
    <br/>                                                
    <br/>                                                
    <br/>                                                
    
    </body>
    </html>
    done.
    
INFO: ##### Creating new session 19lotos8q65xc1lnoh0j1fwom1 (username=admin)
Jan 14, 2015 12:22:30 PM de.deepamehta.core.impl.AccessControlImpl hasPermission
WARNING: object 1797 (typeUri="dm4.core.aggregation") has no workspace assignment -- READ permission is granted
Jan 14, 2015 12:22:30 PM de.deepamehta.plugins.webservice.provider.CatchAllExceptionMapper toResponse
SEVERE: Processing HTTP request http://localhost:8083/core/topic failed. Generating a 500 response (Internal Server Error). The original exception/error is:
java.lang.RuntimeException: Creating topic failed (topic (id=2996, uri="", typeUri="dm4.accesscontrol.user_account", value="", childTopics={}))
	at de.deepamehta.core.impl.EmbeddedService.createTopic(EmbeddedService.java:704)
	at de.deepamehta.core.impl.EmbeddedService.createTopic(EmbeddedService.java:155)
	at de.deepamehta.plugins.webservice.WebservicePlugin.createTopic(WebservicePlugin.java:93)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:616)
	at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
	at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$TypeOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:185)
	at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
	at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302)
	at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
	at com.sun.jersey.server.impl.uri.rules.ResourceObjectRule.accept(ResourceObjectRule.java:100)
	at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
	at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
	at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1480)
	at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1411)
	at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1360)
	at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1350)
	at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416)
	at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:538)
	at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:716)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:503)
	at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:69)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:557)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)
	at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:240)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:429)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
	at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:77)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
	at org.eclipse.jetty.server.Server.handle(Server.java:370)
	at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:494)
	at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:982)
	at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:1043)
	at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:865)
	at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)
	at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
	at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:696)
	at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:53)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
	at java.lang.Thread.run(Thread.java:679)
Caused by: java.lang.RuntimeException: An error occurred in the PostCreateTopicListener of plugin "DeepaMehta 4 Workspaces"
	at de.deepamehta.core.impl.EventManager.deliverEvent(EventManager.java:110)
	at de.deepamehta.core.impl.EventManager.fireEvent(EventManager.java:63)
	at de.deepamehta.core.impl.EmbeddedService.fireEvent(EmbeddedService.java:495)
	at de.deepamehta.core.impl.EmbeddedService.createTopic(EmbeddedService.java:701)
	... 48 more
Caused by: java.lang.RuntimeException: Fetching topic 1797 failed
	at de.deepamehta.core.impl.EmbeddedService.getTopic(EmbeddedService.java:103)
	at de.deepamehta.plugins.workspaces.WorkspacesPlugin.checkArgument(WorkspacesPlugin.java:364)
	at de.deepamehta.plugins.workspaces.WorkspacesPlugin.assignToWorkspace(WorkspacesPlugin.java:150)
	at de.deepamehta.plugins.workspaces.WorkspacesPlugin.postCreateTopic(WorkspacesPlugin.java:242)
	at de.deepamehta.core.impl.CoreEvent$5.deliver(CoreEvent.java:72)
	at de.deepamehta.core.impl.EventManager.deliverEvent(EventManager.java:97)
	... 51 more
Caused by: java.lang.IllegalArgumentException: ID 1797 refers to an Association when the caller expects a Topic
	at de.deepamehta.storage.neo4j.Neo4jStorage.checkType(Neo4jStorage.java:1017)
	at de.deepamehta.storage.neo4j.Neo4jStorage.fetchTopicNode(Neo4jStorage.java:988)
	at de.deepamehta.storage.neo4j.Neo4jStorage.fetchTopic(Neo4jStorage.java:113)
	at de.deepamehta.core.impl.StorageDecorator.fetchTopic(StorageDecorator.java:45)
	at de.deepamehta.core.impl.EmbeddedService.getTopic(EmbeddedService.java:101)
	... 56 more
Jan 14, 2015 12:22:30 PM de.deepamehta.core.impl.TransactionFactory$TransactionResourceFilter$2 filter
WARNING: ### Rollback transaction of AbstractSubResourceMethod(WebservicePlugin#createTopic)

The log says 1797 would be an association. But when you check it https://demo.deepamehta.de/core/topic/1797 it is of course the workspace.

I guess I am missing something here ...

Can you help me?

comment:2 Changed 6 years ago by JuergeN

  • Cc jri added
  • Status changed from new to accepted

comment:3 in reply to: ↑ 1 ; follow-up: ↓ 4 Changed 6 years ago by jri

Replying to JuergeN:

actually I haven't changed anything at my end. I would guess that it does not work since the last update of DeepaMehta (4.4.1). The script that creates the user is this one:

# Create user 'testuser' in dm4nightly instance
echo -n "   Creating testuser ... "
 curl -X POST -H 'Content-Type: application/json' -H 'Authorization: Basic YWRtaW46' -H 'Cookie: dm4_workspace_id=1797
     type_uri: "dm4.accesscontrol.user_account",
     composite: {
         dm4.accesscontrol.username: "testuser",
         dm4.accesscontrol.password:
 "-SHA256-13d249f2cb4127b40cfa757866850278793f814ded3c587fe5889e889a7a9f6c"
     }
 }' http://localhost:8083/core/topic -i # >/dev/null 2>&1.
echo "done."
echo -e "\n"

We're talking about the 4.4.1 instance running on 8080, right?

Indeed, since 4.4 the request format for creating composite topics has changed: in your POST request you must replace composite by childs.

In 4.5-SNAPSHOT creating user accounts has changed completely. You'll need a different request. Tell me if you need more info.

Last edited 6 years ago by JuergeN (previous) (diff)

comment:4 in reply to: ↑ 3 Changed 6 years ago by JuergeN

Replying to jri:

We're talking about the 4.4.1 instance running on 8080, right?

Yes! Sorry for the confusion.

Indeed, since 4.4 the request format for creating composite topics has changed: in your POST request you must replace composite by childs.

Thank you! That fixed it.

In 4.5-SNAPSHOT creating user accounts has changed completely. You'll need a different request. Tell me if you need more info.

Yes, please tell me how I can change the admin's password and create a tesuser via curl script in 4.5.

comment:5 Changed 6 years ago by jri

In DM 4.5 (upcoming) you can create a user account this way:

curl -X POST -H 'Content-Type: application/json' -H 'Authorization: Basic YWRtaW46' -d '{
    username: "testuser",
    password: "-SHA256-13d249f2cb4127b40cfa757866850278793f814ded3c587fe5889e889a7a9f6c"
}' localhost:8080/accesscontrol/user_account

This ...

  • creates an user account
  • creates the user's private workspace
  • creates an empty ("untitled") topicmap and assigns it to the private workspace
  • assigns the User Account and Password topics to the private workspace and the Username topic to the System workspace

You see a lot more things are performed in 4.5. That's why the former request doesn't work anymore in 4.5 (it just creates a generic topic via Core service). The 4.5 request is more concise now. The workspace cookie is not necessary anymore.

Tell me if you need any help.

comment:6 Changed 6 years ago by jri

  • Status changed from accepted to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.