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

Delete user from Thehive: DELETE /api/user/user1 returned 500 org.elastic4play.InternalError: user can't be removed #844

Closed
Radi0now opened this Issue Jan 4, 2019 · 3 comments

Comments

Projects
None yet
4 participants
@Radi0now
Copy link

Radi0now commented Jan 4, 2019

Help me please! I'm new to Ubuntu.

Ubuntu 18.04
thehive-3.2.1-1

Cannot delete user by command
root@thehive:# curl -XDELETE -H 'Authorization: Bearer pujTApbw+Ew2EcfyspYdmbwHo9Neakkh' http://127.0.0.1:9000/api/user/user1
{"type":"InternalError","message":"user can't be removed"}root@thehive:/opt#

application.log

2019-01-04 11:09:28,445 [INFO] from org.elastic4play.ErrorHandler in application-akka.actor.default-dispatcher-19 - DELETE /api/user/user1 returned 500
org.elastic4play.InternalError: user can't be removed
        at org.elastic4play.models.BaseModelDef.removeAttribute(ModelDef.scala:62)
        at org.elastic4play.services.DeleteSrv.apply(DeleteSrv.scala:26)
        at org.elastic4play.services.DeleteSrv.$anonfun$apply$1(DeleteSrv.scala:22)
        at scala.concurrent.Future.$anonfun$flatMap$1(Future.scala:303)
        at scala.concurrent.impl.Promise.$anonfun$transformWith$1(Promise.scala:37)
        at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:60)
        at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:55)
        at akka.dispatch.BatchingExecutor$BlockableBatch.$anonfun$run$1(BatchingExecutor.scala:91)
        at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
        at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:81)
        at akka.dispatch.BatchingExecutor$BlockableBatch.run(BatchingExecutor.scala:91)
        at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:40)
        at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(ForkJoinExecutorConfigurator.scala:44)
        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)

@Radi0now Radi0now changed the title You signed in with another tab or window. Reload to refresh your session. Delete user from Thehive: DELETE /api/user/user1 returned 500 org.elastic4play.InternalError: user can't be removed Jan 4, 2019

@ErnHem

This comment has been minimized.

Copy link
Contributor

ErnHem commented Jan 17, 2019

Hello Team,

The same issue

To-om added a commit that referenced this issue Jan 21, 2019

@nadouani nadouani added bug and removed need investigation labels Jan 21, 2019

@nadouani nadouani added this to the 3.3.0 milestone Jan 21, 2019

@nadouani

This comment has been minimized.

Copy link
Contributor

nadouani commented Jan 21, 2019

Hello all,

well deleting users from TheHive means, marking them as Locked. We don't physically delete the data. As a workaround, you can PATCH the user and setting {"status": "Locked"}.

If you feel confident in deleting them from the DB, you can do it from ES directly.

curl -XDELETE http://ES_SERVER:ES_PORT/THEHIVE_INDEX/user/USER_LOGIN

Thanks

@nadouani nadouani closed this Jan 21, 2019

@Radi0now

This comment has been minimized.

Copy link
Author

Radi0now commented Feb 14, 2019

Hello all,

well deleting users from TheHive means, marking them as Locked. We don't physically delete the data. As a workaround, you can PATCH the user and setting {"status": "Locked"}.

If you feel confident in deleting them from the DB, you can do it from ES directly.

curl -XDELETE http://ES_SERVER:ES_PORT/THEHIVE_INDEX/user/USER_LOGIN

Thanks

Hello all,

Thank! You helped me a lot.
How to delete a user in UTF-8 encoding? (Russian coding)
user: пользователь

$ curl -XDELETE [http://localhost:9200/the_hive_14/user/пользователь]
{"found":false,"_index":"the_hive_14","_type":"user","_id":"пол�зова�ел�","_version":1,"result":"not_found","_shards":{"total":2,"successful":1,"failed":0}}

application.log
2019-02-14 13:00:52,903 [WARN] from akka.actor.ActorSystemImpl in application-akka.actor.default-dispatcher-6 - Illegal request, responding with status '400 Bad Request': Illegal request-target: Invalid input '', expected pchar, '/', '?' or 'EOI' (line 1, column 27): /the_hive_14/user/пол�зова�ел�

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment