Skip to content
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

Error when uploading file observables #1089

Open
Passimist opened this issue Aug 1, 2019 · 32 comments
Open

Error when uploading file observables #1089

Passimist opened this issue Aug 1, 2019 · 32 comments

Comments

@Passimist
Copy link

Passimist commented Aug 1, 2019

Error when uploading file observables

Request Type

Bug

Work Environment

Question Answer
OS version (server) Debian 10
OS version (client) Windows 10
TheHive version / git hash 3.3.1-1 (latest commit)
Package Type DEB
Java Version openjdk full version "11.0.4+11-post-Debian-1deb10u1"

What seems to also be important is:
The Debian 10 Machine is a VM on an ESXi version 6.7.0.30000
When setting up another machine on my local computer using VMWare-Workstation 15 Pro the exact same way it works fine.
Installing java full version "1.8.0_221-b11" (oracle Java 8) seems to fix the issue (it did not appear again since ~300 fileuploads)
Details on the VM-Settings: #1089 (comment)

From TheHives about page:
TheHive 3.3.1-1
Elastic4Play 1.10.0
Play 2.6.21
Elastic4s 5.6.6
ElasticSearch 5.6.9

Problem Description

I have set up a new TheHive instance, following the installation guide on a Debian 10 machine. I have done this multiple times before (a few times on Debian 10 even) and it always worked.

Now yesterday i set up another Debian 10 VM and and noticed, that adding file observables (via the Webinterface and via the API) sometimes results in an Error. (errorlogs below)

Whats confusing me the most is that it will sometimes work, so i guess (i also doublechecked) my configs are all fine.

Steps to Reproduce

This is kinda hard to say since i have no clue what is suddenly causing this. I have another Debian 10 machine, set up the exact same way, where its working properly. Maybe someone has had this issue before or understands the errorlogs better than i do.

Complementary information

This is the /var/log/thehive/application.log entry:

Error during preStart in [FileSource(/tmp/playtemp13354541987563218898/multipartBody15791114881836088669asTemporaryFile, 8192)]: /tmp/playtemp13354541987563218898/multipartBody15791114881836088669asTemporaryFile
java.nio.file.NoSuchFileException: /tmp/playtemp13354541987563218898/multipartBody15791114881836088669asTemporaryFile
at akka.stream.impl.io.FileSource$$anon$2.preStart(IOSources.scala:74)
at akka.stream.impl.fusing.GraphInterpreter.init(GraphInterpreter.scala:295)
at akka.stream.impl.fusing.GraphInterpreterShell.init(ActorGraphInterpreter.scala:557)
at akka.stream.impl.fusing.ActorGraphInterpreter.tryInit(ActorGraphInterpreter.scala:679)
at akka.stream.impl.fusing.ActorGraphInterpreter.preStart(ActorGraphInterpreter.scala:727)
at akka.actor.Actor.aroundPreStart(Actor.scala:528)
at akka.actor.Actor.aroundPreStart$(Actor.scala:528)
at akka.stream.impl.fusing.ActorGraphInterpreter.aroundPreStart(ActorGraphInterpreter.scala:670)
at akka.actor.ActorCell.create(ActorCell.scala:652)
at akka.actor.ActorCell.invokeAll$1(ActorCell.scala:523)
at akka.actor.ActorCell.systemInvoke(ActorCell.scala:545)
at akka.dispatch.Mailbox.processAllSystemMessages(Mailbox.scala:283)
at akka.dispatch.Mailbox.run(Mailbox.scala:224)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
2019-08-01 13:55:44,828 [INFO] from org.elastic4play.ErrorHandler in application-akka.actor.default-dispatcher-5 - POST /api/case/AWxNCS0IA69JQvBt7AXt/artifact returned 500
java.nio.file.NoSuchFileException: /tmp/playtemp13354541987563218898/multipartBody15791114881836088669asTemporaryFile
at akka.stream.impl.io.FileSource$$anon$2.preStart(IOSources.scala:74)
at akka.stream.impl.fusing.GraphInterpreter.init(GraphInterpreter.scala:295)
at akka.stream.impl.fusing.GraphInterpreterShell.init(ActorGraphInterpreter.scala:557)
at akka.stream.impl.fusing.ActorGraphInterpreter.tryInit(ActorGraphInterpreter.scala:679)
at akka.stream.impl.fusing.ActorGraphInterpreter.preStart(ActorGraphInterpreter.scala:727)
at akka.actor.Actor.aroundPreStart(Actor.scala:528)
at akka.actor.Actor.aroundPreStart$(Actor.scala:528)
at akka.stream.impl.fusing.ActorGraphInterpreter.aroundPreStart(ActorGraphInterpreter.scala:670)
at akka.actor.ActorCell.create(ActorCell.scala:652)
at akka.actor.ActorCell.invokeAll$1(ActorCell.scala:523)
at akka.actor.ActorCell.systemInvoke(ActorCell.scala:545)
at akka.dispatch.Mailbox.processAllSystemMessages(Mailbox.scala:283)
at akka.dispatch.Mailbox.run(Mailbox.scala:224)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)

I hope someone has an idea, whats causing this.

@ITServ-DE
Copy link

ITServ-DE commented Aug 2, 2019

There is a problem with filenames having unicode-characters in it. The problem with these is, they can be uploaded, but the download link is broken.

You're talking about upload, right?

What are the access rights on /tmp? Can the user thehive write on /tmp?

And would you please post the code you use to upload your file?

@Passimist
Copy link
Author

Passimist commented Aug 2, 2019

Hi, thanks for replying :)

Yes i am talking about upload. I upload files using TheHive´s webinterface and (for testing) the Sample Code from TheHive4py: https://github.com/TheHive-Project/TheHive4py/blob/master/samples/test-case-observable.py (with my API Key)

/tmp Permissions are 777 and Thehive, Cortex and elasticsearch all own files in /tmp so i assumed writing there is not the problem.
The directory mentioned in the errorlogs ("playtemp13354541987563218898") does exist (owned by thehive) but it is empty.

When using the webinterface for observable uploading it shows this error after some time:
image

@ITServ-DE
Copy link

This is what it looks for my installation:

root@hive:/tmp# ls -ald /tmp/playtemp*
drwx------ 2 thehive thehive 4096 Aug  2 08:07 /tmp/playtemp7624360753471813389
drwx------ 2 cortex  cortex  4096 Aug  2 08:53 /tmp/playtemp9392392829165297666

Can you stop TheHive, remove thehive's play directory (not the one owned by cortex), and restart thehive?

If you have SELinux active, disable it (at least for troubleshooting). One potential source of problems less.

Do you have strace on your host? In this case you could trace the system calls during file upload (prepare the upload, start strace -o /tmp/strace.out -f -e openat -p {TheHivePID}, create observable). In the resulting file `/tmp/strace you should find something like

root@hive:/tmp# grep play /tmp/strace.out 
19460 openat(AT_FDCWD, "/tmp/playtemp8367066778523157102/multipartBody12692830496643194511asTemporaryFile", O_WRONLY|O_CREAT|O_EXCL, 0600) = 300
20142 openat(AT_FDCWD, "/tmp/playtemp8367066778523157102/multipartBody12692830496643194511asTemporaryFile", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 300
20147 openat(AT_FDCWD, "/tmp/playtemp8367066778523157102/multipartBody12692830496643194511asTemporaryFile", O_RDONLY) = 300
20148 openat(AT_FDCWD, "/tmp/playtemp8367066778523157102/multipartBody12692830496643194511asTemporaryFile", O_RDONLY <unfinished ...>
20149 openat(AT_FDCWD, "/tmp/playtemp8367066778523157102/multipartBody12692830496643194511asTemporaryFile", O_RDONLY) = 300
20150 openat(AT_FDCWD, "/tmp/playtemp8367066778523157102/multipartBody12692830496643194511asTemporaryFile", O_RDONLY) = 300
20151 openat(AT_FDCWD, "/tmp/playtemp8367066778523157102/multipartBody12692830496643194511asTemporaryFile", O_RDONLY) = 300
20152 openat(AT_FDCWD, "/tmp/playtemp8367066778523157102/multipartBody12692830496643194511asTemporaryFile", O_RDONLY) = 300
20153 openat(AT_FDCWD, "/tmp/playtemp8367066778523157102/multipartBody12692830496643194511asTemporaryFile", O_RDONLY) = 301
20154 openat(AT_FDCWD, "/tmp/playtemp8367066778523157102/multipartBody12692830496643194511asTemporaryFile", O_RDONLY) = 300

The interesting part is the result of each system call. If there is an error, you will see it.

@Passimist
Copy link
Author

Passimist commented Aug 2, 2019

After typing service thehive stop it took a ridiculous amount of time for thehive to stop (like 1min), in case that is interesting.

Here is the content of the strace.out after a failed upload using the webinterface:


15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 318
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 318
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 318
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 318
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 318
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 318
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 318
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 318
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 318
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 318
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 318
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 318
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 318
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 318
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 318
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 318
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 318
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 318
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 318
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 318
16529 +++ exited with 0 +++
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 318
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 318
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 318
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 318
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 318
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 318
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 318
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 318
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 318
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 318
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 318
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 318
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 318
15722 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 318
15722 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 318
15722 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 318
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 318
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 318
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 318
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 318
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 318
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 318
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 318
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 318
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15722 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15722 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY 
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY 
15722 <... openat resumed> )            = 319
15723 <... openat resumed> )            = 320
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY 
15722 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY 
15723 <... openat resumed> )            = 319
15722 <... openat resumed> )            = 320
15811 openat(AT_FDCWD, "/tmp/playtemp9421071532105064121/multipartBody15500665702095445580asTemporaryFile", O_WRONLY|O_CREAT|O_EXCL, 0600) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
16595 openat(AT_FDCWD, "/tmp/playtemp9421071532105064121/multipartBody15500665702095445580asTemporaryFile", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 320
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 320
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 320
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 320
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 320
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15799 --- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_ACCERR, si_addr=0x7fe19426a008} ---
15718 openat(AT_FDCWD, "/sys/fs/cgroup/cpu,cpuacct/cpu.cfs_quota_us", O_RDONLY) = 319
15718 openat(AT_FDCWD, "/sys/fs/cgroup/cpu,cpuacct/cpu.cfs_period_us", O_RDONLY) = 319
15718 openat(AT_FDCWD, "/sys/fs/cgroup/cpu,cpuacct/cpu.shares", O_RDONLY) = 319
15718 openat(AT_FDCWD, "/sys/fs/cgroup/cpu,cpuacct/cpu.cfs_quota_us", O_RDONLY) = 319
15718 openat(AT_FDCWD, "/sys/fs/cgroup/cpu,cpuacct/cpu.cfs_period_us", O_RDONLY) = 319
15718 openat(AT_FDCWD, "/sys/fs/cgroup/cpu,cpuacct/cpu.shares", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY 
15722 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY 
15723 <... openat resumed> )            = 318
15722 <... openat resumed> )            = 319
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 318
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 318
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 318
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 318
15722 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 318
15722 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 318
15722 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 318
15762 --- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_ACCERR, si_addr=0x7fe19426a008} ---
16597 +++ exited with 0 +++
16595 +++ exited with 0 +++
16598 +++ exited with 0 +++
16596 +++ exited with 0 +++
16599 +++ exited with 0 +++
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 318
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 318
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 318
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 318
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 318
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 318
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 318
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 318
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 318
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 318
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 318
15723 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 318
15722 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 318

@ITServ-DE
Copy link

Oh, wow. There is really a problem - but not with the file upload, but with a crashing process:

[...]
15799 --- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_ACCERR, si_addr=0x7fe19426a008} ---
[...]
15762 --- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_ACCERR, si_addr=0x7fe19426a008} ---
[...]

Which javaVM do you use (java -fullversion)?

@Passimist
Copy link
Author

openjdk full version "11.0.4+11-post-Debian-1deb10u1"

@ITServ-DE
Copy link

ITServ-DE commented Aug 2, 2019

I run openjdk full version "11.0.3+7-Ubuntu-1ubuntu218.04.1", and this one works. I suspect the java version. Please allow me to think a moment how we could trace further.

Do you have the chance to change the JVM, for example against Oracle`s?

Ah, and I did not explain what happens: SIGSEGV is a segmentation violation error - a process tried to access memory out out it's range.

@Passimist
Copy link
Author

Passimist commented Aug 2, 2019

Yes i have root access on the machine and i dont know of any service running, that would care when i change the JVM, so i could change it. Do you have the necessary command ready? Else i ll just look it up really quick.

Do you know how this JVM got on my system? Because i did not knowingly install it, so it must have been part of the Debian ISO or (wich would be weird because it seems to break TheHive) of TheHives installation process.

@Passimist
Copy link
Author

Oh and take your time i am very greatfull that you are helping me out and i am in no hurry :)

@ITServ-DE
Copy link

No, I don't have the commands right at hand.

Basically, download Oracle's JVM Standard Edition, install it, make /usr/bin/java point to Oracle's java. The goal is to have the command java -fullversion answer with Oracle's version string.

You could also downgrade your openJDK to 11.0.3.

I'm very confident the JVM is guilty ...

PS, I'm curious. Where are you located?

@Passimist
Copy link
Author

Ok, i ll try that and will let you know if it helped :)
I am a student from Germany.

@ITServ-DE
Copy link

Mainz. :-)

@Passimist
Copy link
Author

Ok i am having a hard time downgrading the openjdk (older packages are nowhere to be found). I ll take a quick break. By the way: I checked the other Debian 10 VM that i have (the one everything is working on) and it is using the same java-version. Does that mean, that the javavm is not guilty after all? (The failing one is running on different hardware and was set up with a different installer file, could those differences cause the JVM to fail on the one and work fine on the other?)

@ITServ-DE
Copy link

I think the problem comes from the JVM - but I'm not sure. The point is, the JVM executes the Java Programs running on the system. If you encounter Segmentation Faults, I assume it's the JVM. Another possibility would be that TheHive calls an external program, and that crashes. I'll look how to trace this with strace.

Strange enough you have a running system on another host. So what's the difference?

do you know if you have corefiles/crashdumps of the dying processes?

@Passimist
Copy link
Author

I managed to install the oracle JVM but the is still coming up.
java full version "11.0.4+10-LTS"
I guess i ll have to somehow replace the machine (since all my other test machines work fine).

@ITServ-DE
Copy link

Hm. Strange.
Very Strange.

Sorry I could'nt help with a successful result. If I have another idea, I'll let you know.

@Passimist
Copy link
Author

Thanks a lot for your time! :) At least i learned quite a lote while trying to fix this^^
I ll update in here after i set up a new machine to let you know if that fixes it.

@Passimist Passimist reopened this Aug 6, 2019
@Passimist
Copy link
Author

So i gave it another shot and set up a completely new machine on the same esxi server and another one on a older esxi server and both were again facing the same problem.
I then installed Oracle Java 8 which seems to fix it.

I reopened this issue, so someone with an esxi server can maybe reproduce the problem and look into it.

also added this information to the description:
Java Version | openjdk full version "11.0.4+11-post-Debian-1deb10u1"
What seems to also be important is:
The Debian 10 Machine is a VM on an ESXi version 6.7.0.30000
When setting up another machine on my local computer using VMWare-Workstation 15 Pro the exact same way it works fine.
Installing java full version "1.8.0_221-b11" (oracle Java 8) seems to fix the issue (it did not appear again since ~300 fileuploads)

I will collect some more information and post it here soon.

@ITServ-DE
Copy link

I do have a private ESXi (6.5.0) here, so I could verify your results.

Can you please summarize your machine settings (#CPUs, Memory, OS-Version, Hive-Version, ElasticSearch-Version)? If I find the time the next few evenings, I could setup a similar host.

PS: I'm glad I seem to have been right blaming the JVM :-)

@ITServ-DE
Copy link

@saadkadhi : this thread here might be interesting for you to follow.

@Passimist
Copy link
Author

Oh thats great i will give you the interesting settings i see in the vsphere client:
Virtual Hardware:
image

image

image

image

image

The OS Version ist Debian 10 ISO downloaded from here:
https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-10.0.0-amd64-netinst.iso

TheHive, Elasticsearch, Cortex etc. versions are the latest or what you get when you follow this installation guides:
TheHive: https://github.com/TheHive-Project/TheHiveDocs/blob/master/installation/install-guide.md
Elasticsearch: https://github.com/TheHive-Project/TheHiveDocs/blob/master/installation/install-guide.md#elasticsearch-installation
Cortex: https://github.com/TheHive-Project/CortexDocs/blob/master/installation/install-guide.md#deb

Right now this results in:
TheHive 3.3.1-1
Elastic4Play 1.10.0
Play 2.6.21
Elastic4s 5.6.6
ElasticSearch 5.6.9

Note that i also installed Cortex on every attempt i made even though it probably does not take part in the scenario.

@ITServ-DE
Copy link

Awesome. And a great collection of information on how to setup the confirmation equipment.

I'll do my best to setup a similar setup.

@Passimist
Copy link
Author

Great! Let me know if you need anything else.

P.S. I am also glad about you finding the JVM quickfix^^ this way i can keep working with TheHive for now.

@Passimist
Copy link
Author

Oh maybe i should mention this little script again in order to quickly test fieluploads multiple times:
https://github.com/TheHive-Project/TheHive4py/blob/master/samples/test-case-observable.py

@ITServ-DE
Copy link

ITServ-DE commented Aug 7, 2019

I have set up a ESXi 6.5 VM with Debian 10 x64, openjdk full version "11.0.4+11-post-Debian-1deb10u1", and successfully uploaded a file in a new case.

Setup:

TheHive 3.3.1-1
Elastic4Play 1.10.0
Play 2.6.21
Elastic4s 5.6.6
ElasticSearch 5.6.9

Unfortunatly, I dont have ESXi 6.7 available.

Did you problem happen always or sometimes? Did you upload that many files to one single case? What kind of files?

@ITServ-DE
Copy link

OK, my questions were already answered. I will throw files at my installation using the test script you mentioned, and report back. Give me some time, I have to do this at home.

@ITServ-DE
Copy link

Problem confirmed

My test setup had trouble creating an observable and dropped the error message:

ko: 500/{"type":"java.nio.file.NoSuchFileException","message":"/tmp/playtemp4454911430048983000/multipartBody11343756530582156277asTemporaryFile"}

Investigation goes on.

@Passimist
Copy link
Author

Hi, sorry for replying so late i was kinda busy the last days. The errormessage you mention in your last post is the exact same that i get! So at least we now can reproduce the problem :)

@ITServ-DE
Copy link

I was able to trigger the same problem on Ubuntu 18.04.2 LTS with TheHive 3.4.0-RC2 on a KVM virtualized host.

It took 108 runs of your above script.

My log message:

2019-08-09 09:11:01,486 [ERROR] from akka.actor.RepointableActorRef in application-akka.actor.default-dispatcher-14 - Error during preStart in [FileSource(/tmp/playtemp8618028823770625700/multipartBody8932501704726042572asTemporaryFile, 8192)]: /tmp/playtemp8618028823770625700/multipartBody8932501704726042572asTemporaryFile
java.nio.file.NoSuchFileException: /tmp/playtemp8618028823770625700/multipartBody8932501704726042572asTemporaryFile
		 at akka.stream.impl.io.FileSource$$anon$2.preStart(IOSources.scala:74)
		 at akka.stream.impl.fusing.GraphInterpreter.init(GraphInterpreter.scala:291)
		 at akka.stream.impl.fusing.GraphInterpreterShell.init(ActorGraphInterpreter.scala:557)
		 at akka.stream.impl.fusing.ActorGraphInterpreter.tryInit(ActorGraphInterpreter.scala:664)
		 at akka.stream.impl.fusing.ActorGraphInterpreter.preStart(ActorGraphInterpreter.scala:712)
		 at akka.actor.Actor.aroundPreStart(Actor.scala:528)
		 at akka.actor.Actor.aroundPreStart$(Actor.scala:528)
		 at akka.stream.impl.fusing.ActorGraphInterpreter.aroundPreStart(ActorGraphInterpreter.scala:655)
		 at akka.actor.ActorCell.create(ActorCell.scala:656)
		 at akka.actor.ActorCell.invokeAll$1(ActorCell.scala:527)
		 at akka.actor.ActorCell.systemInvoke(ActorCell.scala:549)
		 at akka.dispatch.Mailbox.processAllSystemMessages(Mailbox.scala:283)
		 at akka.dispatch.Mailbox.run(Mailbox.scala:224)
		 at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
		 at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
		 at java.base/java.lang.Thread.run(Thread.java:834)

The system calls from the JVM say:

28121 09:11:08 openat(AT_FDCWD, "/tmp/playtemp8618028823770625700/multipartBody14467939532792365055asTemporaryFile", O_WRONLY|O_CREAT|O_EXCL, 0600) = 323
30544 09:11:08 openat(AT_FDCWD, "/tmp/playtemp8618028823770625700/multipartBody14467939532792365055asTemporaryFile", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 323
30547 09:11:08 openat(AT_FDCWD, "/tmp/playtemp8618028823770625700/multipartBody14467939532792365055asTemporaryFile", O_RDONLY) = 323
30548 09:11:08 openat(AT_FDCWD, "/tmp/playtemp8618028823770625700/multipartBody14467939532792365055asTemporaryFile", O_RDONLY) = 323
30549 09:11:08 openat(AT_FDCWD, "/tmp/playtemp8618028823770625700/multipartBody14467939532792365055asTemporaryFile", O_RDONLY) = 323
30550 09:11:08 openat(AT_FDCWD, "/tmp/playtemp8618028823770625700/multipartBody14467939532792365055asTemporaryFile", O_RDONLY) = 323
28121 09:11:09 --- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_ACCERR, si_addr=0x7f65b8c6d008} ---
28069 09:11:09 openat(AT_FDCWD, "/sys/fs/cgroup/memory/system.slice/thehive.service/memory.limit_in_bytes", O_RDONLY) = 323
30548 09:11:10 +++ exited with 0 +++

To summarize what I know:

  • it is not OS version dependend (happens on Debian 10 and Ubuntu 18)
  • it is not hypervisor dependend (happens on KVM and VMWare ESXi 6.5, 6.7)
  • the time it takes for the problem to occur is different on different systems. However, i was not able to influence the time by loading up the CPUs or the I/O susbsystem
  • problem is triggered by TH 3.3.1 and 3.4.0-RC2
  • root cause is a crash of openjdk (SIGSEGV), and it seems not to happen on Oracle JVM. However, I can not match the file name from the strace output with the error message in application.log. It is clear that there is a relationship between them, but I currently can't pinpoint it.

@saadkadhi, @nadouani : if you want access to a system which quite fast and reliably triggers the problem, I can arrange this.

@thofm
Copy link

thofm commented Nov 11, 2019

Hello, we probably have the same problem. Importing a set of files into TheHive leads to an error at some point.

Version: 3.4.0-RC1 and 3.4.0
Package Type: Docker (which uses also the OpenJDK Runtime Environment - build 1.8.0_212-b04)

hive/application.log:

2019-11-06 09:37:49,771 [WARN] from org.elastic4play.utils.Retry in application-akka.actor.default-dispatcher-5 - An error occurs (/tmp/playtemp324748061433139340/multipartBody1402756559908599118asTemporaryFile), retrying (1)
2019-11-06 09:38:05,787 [ERROR] from akka.actor.RepointableActorRef in application-akka.actor.default-dispatcher-18 - Error during preStart in [FileSource(/tmp/playtemp324748061433139340/multipartBody1402756559908599118asTemporaryFile, 51200)]: /tmp/playtemp324748061433139340/multipartBody1402756559908599118asTemporaryFile
java.nio.file.NoSuchFileException: /tmp/playtemp324748061433139340/multipartBody1402756559908599118asTemporaryFile
        at akka.stream.impl.io.FileSource$$anon$2.preStart(IOSources.scala:74)
        at akka.stream.impl.fusing.GraphInterpreter.init(GraphInterpreter.scala:291)
        at akka.stream.impl.fusing.GraphInterpreterShell.init(ActorGraphInterpreter.scala:557)
        at akka.stream.impl.fusing.ActorGraphInterpreter.tryInit(ActorGraphInterpreter.scala:664)
        at akka.stream.impl.fusing.ActorGraphInterpreter.preStart(ActorGraphInterpreter.scala:712)
        at akka.actor.Actor.aroundPreStart(Actor.scala:528)
        at akka.actor.Actor.aroundPreStart$(Actor.scala:528)
        at akka.stream.impl.fusing.ActorGraphInterpreter.aroundPreStart(ActorGraphInterpreter.scala:655)
        at akka.actor.ActorCell.create(ActorCell.scala:656)
        at akka.actor.ActorCell.invokeAll$1(ActorCell.scala:527)
        at akka.actor.ActorCell.systemInvoke(ActorCell.scala:549)
        at akka.dispatch.Mailbox.processAllSystemMessages(Mailbox.scala:283)
        at akka.dispatch.Mailbox.run(Mailbox.scala:224)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)

@cyberpescadito
Copy link

Hello,
I dunno why i'm triggering this error randomly, sometimes.
Quite interested for any workaround

@Passimist
Copy link
Author

Hello @thofm and @cyberpescadito,

as mentioned above the current workaround is to switch from openjdk to oracle.
Maybe if we are lucky the components that trigger this error are not used anymore in the next major version of TheHive?

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

No branches or pull requests

6 participants