Sonatype Nexus only starting in console mode - nexus

I installed Nexus 3.6.0-02 on Redhat 7.4.
I am able to get Nexus to start in console mode by running the command: ./nexus run
If I try and start nexus as a service per the following documentation, nothing happens.
https://help.sonatype.com/display/NXRM3/Run+as+a+Service
If I run the command ./nexus start, the application does not start and there is nothing written into any nexus logs indicating why it failed to start.
The install and sonatype-work directories are all owned by the user who I have configured Nexus to run as.
Any ideas as to where to look or troubleshoot to figure this problem out.
Thanks

In my case I am using nexus 3 . I resolved this by deleting lock file placed inside nexus3 folder of sonatype folder and restart it by nexus start command.

Make sure the "run_as_user" configured in $install_dir/bin/nexus.rc has permissions to write to the installation directory and the work directory. And make sure they have a login shell, that is required for the startup script to work.

Related

Nexus OSS does not start

I'm trying to install nexus 3.38 on a debian 10 system. I use aodoptopenjdk-8... as Java runtime.
When I try running it as a systemd sevrice nexus does not start. There are no usable logs.
Whe I try running nexus directly with command nexus start-launchd (virtually the same as nexus start) I get the following out put
bin/nexus start-launchd
Starting nexus
Could not resolve mvn:org.apache.felix/org.apache.felix.framework/6.0.5
I look for this library/dependency and find it in {nexus-home}/system/org/apache/felix/org.apache.felix.framework/6.0.5/. But the filename looks crippled org.apache.felix.framework- that's it. No *.jar. The same can be seen with some other dependencies, like other felix stuff or karaf.
Other dependecies in {nexus-home}/system look fine.
If I change the name from org.apache.felix.framework- to org.apache.felix.framework-6.0.5.jar then it looks like this dependency loaded and next stop is karaf.
Do I have to fix all the names of the jar files? Why do I not find other complains about that, is it an error in front of my monitor?
I've seen the same problem with current release of apache karaf. The names of the jar files are crippled.
The content of the folder system of the unix package (*.tar.gz) of nexus 3.38.0-01 is damaged.
I've downloaded the windows package (*.zip) and replaced the system with this version.
Everything looks fine now.

AWS CodeDeploy deployment failed at event ApplicationStop

I am trying to set up auto-deployment from GitHub to AWS, using EC2.
I set Role with CodeDeployServiceRole auto policy
After following the Tutorial: Use AWS CodeDeploy to Deploy an Application from GitHub, my deployment fails at the ApplicationStop event, after trying for couple of minutes with error code HEALTH_CONSTRAINT. I'm not sure how to troubleshoot the issue/where to look.
These are few hints of how you can navigate your way
Logs as mentioned in comments in /var/log/aws/codedeploy-agent
As AWS support recommend you can add for one time --ignore-application-stop-failures so it will skip that step in case it failed last time and see، because the application stop Lifecycle event uses the appspec file from the last successful build so if that one is corrupted somehow this step will fail in the following builds
(not recommended) you can delete the file, that CodeDeploy uses to keep track of the previous successful deployment in the following path /opt/codedeploy-agent/deployment-root/deployment-instructions/
Check the latest logs at /var/log/aws/codedeploy-agent
If your deployment is failing at ApplicationStop event, then most likely the issue is your EC2 instance does not have the necessary permissions to get the artifacts from S3 bucket.
Your EC2 instance must have an IAM role attached which gives it enough permissions to download the artifacts from S3 bucket
Your EC2 must be started with an IAM role. So you may have to reboot your instance after attaching the role to it.
From your configuration, looks like you have provided permissions to CodeDeploy to perform certain actions on your EC2. You may want to check if your EC2 also has the necessary permissions to download packages from S3 bucket.
Another reason for this error is that the CodeDeploy Service is not running on your machine. On Windows machines, Code Deploy Service terminates sometimes, and as a result, the deployment is not downloaded on the machine. Nothing appears in the logs either.
Run services.msc and check the code deploy agent service. If it is not running, start it and retry the deployment.
I had the same issue and solved it by solving codedeploy-agent that wasn't working on my EC2 instance.
sudo service {httpd/apache2} status
Something might have cause the agent not to run properly
Hope it will help
I had the same issue. You also need to make sure that your EC2 instance has code-deploy-agent installed.
Follow the below aws guide. It worked for me.
AWS guide to install code agent in linux server
Check if the codedeploy-agent is running.
sudo service codedeploy-agent status
if not running then use below command to run
sudo service codedeploy-agent start
If you are using aws Windows server, check the logs at :
C:\ProgramData\Amazon\CodeDeploy\log\codedeploy-agent-log.txt
AWS Docs
To check if the codedeployagent running in windows. Open powersheel command window and run these command.
powershell.exe -Command Get-Service -Name codedeployagent
Better to stop and start again.
powershell.exe -Command Stop-Service -Name codedeployagent
powershell.exe -Command Start-Service -Name codedeployagent
Or Restarting also works
powershell.exe -Command Restart-Service -Name codedeployagent
For me I had to uninstall the codedeployagent on windows by uninstalling and deleting old files of codedeploy.
Run the below command in powershell one by one to uninstall.
wmic
product where name="CodeDeploy Host Agent" call uninstall /nointeractive
exit
After this delete the codedeploy folder at this location.
C:\ProgramData/Amazon/CodeDeploy/
Now install codedeployagent on windows.
Start the codedeployagent again.
powershell.exe -Command Start-Service -Name codedeployagent

heroku cli commands not responding on windows 10

I installed heroku cli on windows 10 via exe installer.
When i try to run heroku --version command or heroku login
command, the command window does not respond. It does not give any error.
Then i uninstalled it and installed it using npm install -g heroku-cli
but getting same result.
Node version - 8.7.0
In Windows cmd prompt, do:
echo %USERPROFILE%
Go to your C:\Users\YOURNAME
Look for a file named:
_netrc
This file stores login credentials. Delete it.
Then check for an update:
heroku update
Then try to log in:
heroku login
I saw some people create an environment variable called HOME and add the path to YOURNAME so the environment knows to look for the _netrc file there.
Other trouble-shooting ideas if the above doesn't work for you can be found at Heroku CLI troubleshooting
In windows , run %LOCALAPPDATA%\heroku, completely delete this folder. and check again on cmd by typing heroku --version. Hope this helps.
I ended up uninstalling heroku from the Windows Installer and instead used the standalone tarball.
You can get the tarballs from here.
After you downloaded and extracted it, you can go to your terminal and cd into the directory where you extracted the file and do the following command:
./bin/heroku --version
Whenever you need the heroku CLI, you can cd into the directory where heroku is, then ./bin/heroku is the executable for heroku.

Karaf cannot install war feature

Recently I need to deploy something on Karaf. I use Karaf 3.0.2 and event try 4.0.0M1. Both are not able to install war feature. Once I type feature:install war in console after Karaf start-up.
3.0.2 gives me:
Error executing command: Error resolving artifact org.apache.servicemix.specs:org.apache.servicemix.specs.activation-api-1.1:jar:2.2.0: Could not find artifact org.apache.servicemix.specs:org.apache.servicemix.specs.activation-api-1.1:jar:2.2.0
4.0.0M! gives me:
Erroe executing command: Error
I try to delete Maven and reinstall it. The issue is still there. It's not happened on other machine.
It's a strange issue. Could anyone meet it ever? Could anyone help me out?
As it works on the other machines, it's something on that certain machine.
Without much more details on the setup I'm using assumptions here.
1) No Network connection to the central repo
2) Using a Proxy wich isn't configured or configured wrong on the server
3) Using a nexus with credentials and those aren't configured or configured wrong
I encountered the same issue and it was because there were mirrors defined in my Maven settings.xml (due to usage in another project). After I commented them out I was able to install the karaf war deployer.

Failed to start Nexus oss on redhat linux server 6.5

I have installed nexus 2.8.1-01 on linux server 6.5, but when I try to start it's got the following result. Would someone help me?
[uszbwp6#ANV-WFM-DLAPP01 nexus-2.8.1-01]$ ./bin/nexus start`
Starting Nexus OSS...
Failed to start Nexus OSS.
Thanks,
bob
You shouldn't run Nexus as root, this is not recommended.
I'm guessing that the files in the Nexus installation have incorrect permissions?
Try changing the owner of the Nexus installation files to your user ID (or whatever user ID is supposed to run Nexus).
I had faced the same issue. I initially ran nexus as a root user and i saw a warning "not advised to run as root user". So I stopped the nexus service, tried to restart with nexus user but it didn't restart. The only reason is, when I first ran the nexus as root user, it created some cache files and log files as a root user.
Our nexus installation is on /opt and our nexus db is on /mnt
Solution:
chown -R nexus:nexus /opt/nexus
chown -R nexus:nexus /mnt/nexus/
Afterwards, I restarted nexus and boom, it worked.

Resources