(Adding this here as I did not find an answer anywhere)
I configured Jenkins to automatically install JDK from the "Global Tools Configuration" > "JDK Installation" menu. The option works across all 14 nodes (various Windows and Linux) but one.
A server Windows Server 2012 R2 (amd64) with 20 executors, which has been running without issue for just under 3 years.
The log file references in the build's console (i.e. ...tools\hudson.model.JDK\install1873722508778839961log) is empty.
The build's console shows the following:
[EnvInject] - Loading node environment variables. Installing
E:\Jenkins_APA_8080\tools\hudson.model.JDK\Oracle_Java_8.0_191\jdk.exe
[Oracle_Java_8.0_191] $
E:\Jenkins_APA_8080\tools\hudson.model.JDK\Oracle_Java_8.0_191\jdk.exe
/s ADDLOCAL="ToolsFeature" REBOOT=ReallySuppress
INSTALLDIR=E:\Jenkins_APA_8080\tools\hudson.model.JDK\Oracle_Java_8.0_191
/L
E:\Jenkins_APA_8080\tools\hudson.model.JDK\install1873722508778839961log
Failed to install JDK. Exit code=-1 ERROR: SEVERE ERROR occurs
org.jenkinsci.lib.envinject.EnvInjectException: hudson.AbortException
at
org.jenkinsci.plugins.envinject.util.RunHelper.getBuildVariables(RunHelper.java:137)
at
org.jenkinsci.plugins.envinject.EnvInjectListener.setUpEnvironmentWithoutJobPropertyObject(EnvInjectListener.java:235)
at
org.jenkinsci.plugins.envinject.EnvInjectListener.setUpEnvironment(EnvInjectListener.java:51)
at
hudson.model.AbstractBuild$AbstractBuildExecution.createLauncher(AbstractBuild.java:542)
at
hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:462)
at hudson.model.Run.execute(Run.java:1810) at
hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543) at
hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429) Caused by:
hudson.AbortException at
hudson.tools.JDKInstaller.install(JDKInstaller.java:292) at
hudson.tools.JDKInstaller.performInstallation(JDKInstaller.java:157)
at
hudson.tools.InstallerTranslator.getToolHome(InstallerTranslator.java:72)
at
hudson.tools.ToolLocationNodeProperty.getToolHome(ToolLocationNodeProperty.java:109)
at
hudson.tools.ToolInstallation.translateFor(ToolInstallation.java:206)
at hudson.model.JDK.forNode(JDK.java:148) at
org.jenkinsci.plugins.envinject.util.RunHelper.getJDKVariables(RunHelper.java:111)
at
org.jenkinsci.plugins.envinject.util.RunHelper.getBuildVariables(RunHelper.java:135)
... 8 more
I logged onto the server as a local admin and attempted to run the JDK installation line shown in the build console:
E:\Jenkins_APA_8080\tools\hudson.model.JDK\Oracle_Java_8.0_191\jdk.exe
/s ADDLOCAL="ToolsFeature" REBOOT=ReallySuppress
INSTALLDIR=E:\Jenkins_APA_8080\tools\hudson.model.JDK\Oracle_Java_8.0_191
/L E:\Jenkins_APA_8080\tools\hudson.model.JDK
The installation seemed to run and this time the log file contained text. I double checked the owner and permissions on the Jenkins folders and they were owned by a local admin and not a domain admin (this is normal for our Jenkins installation).
However, the login credentials of the Jenkins service on this machine were set to a domain admin (not local admin).
Changing the Jenkins Services Log On credentials resolved the issue. Even though this node has been running for over a couple years without issue, its credentials were not correct.
Related
I am trying to use a tool that, in two steps, analyzes code smells for android.
In the first step, the tool parses an apk and generates within a directory .db files that should then be converted to CSV files in the next step; however, whenever I try to run the second step, the console returns the following error:
java.io.IOException: Unable to create directory path [/User/Desktop/db2/logs] for Neo4j store.
I think it is a Neo4J configuration problem.
I am currently running the tool with the following Java configuration:
echo $JAVA_HOME
/home/User/openlogic-openjdk-11.0.15
update-alternatives --config java
* 0 /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1111 auto mode
To be safe, I also started Neo4J, which returned the following output
sudo systemctl status neo4j.service
neo4j.service - Neo4j Graph Database
Loaded: loaded (/lib/systemd/system/neo4j.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2022-07-06 20:11:04 CEST; 16min ago
Main PID: 1040 (java)
Tasks: 57 (limit: 18901)
Memory: 705.4M
CPU: 16.639s
CGroup: /system.slice/neo4j.service
└─1040 /usr/bin/java -cp "/var/lib/neo4j/plugins:/etc/neo4j:/usr/share/neo4j/lib/*:/var/lib/neo4j/plugins/*" -XX:+UseG1GC -XX:-OmitStackTraceInFastThrow -XX:+AlwaysPreTouch -XX:+UnlockExper>.
How can I solve this?
You posted this error:
java.io.IOException: Unable to create directory path [/User/Desktop/db2/logs] for Neo4j store.
From that error, it looks like:
Neo4j was installed at "/User/Desktop/db2"
The permissions for that directory do not have "write" permission
I tried to reproduce this locally using Neo4j Community 4.4.5, following the steps below.
I do see an IOException related to "logs", but it's slightly different from what you posted. Perhaps we're on different versions of Neo4j.
Open terminal into install directory: cd neo4j
Verify "neo4j" is stopped: ./bin/neo4j stop
Rename existing "logs" directory: mv logs logs.save
Remove write permission for the Neo4j install: chmod u-w .
Start neo4j in console mode: ./bin/neo4j console
Observe errors in console output
2022-07-08 03:28:38.081+0000 INFO Starting...
ERROR StatusLogger Unable to create file [****************************]/neo4j/logs/debug.log
java.io.IOException: Could not create directory [****************************]/neo4j/logs
...
To fix things, try:
Get a terminal into your Neo4j directory:
cd /User/Desktop/db2
Set write permissions for the entire directory tree:
chmod u+w -R .
Start neo4j in console mode:
./bin/neo4j console
If this works and you're able to run neo4j fine, it points to an issue with user permissions when running neo4j as a system service.
The best steps from there depend on the system, your access, how comfortable you are making changes, probably other things. An easy, brute-force hammer would be to manually create each directory you discover (such as "/User/Desktop/db2/logs") and grant premissions to all users (chmod ugo+w .), then try re-running the service, see what errors pop up. Repeat that until you're able to run the service without errors.
I have just installed Apache Tomcat9 on my machine, following mostly these instructions, but I am really stuck with user management here.
My enviroment: Ubuntu 20.04, Java 11 (There is only one alternative in link group java (providing /usr/bin/java): /usr/lib/jvm/java-11-oracle/bin/java).
Few exceptions: I neither have JAVA_HOME, nor the java home directory in my PATH environment variable.
I also have created a symlink at /opt/tomcat/latest/ for pointing to the right folder for all tomcat files.
Now I want to let tomcat run as a service as user 'tomcat'.
This is how my tomcat.service file looks like:
[Unit]
Description=Tomcat 9 servlet container
After=network.target
[Service]
Type=forking
User=tomcat
Group=tomcat
Environment="JAVA_HOME=/usr/lib/jvm/java-11-oracle/bin/java"
# Environment="JAVA_OPTS=-Djava.security.egd=file:///dev/urandom -Djava.awt.headless=true"
Environment="CATALINA_BASE=/opt/tomcat/latest"
Environment="CATALINA_HOME=/opt/tomcat/latest"
Environment="CATALINA_PID=/opt/tomcat/latest/tomcat.pid"
# Environment="CATALINA_OPTS=-Xms512M -Xmx1024M -server -XX:+UseParallelGC"
ExecStart=/opt/tomcat/latest/bin/startup.sh
ExecStop=/opt/tomcat/latest/bin/shutdown.sh
[Install]
WantedBy=multi-user.target
Now, when I comment out the line for the JAVA_HOME environment variable, the startup of the tomcat service fails (journalctl -xe):
Okt 27 17:43:52 my-user startup.sh[7714]: Tomcat started.
Okt 27 17:43:52 my-user shutdown.sh[7737]: PID file found but either no matching process was found or the current user does not have permission to stop the process. Stop aborted.
Okt 27 17:43:52 my-user sudo[7690]: pam_unix(sudo:session): session closed for user root
So there is something running as root, what I don't get.
But when I comment out this line, tomcat runs happily, but on localhost:8080 I am getting this 500:
Message org.apache.jasper.JasperException: java.lang.ClassNotFoundException: org.apache.jsp.index_jsp
or this 404
Message JSP file [/index.jsp] not found
It is similar like here and here.
I also did sudo chown -R tomcat /opt/tomcat/latest/work/Catalina/localhost, but this did not help.
Any help is appreciated.
Now it works and I'm going to list my changes here, but I'm not sure, which one was crucial and which was unnecessary.
JAVA_HOME in tomcat.service changed to: Environment="JAVA_HOME=/usr/lib/jvm/java-11-oracle"
CATALINA_PID in tomcat.service changed to: Environment="CATALINA_PID=/opt/tomcat/latest/temp/tomcat.pid"
give write access to other users to folders work, temp, logs, webapps. Sources here and here.
using this guide: https://www.interserver.net/tips/kb/install-apache-tomcat-on-ubuntu-18-04/
New to cloud foundry, using the java buildpack to push a zip distribution of a java app. It detects the start script correctly, but when the start script gets to the point where it needs to start up the jvm, I get this error:
bash: java: command not found
Apparently 'java' is not on the shell's path during execution of the script, and I'm not finding a JAVA_HOME definition anywhere.
What is the path to use for starting java apps?
Where is it documented?
FALSE ALARM
Many thanks to #DanielMikusa for pointing out that JAVA_HOME is indeed set, even in the pretty old version of the buildpack that was in use. Nothing to see here.
EDIT #1
I've been able to find out that when the start script launches there is a jre located in $PWD/.buildpack-java/oracle_jre. But, this can't be what I'm expected to use to specify for the path of JAVA_HOME, can it? It seems like this location is entirely dependent on the java buildpack's current implementation. It seems like either the jre's bin folder should be in the start script's process' path or that there should be an environment variable or other configuration established prior to running the launch script so I can use that value for finding the java executable.
EDIT #2
Below is the output during the cf push operation:
PS E:\dev\hoobajoob\myproject\build\distributions> cf push -p .\my-service-1.0.0.zip my-service
Using manifest file E:\dev\hoobajoob\myproject\build\distributions\manifest.yml
Creating app my-service in org DEV / space dev as chefhoobajoob#github.com...
OK
Creating route my-service.cflab.dctmlabs.com...
OK
Binding my-service.cflab.dctmlabs.com to my-service...
OK
Uploading my-service...
Uploading app files from: C:\Users\hoobajoob\AppData\Local\Temp\unzipped-app384867239
Uploading 9.7M, 9390 files
Done uploading
OK
Starting app my-service in org DEV / space dev as chefhoobajoob#github.com...
Downloading oracle_buildpack_151...
Downloading binary_buildpack...
Downloading go_buildpack...
Downloading python_buildpack...
Downloading java-buildpack-offline-v3-19-2...
Downloaded java-buildpack-offline-v3-19-2
Downloading java-buildpack-offline-4-7...
...<more downloads>
Creating container
Successfully created container
Downloading app package...
Downloaded app package (53.1M)
Staging...
-----> Java Buildpack Version: v3.5.1 (offline) | https://github.com/cloudfoundry/java-buildpack.git#3abc3db
-----> Downloading Oracle JRE 1.8.0_112 from http://127.0.0.1/oracle-jre/trusty/x86_64/jre-8u112-linux-x64.tar.gz (found
in cache)
Expanding Oracle JRE to .java-buildpack/oracle_jre (2.3s)
-----> Downloading Open JDK Like Memory Calculator 2.0.1_RELEASE from https://download.run.pivotal.io/memory-calculator/
trusty/x86_64/memory-calculator-2.0.1_RELEASE.tar.gz (found in cache)
Memory Settings: -Xms2304M -XX:MetaspaceSize=314572K -Xss1M -Xmx2304M -XX:MaxMetaspaceSize=314572K
-----> Downloading Spring Auto Reconfiguration 1.10.0_RELEASE from https://download.run.pivotal.io/auto-reconfiguration/
auto-reconfiguration-1.10.0_RELEASE.jar (found in cache)
Exit status 0
Staging complete
Uploading droplet, build artifacts cache...
Uploading droplet...
Uploading build artifacts cache...
Uploaded build artifacts cache (108B)
Uploaded droplet (120.5M)
Uploading complete
Destroying container
Successfully destroyed container
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
1 of 1 instances running
App started
OK
App my-service was started using this command `CALCULATED_MEMORY=$($PWD/.java-buildpack/oracle_jre/bin/java-buildpack-memory-calculator-2.0.1_RELEASE -memorySizes=metaspace:64m.. -memoryWeights=heap:75,metaspace:10,native:10,stack:5 -memoryInitials=heap:100%,metaspace:100% -totMemory=$MEMORY_LIMIT) && JAVA_HOME=$PWD/.java-buildpack/oracle_jre JAVA_OPTS="-Djava.io.tmpdir=$TMPDIR -XX:OnOutOfMemoryError=$PWD/.java-buildpack/oracle_jre/bin/killjava.sh $CALCULATED_MEMORY" exec $PWD/my-service-1.0.0/bin/launch`
Writing up the comments above in case someone else comes across this question.
We reviewed the full output of staging and the start up command generated by the Java buildpack.
We could see from the start command generated by the Java buildpack that it is the start commands responsibility to set JAVA_HOME.
If you rely on the Java buildpack to create the start command for your dist-zip style applications, it will "do the right thing" and add the JAVA_HOME environment variable with the correct path to the start command.
If you need to create a custom start command, it is your responsibility to set JAVA_HOME correctly.
If you cf ssh into an application started by the Java buildpack, it is your responsibility to set JAVA_HOME.
I have developed an java ear that i deploy from my local eclipse to my local websphere 8.5 by using the publish button in eclipse. When I try to deploy my ear from command line I get an error after I try to access the webpage.
I update my ear from common line like this:
${was.dir}/profiles/${was.profile}/bin/wsadmin.sh -lang jython -username ${was.username} -password ${was.password} -c AdminApplication.updateApplicationUsingDefaultMerge('${was.app.name}', '${build.dir}/${ear.name}')
The deployment is successful but when I access my application thru my web browser I get the following message instead of seeing my application:
Error 404: com.ibm.ws.webcontainer.servlet.exception.NoTargetForURIException: No target servlet configured for uri: /wwww/index.html
I have verified that the ear is ok by updating it thru the web admin interface of websphere without any configuration.
What am I doing wrong or what additional steps do I need to do to successfully update my ear?
You are using wrong command. You should use something like this:
AdminApp.update('MyAppEAR', 'app', '[ -operation update -contents
MyApp.ear -nopreCompileJSPs -installed.ear.destination C:\WAS\MyAppEAR
-nodistributeApp -useMetaDataFromBinary -nodeployejb -createMBeansForResources -noreloadEnabled -nodeployws -validateinstall warn -noprocessEmbeddedConfig -filepermission ..dll=755#..so=755#..a=755#..sl=755
-noallowDispatchRemoteInclude -noallowServiceRemoteInclude -asyncRequestDispatchType DISABLED -nouseAutoLink -noenableClientModule -clientMode isolated -novalidateSchema -MapModulesToServers [[ MyApp MyApp.war,WEB-INF/web.xml WebSphere:cell=Node02Cell,node=Node02,server=server1 ]]]' )
Also, in WebSphere Application Server you can log every command you issue through Administrative Console.
Steps
login to admin console with administrative user (e.g. wasadmin)
click "System Administration" -> "Console Preferences"
check "Enable command assistance notifications" and "Log command assistance commands"
click Apply button to save changes
You can see commands in help portlet on the upper-right side of admin console:
If you checked "Log command assistance commands", you can also see jython commands in a log file "<WAS_HOME>\profiles\<PROFILE_NAME>\logs\server1\commandAssistanceJythonCommands.log"
I'm not sure about updateApplicationUsingDefaultMerge vs update (the latter is what I use), but don't forget you also have to AdminConfig.save() after you're finished.
I am trying to run a jenkins build. The below is my configuration.
Jenkins Version : 1.445
Deployment : as a WAR
Java : 1.7 (Server 64 bit)
Tomcat Ver : 7.0.23
It gives the following error:
Started by user jenkins-admin
Updating https://myrepo.mycompany.com/svn/repos/myrepo
ERROR: Failed to update https://myrepo.mycompany.com/svn/repos/myrepo
org.tmatesoft.svn.core.SVNException: svn: OPTIONS /svn/repos/myrepo failed
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:298)
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:283)
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:271)
at org.tmatesoft.svn.core.internal.io.dav.DAVConnection.exchangeCapabilities(DAVConnection.java:533)
at org.tmatesoft.svn.core.internal.io.dav.DAVConnection.open(DAVConnection.java:98)
at org.tmatesoft.svn.core.internal.io.dav.DAVRepository.openConnection(DAVRepository.java:1011)
at org.tmatesoft.svn.core.internal.io.dav.DAVRepository.getRepositoryUUID(DAVRepository.java:148)
at org.tmatesoft.svn.core.wc.SVNBasicClient.createRepository(SVNBasicClient.java:342)
at org.tmatesoft.svn.core.wc.SVNBasicClient.createRepository(SVNBasicClient.java:330)
at org.tmatesoft.svn.core.wc.SVNUpdateClient.update(SVNUpdateClient.java:535)
at org.tmatesoft.svn.core.wc.SVNUpdateClient.doUpdate(SVNUpdateClient.java:401)
at hudson.scm.subversion.UpdateUpdater$TaskImpl.perform(UpdateUpdater.java:135)
at hudson.scm.subversion.WorkspaceUpdater$UpdateTask.delegateTo(WorkspaceUpdater.java:136)
at hudson.scm.SubversionSCM$CheckOutTask.perform(SubversionSCM.java:787)
at hudson.scm.SubversionSCM$CheckOutTask.invoke(SubversionSCM.java:768)
at hudson.scm.SubversionSCM$CheckOutTask.invoke(SubversionSCM.java:752)
at hudson.FilePath.act(FilePath.java:783)
at hudson.FilePath.act(FilePath.java:765)
at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:742)
at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:684)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1195)
at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:571)
at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:460)
at hudson.model.Run.run(Run.java:1404)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:481)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:238)
Caused by: org.tmatesoft.svn.core.SVNErrorMessage: svn: OPTIONS /svn/repos/myrepo failed
at org.tmatesoft.svn.core.SVNErrorMessage.create(SVNErrorMessage.java:200)
at org.tmatesoft.svn.core.SVNErrorMessage.create(SVNErrorMessage.java:146)
at org.tmatesoft.svn.core.SVNErrorMessage.create(SVNErrorMessage.java:89)
... 27 more
Caused by: org.tmatesoft.svn.core.SVNException: svn: OPTIONS request failed on '/svn/repos/myrepo'
svn: unknown host
at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:64)
at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:51)
The problem is it does NOT fail all the time. However, it fails 70-80% of the time.
The credentials and the URL for svn repo are correct.
UPDATE: I have tried every possibility now. The problem persists.
I tried with JDK 6 (both 32 and 64 bit). The problem does NOT go.
I am working on RHEL 5.6. Can anybody please help?
I noticed this line:
Caused by: org.tmatesoft.svn.core.SVNException: svn: OPTIONS request failed on '/svn/repos/myrepo'
svn: unknown host
Whenever I have a problem with Jenkins, I log into the Jenkins system as the user running Jenkins, go to the working directory inside Jenkins, and from a command line, try to do whatever Jenkins is attempting to do (like update my working directory). That usually will help you point out a particular error.
Try running an update a few times from the Jenkin's job's working directory and see if you get the same error. If you do, it could point out a network issue (unknown host).
If you can run updates from the working directory on your Jenkins server in your job's working directory, then the problem may lie with SVNKit itself. What version of Subversion and SVNKit are you using?
Try deleting the working directory and see if a clean checkout helps.
I noticed this error after upgrading my "Jenkins Subversion Plugin" from v1.42 to v1.44.
To Fix:
Please check the version of "Jenkins Subversion plugin" if it v1.44, downgrade to lower version.
Seems like we have some issues with the new Subversion Plugin.
The node running the build can not resolve the host name. Possibly a fully qualified name is required: rather than mysvnbox something like mysvnbox.mydomain.com; Or possibly the node is blocked by a firewall. The fact that it works sometimes would seem to indicate at least one node has visibility or can use an abbreviated domain specification. Good luck.
I have faced the same issue in Jenkins. It was kept on failing during checking out the code. I tried to increase Jenkins work space but it was prompted for the crowd authentication. It was failed to update and I tried clear the authentication date from subversion and restarted my build server (You can log out with your credentials and log-in). This will work.