ansible-ThoTeam / nexus3-oss

Ansible role to install and provision sonatype nexus3-oss
GNU General Public License v3.0
288 stars 206 forks source link

Role freezes when waiting for nexus service #244

Closed FinalFortune closed 4 years ago

FinalFortune commented 4 years ago

Trying to run the role on an azure Linux machine (ubuntu). Linux BuildServerTest 5.0.0-1031-azure #33-Ubuntu SMP Thu Feb 6 22:26:13 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

nexus installs but freezes when waiting on this task: RUNNING HANDLER [ansible-thoteam.nexus3-oss : wait-for-nexus] *********************************************************************************************************

systemctl status provides the following log:

Feb 14 12:25:14 BuildServerTest systemd[1]: Starting nexus service...
Feb 14 12:25:14 BuildServerTest nexus[54498]: No suitable Java Virtual Machine could be found on your system.
Feb 14 12:25:14 BuildServerTest nexus[54498]: The version of the JVM must be 1.8.
Feb 14 12:25:14 BuildServerTest nexus[54498]: Please define INSTALL4J_JAVA_HOME to point to a suitable JVM.
Feb 14 12:25:14 BuildServerTest systemd[1]: nexus.service: Control process exited, code=exited status=83
Feb 14 12:25:14 BuildServerTest systemd[1]: nexus.service: Failed with result 'exit-code'.
Feb 14 12:25:14 BuildServerTest systemd[1]: Failed to start nexus service.

I'm using the roles as suggested:

  roles:
    - { role: geerlingguy.java }
    - { role: ansible-thoteam.nexus3-oss, tags: ['ansible-thoteam.nexus-oss'] }

Java --version:

openjdk 11.0.6 2020-01-14
OpenJDK Runtime Environment (build 11.0.6+10-post-Ubuntu-1ubuntu118.04.1)
OpenJDK 64-Bit Server VM (build 11.0.6+10-post-Ubuntu-1ubuntu118.04.1, mixed mode, sharing)
zeitounator commented 4 years ago

Have a look at the error message in your log The version of the JVM must be 1.8. This is a hard requirement for nexus, as reported in README.md which is itself derived from the official nexus documentation

FinalFortune commented 4 years ago

Ok, it runs now but the role still freezes on that step?

CGroup: /system.slice/nexus.service
           └─81561 /usr/lib/jvm/java-1.8.0-openjdk-amd64/bin/java -server -Dinstall4j.jvmDir=/usr/lib/jvm/java-1.8.0-openjdk-amd64 -Dexe4j.moduleName=/opt/nexus-latest
Feb 14 14:05:51 BuildServerTest systemd[1]: Starting nexus service...
Feb 14 14:05:52 BuildServerTest nexus[81334]: Starting nexus
Feb 14 14:05:52 BuildServerTest systemd[1]: Started nexus service.
zeitounator commented 4 years ago

The handler waiting for nexus is looking for Started Sonatype Nexus .* in your log (i.e. {{ nexus_data_dir }}/log/nexus.log).

Have a look there and see why this piece of string is not being outputted correctly. The timeout is set to 1800 seconds. So it will wait for all that time until it fails if nexus never starts correctly.

FinalFortune commented 4 years ago

Ah thanks, yes I should have looked for nexus's logs first.

VeikkoLehmuskorpi commented 3 years ago

Ah thanks, yes I should have looked for nexus's logs first.

Did you ever solve this? I'm facing the same issue and the log file doesn't even get created.

Edit: Solved it by increasing VM memory to 4GB.