How to fix "Could not find or load main class com.install4j.runtime.launcher.UnixLauncher" error when starting the nexus service - redhat

Operating system: Red Hat Entreprise Linux server release 7.7
nexus version: 3.18.1-01
When renewing the SSL certificate of Nexus on the server, I first replaced the old certificate under /opt/nexus/etc/ssl with the new one.
I put a new keystore with the new certificate and the same password as before with the same name in the same place and then ran /opt/nexus/bin/nexus restart.
Before the service was running and the URL was reachable, but since then I get the following error:
Could not find or load main class
com.install4j.runtime.launcher.UnixLauncher.
And the command journalctl -u nexus gives the following error:
Failed to start nexus service.
Failed at step EXEC spawning /var/nexus/bin/nexus: Permission denied.
i tried a lot of things i found on the internet to fix this but unfortunately without success.
put the nexus user in the nexus.rc file
run_as_user="nexus"
In the beginning it was like this:
#run_as_user=""
That means, the nexus server is run with root and I tried to run it with the user nexus. Unfortunately this did not work.
I also tried the following:
changed the permission and owner for the "/opt/nexus" and "/var/nexus" folders (tested with root and nexus too).
moved the file .install4j to /opt/nexus/
at the end I wanted to test again with the old certificate and renamed the new one und the new key. I thought it was because of the new certificate.... But I still get the same error:
Could not find or load main class
com.install4j.runtime.launcher.UnixLauncher
Something is wrong since I stopped and restarted the nexus service but i don't know what exactly.
Can you help me please? I would be very grateful.

Check the ownership of the PID file:
https://help.sonatype.com/display/NXRM3/Run+as+a+Service#RunasaService-PIDFile

Related

How to resolve "Unable to resolve host" in OpenStack Yoga?

I’m trying to install Openstack on CentOS Stream 9 by following the official openstack installation guide for Yoga available at: https://docs.openstack.org/install-guide/
When I try to bootstrap keystone I get the following error:
/etc/keystone/fernet-keys/ does not exist. PFA the first screenshot
When I tried to create a domain using openstack domain create --description "An Example Domain" example it failed. Upon pinging controller I found out that the machine could not resolve the controller. Next, I added an entry to /etc/hosts that explicitly resolved the controller to my machine’s IP
Pinging the controller succeeded but I was still not able to create a domain
I tried creating a project using ‘openstack project create --domain default --description "Service Project" service’ This command failed with internal server error.
What should I do to resolve these errors?

Keycloak start failed: org.eclipse.microprofile.context-propagation.microprofile-context-propagation-api-1.2.jar does not exist

I follow this Keycloak guide to start Keycloak on my server. I am receiving the next exception when running the bin/kc.sh start-dev command:
ERROR: Failed to run 'build' command.
ERROR: java.lang.IllegalArgumentException: /srv/keycloak/lib/lib/main/org.eclipse.microprofile.context-propagation.microprofile-context-propagation-api-1.2.jar does not exist
ERROR: /srv/keycloak/lib/lib/main/org.eclipse.microprofile.context-propagation.microprofile-context-propagation-api-1.2.jar does not exist
ERROR: /srv/keycloak/lib/lib/main/org.eclipse.microprofile.context-propagation.microprofile-context-propagation-api-1.2.jar
For more details run the same command passing the '--verbose' option. Also you can use '--help' to see the details about the usage of the particular command.
The Keycloak version is 18.0.1, the installed JDK version is 11.0.15, the OS is Debian 11
Can anyone tell me how to solve it? Thanks
It turned out that some of the jars were missing after extracting the loaded Keycloak 18.0.2 tar.gz file on the server. After replacing the jars under keycloak/lib/lib/main and keycloak/lib/lib/deployment I was able to start the Keycloak. To do that, I extracted Keycloak 18.0.2 tar.gz on my local machine and uploaded corresponding jars to the server machine.

Manage to connect through the terminal, but not through the remote explorer

I am coming from notepad, and am learning how to work with VS Code.
I am now trying to access my online repertory on the webserver.
I followed up the guide here: https://code.visualstudio.com/docs/remote/ssh
I did manage to access my server through the terminal window.
(ssh user#domain + password).
When connecting, this shows in the log:
"Linux infong-eu27 4.4.246-icpu-061 #2 SMP Thu Nov 26 10:58:41 UTC 2020 x86_64"
This tells me that it is working on Linux.
If I type "Ls", I can see my folders and navigate among them.
So far, so good!
Second phase: Connecting through the remote explorer.
Step 1:
I configured the ssh with the same credentials I used with the terminal.
Step 2:
I am opening the remote explorer, I can see my server's name. I right click on it and select "connect".
Step 3:
I am then asking to choose the system. I am picking Linux as shown earlier when connecting through the terminal.
Step 4: I am entering the same password I used before to connect in the terminal.
Step 5: Infinite loading, or a very long one till I get 2 notifications / errors:
Could not fetch remote environment
Failed to connect to the remote extension host (error time limit..)
That being said, it also says in the bottom left corner, in the "remote window", that I am connected. This does not seems right.
Any chance someone could help?
I am frustrated because it connects in 1s using the terminal, but not in the remote explorer.
UPDATE:
I found this article on medium that paraphrases the official documentation.
https://medium.com/#sujaypillai/connect-to-your-remote-servers-from-visual-studio-code-eb5a5875e348
I managed, through Git bash, to create a ssh pair key, and managed to copy one on my server.
I then followed the instructions on how to set it up on VS Code successfully!
Now, when I try to connect, I am asked for my key pass:
But, when I do: super long loading, and the same error message.
When I looked on my server with a sftp software, I see that VS did manage to connect as files were installed in a VS folder it created:
This is reported in issue 4415 (no answer) and issue 4204
The last one includes:
This might be caused by our new automatic port forwarding feature which scans the remote OS for available ports in order to forward them locally (microsoft/vscode#112843)
This is fixed by PR 113342, for the next 1.54 Feb. 2021 release. That bug is about setting remote.autoForwardPorts to false and... still seeing VSCode auto-forward ports!
Check on your server (while VSCode attempts to connect) if:
the CPU is high
if there are any services running on public port on said server
I solved a similar issue by following the error logs from the remote ssh extension. I had to install libatomic1 on the remote server with
sudo apt-get install libatomic1

SSSD on docker container (Ubuntu)

I am trying to integrate ubuntu docker container with FreeIPA and getting below error while installing FreeIPA-client --install
Created /etc/ipa/default.conf
New SSSD config will be created
Configured sudoers in /etc/nsswitch.conf
Configured /etc/sssd/sssd.conf
Configured /etc/krb5.conf for IPA realm BLABS.COM
trying https://vilma.com/ipa/json
Forwarding 'ping' to json server 'https://vilma.com/ipa/json'
Forwarding 'ca_is_enabled' to json server 'https://vilma.com/ipa/json'
Systemwide CA database updated.
Adding SSH public key from /etc/ssh/ssh_host_dsa_key.pub
Adding SSH public key from /etc/ssh/ssh_host_ed25519_key.pub
Adding SSH public key from /etc/ssh/ssh_host_ecdsa_key.pub
Adding SSH public key from /etc/ssh/ssh_host_rsa_key.pub
Forwarding 'host_mod' to json server 'https://vilma/ipa/json'
SSSD enabled
SSSD service restart was unsuccessful.
Configured /etc/openldap/ldap.conf
Unable to find 'admin' user with 'getent passwd admin#vilma.com'!
Unable to reliably detect configuration. Check NSS setup manually.
NTP enabled
I tried to start sssd manually by typing sssd and getting below message
ldb: unable to open modules directory '/usr/lib/x86_64-linux-gnu/ldb/modules/ldb' - Permission denied
(Sun Oct 14 20:55:17:078716 2018) [sssd] [load_configuration] (0x0010): The confdb initialization failed
(Sun Oct 14 20:55:17:078750 2018) [sssd] [main] (0x0020): SSSD couldn't load the configuration database.
I appreciate your help
In case anyone else runs into this, the problem is that the overlayfs that docker uses causes problems with the ldb database that sssd is using.
So you need to:
move /usr/lib/x86_64-linux-gnu/ldb/modules/ldb to another path (e.g. /usr/lib/x86_64-linux-gnu/ldb/modules/ldb-orig) in your Dockerfile
then, before starting sssd in your container, you have to create an empty volume and mount it into /usr/lib/x86_64-linux-gnu/ldb/modules/ldb
then copy the original contents of /usr/lib/x86_64-linux-gnu/ldb/modules/ldb from /usr/lib/x86_64-linux-gnu/ldb/modules/ldb-orig into the new volume
then start sssd
This seems to be fixed with Linux 5.8. I think it was this fix, but I'm not sure.
I could able to manage workaround by not using sssd (--no-sssd option)

issue with kinit after freeipa installation

I installed freeipa on centos7 - the installation did not throw any errors nor could I find anything unusual in the ipa install log file. However, when I run the kinit command post installation, I get the following response:
kinit admin
kinit: Generic error (see e-text) while getting initial credentials
Any thoughts on how to go about troubleshooting this?
Edit:
In the /var/log/krb5kdc.log file, I see the following entry:
preauth pkinit failed to initialize: PKINIT initialization failed: Cannot read cert
ificate file '/var/kerberos/krb5kdc/kdc.crt': No such file or directory
I ran the installation on centos and kinit works fine (I had to ensure that I was specifying the correct domain name during the installation script).