Skip to content

[Bug] Deleting the first case breaks the the audit flow until the next restart #1556

Closed
@miyoyo

Description

@miyoyo

Request Type

Bug

Work Environment

Question Answer
OS version (server) Ubuntu 20.04.1 LTS on WSL 2
OS version (client) Windows 10 19041.508
TheHive version / git hash 4.0.1, develop-th4 : e0a2786
Package Type From source
Browser type & version 81.0 (64-bit)

Problem Description

Creating the first case, then deleting it immediately results in the audit flow failing to match on the data of the case

Steps to Reproduce

  1. Spawn a fresh instance of thehive
  2. Create a case
  3. Delete the case

Complementary information

[error] o.t.s.ErrorHandler [|] Internal error
scala.MatchError: (Audit(77bc4b2088980747:3a2bfdf2:174da34aa39:-8000:67,create,true,Some(40964096),Some(Case),Some({"_id":"40964096","_type":"Case","_createdBy":"user@local","_updatedBy":null,"_createdAt":1601388756243,"_updatedAt":null,"number":1,"title":"dod","description":"dad","severity":2,"startDate":1601388720000,"endDate":null,"tags":[],"flag":false,"tlp":2,"pap":2,"status":"Open","summary":null,"impactStatus":null,"resolutionStatus":null,"assignee":"user@local","customFields":[],"extraData":{}})),ArrayBuffer(),ArrayBuffer(),ArrayBuffer(),{}) (of class scala.Tuple5)
        at org.thp.thehive.services.AuditOps$AuditOpsDefs.$anonfun$richAuditWithCustomRenderer$5(AuditSrv.scala:320)
        at scala.Function1.$anonfun$andThen$1(Function1.scala:57)
        at org.thp.scalligraph.traversal.Traversal.org$thp$scalligraph$traversal$Traversal$$$anonfun$domainMap$1(Traversal.scala:43)
        at org.thp.scalligraph.traversal.Traversal$$anonfun$domainMap$2.apply(Traversal.scala:43)
        at scala.collection.Iterator$$anon$10.next(Iterator.scala:461)
        at scala.collection.Iterator$$anon$10.next(Iterator.scala:461)
        at scala.collection.Iterator.foreach(Iterator.scala:943)
        at scala.collection.Iterator.foreach$(Iterator.scala:943)
        at scala.collection.AbstractIterator.foreach(Iterator.scala:1431)
        at scala.collection.generic.Growable.$plus$plus$eq(Growable.scala:62)
[warn] o.t.s.ErrorHandler [|] GET /api/flow?count=10&rootId=any returned 500
scala.MatchError: (Audit(77bc4b2088980747:3a2bfdf2:174da34aa39:-8000:67,create,true,Some(40964096),Some(Case),Some({"_id":"40964096","_type":"Case","_createdBy":"user@local","_updatedBy":null,"_createdAt":1601388756243,"_updatedAt":null,"number":1,"title":"dod","description":"dad","severity":2,"startDate":1601388720000,"endDate":null,"tags":[],"flag":false,"tlp":2,"pap":2,"status":"Open","summary":null,"impactStatus":null,"resolutionStatus":null,"assignee":"user@local","customFields":[],"extraData":{}})),ArrayBuffer(),ArrayBuffer(),ArrayBuffer(),{}) (of class scala.Tuple5)
        at org.thp.thehive.services.AuditOps$AuditOpsDefs.$anonfun$richAuditWithCustomRenderer$5(AuditSrv.scala:320)
        at scala.Function1.$anonfun$andThen$1(Function1.scala:57)
        at org.thp.scalligraph.traversal.Traversal.org$thp$scalligraph$traversal$Traversal$$$anonfun$domainMap$1(Traversal.scala:43)
        at org.thp.scalligraph.traversal.Traversal$$anonfun$domainMap$2.apply(Traversal.scala:43)
        at scala.collection.Iterator$$anon$10.next(Iterator.scala:461)
        at scala.collection.Iterator$$anon$10.next(Iterator.scala:461)
        at scala.collection.Iterator.foreach(Iterator.scala:943)
        at scala.collection.Iterator.foreach$(Iterator.scala:943)
        at scala.collection.AbstractIterator.foreach(Iterator.scala:1431)
        at scala.collection.generic.Growable.$plus$plus$eq(Growable.scala:62)

Metadata

Metadata

Assignees

Labels

TheHive4TheHive4 related issuesbug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions