Hello Ilya
I have been working to install a local test instance of wlxjury. I more or less configured it (not all things are clear, and for greater confusion, there are two different configuration files: application.ini and application.conf), but it failed with an OutOfMemoryError at the first request (see log below). Any idea?
Regarding the configuration, what is the commons.user for? Should the database be initialised in any way, or does it do it automatically?
Best
(...) [SUCCESSFUL ] org.scala-sbt#test-agent;0.13.12!test-agent.jar (1685ms) downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/apply-macro/0.... ... [SUCCESSFUL ] org.scala-sbt#apply-macro;0.13.12!apply-macro.jar (1722ms) :: retrieving :: org.scala-sbt#boot-app confs: [default] 49 artifacts copied, 0 already retrieved (17462kB/27ms) sbt appears to be exiting abnormally. The log file for this session is at /tmp/sbt7109374493874656189.log java.lang.OutOfMemoryError: GC overhead limit exceeded at java.io.UnixFileSystem.resolve(UnixFileSystem.java:108) at java.io.File.<init>(File.java:367) at sbt.FilterFiles$$anonfun$handleFile$1.apply(Path.scala:204) at sbt.FilterFiles$$anonfun$handleFile$1.apply(Path.scala:203) at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33) at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:108) at sbt.FilterFiles.handleFile(Path.scala:203) at sbt.DescendantOrSelfPathFinder.sbt$DescendantOrSelfPathFinder$$handleFileDescendant(Path.scala:215) at sbt.DescendantOrSelfPathFinder$$anonfun$sbt$DescendantOrSelfPathFinder$$handleFileDescendant$1.apply(Path.scala:217) at sbt.DescendantOrSelfPathFinder$$anonfun$sbt$DescendantOrSelfPathFinder$$handleFileDescendant$1.apply(Path.scala:216) at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33) at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:108) at sbt.DescendantOrSelfPathFinder.sbt$DescendantOrSelfPathFinder$$handleFileDescendant(Path.scala:216) at sbt.DescendantOrSelfPathFinder$$anonfun$sbt$DescendantOrSelfPathFinder$$handleFileDescendant$1.apply(Path.scala:217) at sbt.DescendantOrSelfPathFinder$$anonfun$sbt$DescendantOrSelfPathFinder$$handleFileDescendant$1.apply(Path.scala:216) at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33) at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:108) at sbt.DescendantOrSelfPathFinder.sbt$DescendantOrSelfPathFinder$$handleFileDescendant(Path.scala:216) at sbt.DescendantOrSelfPathFinder$$anonfun$sbt$DescendantOrSelfPathFinder$$handleFileDescendant$1.apply(Path.scala:217) at sbt.DescendantOrSelfPathFinder$$anonfun$sbt$DescendantOrSelfPathFinder$$handleFileDescendant$1.apply(Path.scala:216) at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33) at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:108) at sbt.DescendantOrSelfPathFinder.sbt$DescendantOrSelfPathFinder$$handleFileDescendant(Path.scala:216) at sbt.DescendantOrSelfPathFinder$$anonfun$sbt$DescendantOrSelfPathFinder$$handleFileDescendant$1.apply(Path.scala:217) at sbt.DescendantOrSelfPathFinder$$anonfun$sbt$DescendantOrSelfPathFinder$$handleFileDescendant$1.apply(Path.scala:216) at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33) at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:108) at sbt.DescendantOrSelfPathFinder.sbt$DescendantOrSelfPathFinder$$handleFileDescendant(Path.scala:216) at sbt.DescendantOrSelfPathFinder$$anonfun$sbt$DescendantOrSelfPathFinder$$handleFileDescendant$1.apply(Path.scala:217) at sbt.DescendantOrSelfPathFinder$$anonfun$sbt$DescendantOrSelfPathFinder$$handleFileDescendant$1.apply(Path.scala:216) at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33) at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:108) Error during sbt execution: java.lang.OutOfMemoryError: GC overhead limit exceeded
Hi,
Regarding java.lang.OutOfMemoryError, by default Java sets it MaxHeapSize size to about FreeMemory / 4, looks like this is not enough. You can see the MaxHeapSize by running java -XX:+PrintFlagsFinal -version | grep MaxHeapSize And you can set it in JAVA_OPTS (for any java process) or SBT_OPTS (just for sbt) environment variables, like this export SBT_OPTS="-Xmx250m" (sets max heap 250MB)
This error was in sbt, so this means you are in development mode - compiling the application, you don't need sbt to run application in production mode (packaged by sbt stage/dist etc.)
Main configuration file is application.conf. application.ini is for options to packager (to staged directory, zip,deb,rpm). yes, it is confusing.
commons.user is intended to have bigger than default limits for querying the commons via API, but not used yet, and can be just deleted or commented out (I already did it)
Database is initialised by https://flywaydb.org/ from sql scripts in conf/db/migration/default. On the first run in development mode the application will ask to run these.
User is not created yet automatically, so you'll have to setup at least one by SQL, like this INSERT INTO wlxjury.users (fullname, email, created_at, deleted_at, password, roles, contest, lang) VALUES ('Ilya (WLE Jury Admin)', ' intracer+2016@gmail.com', '2016-06-10 18:40:05', null, 'sha1 password hash', 'root', null, 'en');
Now I'm implementing the sign in feature, so this first user will be able to sign in himself :)
Regards, Ilya
On Wed, Aug 10, 2016 at 6:39 PM, Platonides platonides@gmail.com wrote:
Hello Ilya
I have been working to install a local test instance of wlxjury. I more or less configured it (not all things are clear, and for greater confusion, there are two different configuration files: application.ini and application.conf), but it failed with an OutOfMemoryError at the first request (see log below). Any idea?
Regarding the configuration, what is the commons.user for? Should the database be initialised in any way, or does it do it automatically?
Best
(...) [SUCCESSFUL ] org.scala-sbt#test-agent;0.13.12!test-agent.jar (1685ms) downloading https://repo.typesafe.com/typesafe/ivy-releases/org. scala-sbt/apply-macro/0.13.12/jars/apply-macro.jar ... [SUCCESSFUL ] org.scala-sbt#apply-macro;0.13.12!apply-macro.jar (1722ms) :: retrieving :: org.scala-sbt#boot-app confs: [default] 49 artifacts copied, 0 already retrieved (17462kB/27ms) sbt appears to be exiting abnormally. The log file for this session is at /tmp/sbt7109374493874656189.log java.lang.OutOfMemoryError: GC overhead limit exceeded at java.io.UnixFileSystem.resolve(UnixFileSystem.java:108) at java.io.File.<init>(File.java:367) at sbt.FilterFiles$$anonfun$handleFile$1.apply(Path.scala:204) at sbt.FilterFiles$$anonfun$handleFile$1.apply(Path.scala:203) at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized. scala:33) at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:108) at sbt.FilterFiles.handleFile(Path.scala:203) at sbt.DescendantOrSelfPathFinder.sbt$DescendantOrSelfPathFinder$$ handleFileDescendant(Path.scala:215) at sbt.DescendantOrSelfPathFinder$$anonfun$sbt$ DescendantOrSelfPathFinder$$handleFileDescendant$1.apply(Path.scala:217) at sbt.DescendantOrSelfPathFinder$$anonfun$sbt$ DescendantOrSelfPathFinder$$handleFileDescendant$1.apply(Path.scala:216) at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized. scala:33) at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:108) at sbt.DescendantOrSelfPathFinder.sbt$DescendantOrSelfPathFinder$$ handleFileDescendant(Path.scala:216) at sbt.DescendantOrSelfPathFinder$$anonfun$sbt$ DescendantOrSelfPathFinder$$handleFileDescendant$1.apply(Path.scala:217) at sbt.DescendantOrSelfPathFinder$$anonfun$sbt$ DescendantOrSelfPathFinder$$handleFileDescendant$1.apply(Path.scala:216) at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized. scala:33) at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:108) at sbt.DescendantOrSelfPathFinder.sbt$DescendantOrSelfPathFinder$$ handleFileDescendant(Path.scala:216) at sbt.DescendantOrSelfPathFinder$$anonfun$sbt$ DescendantOrSelfPathFinder$$handleFileDescendant$1.apply(Path.scala:217) at sbt.DescendantOrSelfPathFinder$$anonfun$sbt$ DescendantOrSelfPathFinder$$handleFileDescendant$1.apply(Path.scala:216) at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized. scala:33) at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:108) at sbt.DescendantOrSelfPathFinder.sbt$DescendantOrSelfPathFinder$$ handleFileDescendant(Path.scala:216) at sbt.DescendantOrSelfPathFinder$$anonfun$sbt$ DescendantOrSelfPathFinder$$handleFileDescendant$1.apply(Path.scala:217) at sbt.DescendantOrSelfPathFinder$$anonfun$sbt$ DescendantOrSelfPathFinder$$handleFileDescendant$1.apply(Path.scala:216) at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized. scala:33) at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:108) at sbt.DescendantOrSelfPathFinder.sbt$DescendantOrSelfPathFinder$$ handleFileDescendant(Path.scala:216) at sbt.DescendantOrSelfPathFinder$$anonfun$sbt$ DescendantOrSelfPathFinder$$handleFileDescendant$1.apply(Path.scala:217) at sbt.DescendantOrSelfPathFinder$$anonfun$sbt$ DescendantOrSelfPathFinder$$handleFileDescendant$1.apply(Path.scala:216) at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized. scala:33) at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:108) Error during sbt execution: java.lang.OutOfMemoryError: GC overhead limit exceeded
Hello Ilya
Thanks for the info. The manual user creation is no problem... now I am aware of the trap ☺
I am a bit surprised about the java default, but will try setting it manually.
How should the application be run instead? I thought you needed to use 'sbt run'.
FWIW, here is the Dockerfile I am using: FROM debian:jessie RUN echo deb http://ftp.debian.org/debian jessie-backports main > /etc/apt/sources.list.d/backports. list && apt-get update RUN apt-get install -y openjdk-8-jre # From jessie-backports RUN apt-get install -y scala git
RUN echo deb http://dl.bintray.com/sbt/debian / > /etc/apt/sources.list.d/sbt.list && \ apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2EE0EA64E40A89B84B2DF73499E82A75642AC8 23 && \ sed -i 's/^/#/' /etc/apt/apt.conf.d/01proxy && \ apt-get update && apt-get install -y sbt
RUN useradd -m wlxjury RUN chown wlxjury /opt RUN su -c "cd /opt && git clone https://github.com/intracer/wlxjury && \ cd wlxjury && sbt" wlxjury
EXPOSE 8080 # port set in application.conf CMD ["su", "-c", "sbt run", "wlxjury"]
Best regards
wikilovesmonuments@lists.wikimedia.org