charles santo
charles santo

Reputation: 3

Server 500 error on a MarkLogic server

So I'm stuck creating VUsers for my boss on his marklogic server and stumbled on an issue I can't fix. Sometimes marklogic won't register me creating a user when I click the enter button the first time, so when I clicked the second time, it created a duplicate user. This wouldn't normally be an issue, doing this commonly just says 'username already in use' on the second one, but this time, I got an error that pops up every time I open it. I can't change it's name, and I can't edit any of it's permissions. Is there a way to delete one of them?

Upvotes: 0

Views: 221

Answers (1)

You can delete one of the offending users by searching for them and deleting one of them from the security database.

Please Note: This is a sharp tool approach and if used inappropriately can destroy your security database - so handle with extreme care!!

If you run this in Query Console against your security database, it will return a sequence of results. I provide back the URI for each security entry and the content of the file. This way you can make an educated decision as to which one to manually delete using the URI provided. I did not automate that as part of the sample by design - I leave the dissecting of the security database to you.

xquery version "1.0-ml";
declare namespace sec="http://marklogic.com/xdmp/security";

for $doc in fn:doc(cts:uri-match("http://marklogic.com/xdmp/users*"))[./sec:user/sec:user-name="beezelbubba"]
  return <result uri="{xdmp:node-uri($doc)}">{$doc}</result>

Of course, replace beezelbubba with the username of the user in question.

There are other ways to search for this information. I choose the xPath approach because some search features may not be enabled on the security database.

Upvotes: 2

Related Questions