Open JamesCullum opened 6 years ago
I had the same issue as well. I built the project with sbt with some success.
Today I'm able to run locally, but I have not been able to build using activator.
My environment is also W10 with everything installed in it's default path.
I would recommend the following so you can start working, it is just a workaroud and you loose a ton of dev capabilites:
cd
into your TheHive foldersbt
if an sbt console pops up, then you are good to go.run -Dconfig.file="C:\path\to\application.conf"
At this point you should be able to point your browser to the project.
Hey axpatito,
Thank you very much for the trick. While it does start the server, I get a 404 for most assets. Have you experienced that issue with your workaround already?
Console prints out this error
[error] a.d.Dispatcher - Illegal char <:> at index 16: 0c120e4bbe53a544:26f3f15e:163de29804f:-8000:465
java.nio.file.InvalidPathException: Illegal char <:> at index 16: 0c120e4bbe53a544:26f3f15e:163de29804f:-8000:465
at sun.nio.fs.WindowsPathParser.normalize(Unknown Source)
at sun.nio.fs.WindowsPathParser.parse(Unknown Source)
at sun.nio.fs.WindowsPathParser.parse(Unknown Source)
at sun.nio.fs.WindowsPath.parse(Unknown Source)
at sun.nio.fs.WindowsFileSystem.getPath(Unknown Source)
at sun.nio.fs.AbstractPath.resolve(Unknown Source)
at org.elastic4play.services.TempSrv.releaseTemporaryFiles(TempSrv.scala:64)
at org.elastic4play.services.TempSrv.releaseTemporaryFiles(TempSrv.scala:60)
at org.elastic4play.services.TempFilter$$anonfun$apply$1.applyOrElse(TempSrv.scala:77)
at org.elastic4play.services.TempFilter$$anonfun$apply$1.applyOrElse(TempSrv.scala:77)
Yup, you will get those non stop. It is due to the missnaming of temp files on Windows. I just ignore those warning and can continue to work. As stated before, this is just a workaround.
I don't understand why you are getting 404's, the application should be running nicely.
If temporary files is needed, they are stored in the context of the HTTP request. At the end of the request, theses files are deleted. In order to track them, they are stored in a directory named with the ID of the request, which contains ":". I didn't realize that it is not permitted by Windows. This will be fixed in the next release.
Hey @To-om ,
Are you talking about the 404 error from the workaround or the initial issue with the unexpected NoSuchFileException?
I'm talking about your error Illegal char <:> at index 16: 0c120e4bbe53a544:26f3f15e:163de29804f:-8000:465
Regarding 404 error on assets, are you sure they are correctly built ? You can build them manually by executing:
cd ui
npm install
bower install
grunt build
and check output for errors (cf. docs)
The error is only created because the build process via activator doesn't work and the workaround doesn't use it properly. Building manually does work.
The real issue is the crash during the build process itself, which axpatito confirmed to make it unavailable on Windows completely.
I'm not sure I can help you to build TheHive in Windows. I seems that main build tool (sbt) fails to execute npm, bower or grunt tools. You can try to customize how sbt run these tools by editing project/FrontEnd.scala in line 30, 32 and 34.
I did that already to fix the immediate compiling errors that are visible. However, I don't get any visible source for the last error, which prevents the building, so I don't really have any starting point.
Regarding the error java.nio.file.InvalidPathException: Illegal char <:> at index 16: 0c120e4bbe53a544:26f3f15e:163de29804f:-8000:465
, the fix has been published: TheHive-Project/elastic4play#59
Can you update the bower.json
file so that the new version of the angular-image-resizer
is included?
It had a very similiar issues and is one of the dependancies. See issue here.
Hello @JamesCullum
Could you please take care of these attempts (changing bower.json and testing) because we don't use windows.
If your fixes work, then we will be happy to include them, but right now, we don't the bandwidth to work on this.
I'll keep this issue open, remove it from 3.1.0 release. If you end up fixing it, we could include your PR on 3.1.0.
Thanks for your understanding
Hey @nadouani,
I executed those changes already and took care of it by communicating to the other developer. The version just needs to be bumped to 2.0.3
.
The failed build itself keeps on existing, so it still doesn't work on Windows.
While I understand where your idea is coming from, I am not sure if it is a good idea to keep away free developer resources due to missing developer resources. If it would be possible to build on Windows, there would be more people that could help. By choosing to not make it available to develop on Windows, the work will stay within your team and the changes that I planned on integrating won't be able to help other users.
If it is permanently impossible to build on Windows, I have to make all changes in a dirty way - I don't like it and other users could benefit from it, if me and other Windows developers were able to assist. To be frank, Windows has by far the highest OS share - I'm not sure why you would exclude that one, of all.
@JamesCullum I've never said we want to keep away free developer resources, please read what I said again.
Do you really think we don't want it to work on Windows?
I've just said, we don't have resources, and time to work on this issue, and you a WELCOME to contribute, we are not against contribution and helping other users.
So please, feel free and shoot any Pull Request you think could help the project ;)
Of course it would be nice to work on Windows. I mean that setting it as low-priority and fix-whenever will make it impossible for other developers to help. This will make the backlog longer and longer, as less developers are working on it. And this in return will keep the windows compatibility away forever.
So while you would appreciate it working on Windows, it won't be available on it by itself. The used technology stack is very specific and no one is apparently able to debug this issue on why the files do not get build. This means that the only people realistically fixing it anytime soon would be the people who don't use Windows and have no interest in fixing it, considering its a low priority.
Maybe this is the misunderstanding - I know that you would like to have it fixed. I am just saying that this is unlikely to be fixed with this approach.
The low-priority
label is juste something we use to priorities the effort we put on the issues, it's not to tell the other developer to not consider working on the issue.
If you think that removing this label is a good idea, then, ok I can do it :)
@JamesCullum can you confirm the pull-request done by @billmurrin solves your problem ?
I've implemented this already. See
- (Prevent error by adding ".cmd" to npm, bower and grunt process calls in project/FrontEnd.scala)
This does fix it failing completely, but does not fix the compiling crash.
@JamesCullum I compiled mine using the develop branch from elastic4play, 1.6.0
git clone https://github.com/TheHive-Project/elastic4play.git
cd elastic4play
git checkout develop
sbt +publishLocal
In TheHive Project (I'm also using develop branch), modify project/Dependencies
val elastic4play = "org.thehive-project" %% "elastic4play" % "1.6.0-SNAPSHOT"
Now if you try to compile on Windows with bin\activator clean stage
, does it work?
I believe the 1.6.0 elastic4play will be merged into master when 3.1.0 is released at the end of the month.
Where do you put the folders? Can you give me your folder structure?
I only find folders with that name inside dynamically generated target
folders.
Hi @JamesCullum,
I have elastic4play and TheHive in their own folders.
Something like
C:\Projects\elastic4play
C:\Projects\TheHive
The git clone command I put above would be executed from within C:\Projects
folder so that it creates the elastic4play
directory.
After you clone the repo, cd into the elastic4play folder, checkout develop git checkout develop
, then build the plugin with sbt +publishLocal
. From there, go back into TheHive folder cd C:\Projects\TheHive
, update the project\Dependencies
file with the 1.6.0-SNAPSHOT
version of elastic4play, and then build the project with bin\activator clean stage
.
When you compile TheHive, it will pull the compiled elastic4play 1.6.0-SNAPSHOT from your local repository, the path is something like C:\Users\YOUR_USER\.ivy2\local\org.thehive-project\elastic4play_2.12\1.6.0-SNAPSHOT
.
I hope that helps.
Thank you for the assistance. I've did it exactly like you described and it found and used the new elastic4play version. However, the error itself stays the same: java.nio.file.NoSuchFileException: C:\TheHive3\thehive-backend\target\web\classes\main
Aloha @JamesCullum, is this the same TheHive folder that you've been building within?
If so, I've found that clearing the contents of the target directory to be helpful with clearing errors generated by previous builds.
Not sure if all data is purged between builds despite using clean, it seems that cleanFiles
can be used to purge all generated content. Related thread: https://groups.google.com/forum/#!topic/play-framework/7daFsYtKExs
I can confirm this is the solution to build on Windows. No error messages are shown, it works great! Thanks @billmurrin
Thank you @billmurrin for the assistance. I've deleted all target
folders, but still get the same issue. However, do I understand it correctly that now this is a local issue?
@axpatito @billmurrin Which OS are you using exactly? Are you not even getting the error with timestamps, which requires one of the workarounds?
Hi @JamesCullum.
I'm not getting any errors back related to timestamps. I'm testing on Win 10 Pro.
Just to test, I tried adding the sbtconfig.txt file like you did and it still built without any errors on my end.
On the error you posted with the stack trace above, it referenced line 31 of FrontEnd.scala. Would you mind pasting that section here?
Hey @billmurrin,
Thank you for the strong support! Please find below my latest stack trace below. It does not refer to FrontEnd.scala anymore (and I do not have the original file anymore).
[error] java.nio.file.NoSuchFileException: C:\TheHive3\thehive-backend\target\web\classes\main
[error] at sun.nio.fs.WindowsException.translateToIOException(Unknown Source)
[error] at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
[error] at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
[error] at sun.nio.fs.WindowsFileAttributeViews$Basic.readAttributes(Unknown Source)
[error] at sun.nio.fs.WindowsFileAttributeViews$Basic.readAttributes(Unknown Source)
[error] at sun.nio.fs.WindowsFileSystemProvider.readAttributes(Unknown Source)
[error] at java.nio.file.Files.readAttributes(Unknown Source)
[error] at java.nio.file.Files.getLastModifiedTime(Unknown Source)
[error] at sbt.internal.io.JavaMilli$.getModifiedTime(Milli.scala:321)
[error] at sbt.internal.io.Milli$.getModifiedTime(Milli.scala:352)
[error] at sbt.io.IO$.getModifiedTime(IO.scala:1143)
[error] at sbt.io.IO$.getModifiedTimeOrZero(IO.scala:1212)
[error] at sbt.util.FileInfo$lastModified$.apply(FileInfo.scala:150)
[error] at sbt.util.FileInfo$lastModified$.apply(FileInfo.scala:125)
[error] at sbt.util.FileInfo$Style.$anonfun$apply$1(FileInfo.scala:62)
[error] at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:234)
[error] at scala.collection.immutable.HashSet$HashSet1.foreach(HashSet.scala:320)
[error] at scala.collection.immutable.HashSet$HashTrieSet.foreach(HashSet.scala:976)
[error] at scala.collection.immutable.HashSet$HashTrieSet.foreach(HashSet.scala:976)
[error] at scala.collection.TraversableLike.map(TraversableLike.scala:234)
[error] at scala.collection.TraversableLike.map$(TraversableLike.scala:227)
[error] at scala.collection.AbstractSet.scala$collection$SetLike$$super$map(Set.scala:47)
[error] at scala.collection.SetLike.map(SetLike.scala:101)
[error] at scala.collection.SetLike.map$(SetLike.scala:101)
[error] at scala.collection.AbstractSet.map(Set.scala:47)
[error] at sbt.util.FileInfo$Style.apply(FileInfo.scala:62)
[error] at sbt.util.FileInfo$Style.apply$(FileInfo.scala:62)
[error] at sbt.util.FileInfo$lastModified$.apply(FileInfo.scala:125)
[error] at sbt.RawCompileLike$.$anonfun$cached$1(RawCompileLike.scala:58)
[error] at sbt.RawCompileLike$.$anonfun$cached$1$adapted(RawCompileLike.scala:52)
[error] at sbt.Defaults$.$anonfun$docTaskSettings$3(Defaults.scala:1307)
[error] at scala.Function1.$anonfun$compose$1(Function1.scala:44)
[error] at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:39)
[error] at sbt.std.Transform$$anon$4.work(System.scala:66)
[error] at sbt.Execute.$anonfun$submit$2(Execute.scala:262)
[error] at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
[error] at sbt.Execute.work(Execute.scala:271)
[error] at sbt.Execute.$anonfun$submit$1(Execute.scala:262)
[error] at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:174)
[error] at sbt.CompletionService$$anon$2.call(CompletionService.scala:36)
[error] at java.util.concurrent.FutureTask.run(Unknown Source)
[error] at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
[error] at java.util.concurrent.FutureTask.run(Unknown Source)
[error] at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
[error] at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
[error] at java.lang.Thread.run(Unknown Source)
[error] java.nio.file.NoSuchFileException: C:\TheHive3\thehive-backend\target\web\classes\main
[error] at sun.nio.fs.WindowsException.translateToIOException(Unknown Source)
[error] at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
[error] at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
[error] at sun.nio.fs.WindowsFileAttributeViews$Basic.readAttributes(Unknown Source)
[error] at sun.nio.fs.WindowsFileAttributeViews$Basic.readAttributes(Unknown Source)
[error] at sun.nio.fs.WindowsFileSystemProvider.readAttributes(Unknown Source)
[error] at java.nio.file.Files.readAttributes(Unknown Source)
[error] at java.nio.file.Files.getLastModifiedTime(Unknown Source)
[error] at sbt.internal.io.JavaMilli$.getModifiedTime(Milli.scala:321)
[error] at sbt.internal.io.Milli$.getModifiedTime(Milli.scala:352)
[error] at sbt.io.IO$.getModifiedTime(IO.scala:1143)
[error] at sbt.io.IO$.getModifiedTimeOrZero(IO.scala:1212)
[error] at sbt.util.FileInfo$lastModified$.apply(FileInfo.scala:150)
[error] at sbt.util.FileInfo$lastModified$.apply(FileInfo.scala:125)
[error] at sbt.util.FileInfo$Style.$anonfun$apply$1(FileInfo.scala:62)
[error] at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:234)
[error] at scala.collection.immutable.HashSet$HashSet1.foreach(HashSet.scala:320)
[error] at scala.collection.immutable.HashSet$HashTrieSet.foreach(HashSet.scala:976)
[error] at scala.collection.immutable.HashSet$HashTrieSet.foreach(HashSet.scala:976)
[error] at scala.collection.TraversableLike.map(TraversableLike.scala:234)
[error] at scala.collection.TraversableLike.map$(TraversableLike.scala:227)
[error] at scala.collection.AbstractSet.scala$collection$SetLike$$super$map(Set.scala:47)
[error] at scala.collection.SetLike.map(SetLike.scala:101)
[error] at scala.collection.SetLike.map$(SetLike.scala:101)
[error] at scala.collection.AbstractSet.map(Set.scala:47)
[error] at sbt.util.FileInfo$Style.apply(FileInfo.scala:62)
[error] at sbt.util.FileInfo$Style.apply$(FileInfo.scala:62)
[error] at sbt.util.FileInfo$lastModified$.apply(FileInfo.scala:125)
[error] at sbt.RawCompileLike$.$anonfun$cached$1(RawCompileLike.scala:58)
[error] at sbt.RawCompileLike$.$anonfun$cached$1$adapted(RawCompileLike.scala:52)
[error] at sbt.Defaults$.$anonfun$docTaskSettings$3(Defaults.scala:1307)
[error] at scala.Function1.$anonfun$compose$1(Function1.scala:44)
[error] at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:39)
[error] at sbt.std.Transform$$anon$4.work(System.scala:66)
[error] at sbt.Execute.$anonfun$submit$2(Execute.scala:262)
[error] at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
[error] at sbt.Execute.work(Execute.scala:271)
[error] at sbt.Execute.$anonfun$submit$1(Execute.scala:262)
[error] at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:174)
[error] at sbt.CompletionService$$anon$2.call(CompletionService.scala:36)
[error] at java.util.concurrent.FutureTask.run(Unknown Source)
[error] at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
[error] at java.util.concurrent.FutureTask.run(Unknown Source)
[error] at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
[error] at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
[error] at java.lang.Thread.run(Unknown Source)
[INFO] [07/23/2018 09:54:24.310] [Thread-2] [CoordinatedShutdown(akka://sbt-web)] Starting coordinated shutdown from JVM shutdown hook
[error] java.nio.file.NoSuchFileException: C:\TheHive3\thehive-backend\target\web\classes\main
[error] at sun.nio.fs.WindowsException.translateToIOException(Unknown Source)
[error] at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
[error] at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
[error] at sun.nio.fs.WindowsFileAttributeViews$Basic.readAttributes(Unknown Source)
[error] at sun.nio.fs.WindowsFileAttributeViews$Basic.readAttributes(Unknown Source)
[error] at sun.nio.fs.WindowsFileSystemProvider.readAttributes(Unknown Source)
[error] at java.nio.file.Files.readAttributes(Unknown Source)
[error] at java.nio.file.Files.getLastModifiedTime(Unknown Source)
[error] at sbt.internal.io.JavaMilli$.getModifiedTime(Milli.scala:321)
[error] at sbt.internal.io.Milli$.getModifiedTime(Milli.scala:352)
[error] at sbt.io.IO$.getModifiedTime(IO.scala:1143)
[error] at sbt.io.IO$.getModifiedTimeOrZero(IO.scala:1212)
[error] at sbt.util.FileInfo$lastModified$.apply(FileInfo.scala:150)
[error] at sbt.util.FileInfo$lastModified$.apply(FileInfo.scala:125)
[error] at sbt.util.FileInfo$Style.$anonfun$apply$1(FileInfo.scala:62)
[error] at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:234)
[error] at scala.collection.immutable.HashSet$HashSet1.foreach(HashSet.scala:320)
[error] at scala.collection.immutable.HashSet$HashTrieSet.foreach(HashSet.scala:976)
[error] at scala.collection.immutable.HashSet$HashTrieSet.foreach(HashSet.scala:976)
[error] at scala.collection.TraversableLike.map(TraversableLike.scala:234)
[error] at scala.collection.TraversableLike.map$(TraversableLike.scala:227)
[error] at scala.collection.AbstractSet.scala$collection$SetLike$$super$map(Set.scala:47)
[error] at scala.collection.SetLike.map(SetLike.scala:101)
[error] at scala.collection.SetLike.map$(SetLike.scala:101)
[error] at scala.collection.AbstractSet.map(Set.scala:47)
[error] at sbt.util.FileInfo$Style.apply(FileInfo.scala:62)
[error] at sbt.util.FileInfo$Style.apply$(FileInfo.scala:62)
[error] at sbt.util.FileInfo$lastModified$.apply(FileInfo.scala:125)
[error] at sbt.RawCompileLike$.$anonfun$cached$1(RawCompileLike.scala:58)
[error] at sbt.RawCompileLike$.$anonfun$cached$1$adapted(RawCompileLike.scala:52)
[error] at sbt.Defaults$.$anonfun$docTaskSettings$3(Defaults.scala:1307)
[error] at scala.Function1.$anonfun$compose$1(Function1.scala:44)
[error] at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:39)
[error] at sbt.std.Transform$$anon$4.work(System.scala:66)
[error] at sbt.Execute.$anonfun$submit$2(Execute.scala:262)
[error] at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
[error] at sbt.Execute.work(Execute.scala:271)
[error] at sbt.Execute.$anonfun$submit$1(Execute.scala:262)
[error] at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:174)
[error] at sbt.CompletionService$$anon$2.call(CompletionService.scala:36)
[error] at java.util.concurrent.FutureTask.run(Unknown Source)
[error] at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
[error] at java.util.concurrent.FutureTask.run(Unknown Source)
[error] at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
[error] at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
[error] at java.lang.Thread.run(Unknown Source)
[error] (thehiveMetrics / Compile / doc) java.nio.file.NoSuchFileException: C:\TheHive3\thehive-backend\target\web\classes\main
[error] (thehiveMisp / Compile / doc) java.nio.file.NoSuchFileException: C:\TheHive3\thehive-backend\target\web\classes\main
[error] (thehiveCortex / Compile / doc) java.nio.file.NoSuchFileException: C:\TheHive3\thehive-backend\target\web\classes\main
Request Type
Bug
Work Environment
Problem Description
I would like to set up a local dev environment to add features. I am inside a corporate environment and have the necessary proxy variables set. I followed the instructions to build it from source, but only get an error during compilation, preventing me from proceeding:
java.nio.file.NoSuchFileException: C:\TheHive2\thehive-backend\target\web\classes\main
I tried to fix it myself but was unable to get any information about this call. I didn't find any place that refers to this file or folder. I was unable to find the command that gets called at this point.
I was already able to get around a few errors on the way and will create a PR to fix those, once I've got everything set up.
Steps to Reproduce
conf/sbtconfig.txt
with content-Dsbt.io.jdktimestamps=true
)project/FrontEnd.scala
)Complementary information