Jenkins Build failed after restarting Tomcat - build

I set up an ant project and successfully built a project.
Started by user anonymous
Building in workspace /home/myusername/jenkins/workspace/ctascweb
[ctascweb] $ cvs -q -z3 update -PdC -r ctascweb-development-3_3_8 -D "Wednesday, November 28, 2012 10:20:13 PM UTC"
? ROOT.war
? build
U src/stdy/analyze/LoadSubjects.java
$ computing changelog
[ctascweb] $ ant -file build_hudson.xml
Buildfile: build_hudson.xml
init:
[echo] Base Directory : /home/myusername/jenkins/workspace/ctascweb
gen-footer:
compile-ctpm:
[echo] Compiling ctpm files
[javac] Compiling 1 source file to /home/myusername/jenkins/workspace/ctpm/bin
generate-ctpm-jar:
[echo] Building CTPM jar file
[jar] Building jar: /home/myusername/jenkins/workspace/ctpm/build/ctpm.jar
compile-ctascweb:
[echo] Compiling ctascweb files
[javac] Compiling 1 source file to /home/myusername/jenkins/workspace/ctascweb/build/classes
[mkdir] Created dir: /home/myusername/jenkins/workspace/ctascweb/build/classes/resource
build-ctascweb-war:
[echo] Building WAR file for ctascweb
[war] Building war: /home/myusername/jenkins/workspace/ctascweb/ROOT.war
[echo] Nov-28-2012 05:20:48
BUILD SUCCESSFUL
Total time: 7 seconds
Archiving artifacts
Finished: SUCCESS
I shut down my Tomcat and came back next work. I did not make any changes in my configuration and started the build again and the build failed.
Started by user anonymous
Building in workspace /home/myusername/jenkins/jobs/ctascweb/workspace
[ctascweb] $ cvs -Q -z3 -d :pserver:myusername:pwd#5.0.0.146:/CVS_RESP01 co -P -r ctascweb-development-3_3_8 -d workspace -D "Thursday, November 29, 2012 2:41:16 PM UTC" ctascweb
$ computing changelog
[workspace] $ ant -file build_hudson.xml
Buildfile: build_hudson.xml
init:
[mkdir] Created dir: /home/myusername/jenkins/jobs/ctascweb/workspace/build/classes
[echo] Base Directory : /home/myusername/jenkins/jobs/ctascweb/workspace
gen-footer:
BUILD FAILED
java.io.FileNotFoundException: /home/myusername/jenkins/jobs/ctascweb/ctpm/src/com/ctasc/ctpm/layout/StdyFooter.java (No such file or directory)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:194)
at java.io.FileOutputStream.<init>(FileOutputStream.java:116)
at java.io.FileWriter.<init>(FileWriter.java:61)
at org.apache.tools.ant.taskdefs.Echo.execute(Echo.java:67)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
at org.apache.tools.ant.Main.runBuild(Main.java:758)
at org.apache.tools.ant.Main.startAnt(Main.java:217)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
Total time: 0 seconds
Build step 'Invoke Ant' marked build as failure
Archiving artifacts
Finished: FAILURE
For some reason, the worspace changed from /home/myusername/jenkins/workspace/ctascweb to
/home/myusername/jenkins/jobs/ctascweb/workspace. Why would that happen? The only thing I did is stopped and restarted the Tomcat server?

Are you the admin of the Hudson/Jenkins server?
If the version was recently updated (in particular from Hudson to Jenkins), there is a difference in the path that's used for project's workspace (which can be changed in configuration). You should always use ${WORKSPACE} variable instead of directly referencing any path
Also, these lines look different, so there was more than just Tomcat restart
[ctascweb] $ cvs -q -z3 update -PdC -r ctascweb-development-3_3_8 -D "Wednesday, November 28, 2012 10:20:13 PM UTC"
[ctascweb] $ cvs -Q -z3 -d :pserver:myusername:pwd#5.0.0.146:/CVS_RESP01 co -P -r ctascweb-development-3_3_8 -d workspace -D "Thursday, November 29, 2012 2:41:16 PM UTC" ctascweb

Look for any changes in configuration of job from UI. Goto Advanced options and see if someone has unchecked your custom workspace as seems to be the case.
Also can I get to see your build_hudson.xml. There may be some issues with the way you used path in the build file.

Yes the Jenkins workspace folder is changing based on the way we run it. I had seen this in windows XP on my machine.
When I run the JAR file using java -jar jenkins.war
It is .jenkins/workspace/<job_name>
When I installed it as a windows service, the workspace folder changed to .jenkins/<job_name>/workspace

Related

Nix Gradle dist - Failed to load native library 'libnative-platform.so' for Linux amd64

I am trying to build a Freeplane derivation based on Freemind, see: https://github.com/razvan-panda/nixpkgs/blob/freeplane/pkgs/applications/misc/freeplane/default.nix
{ stdenv, fetchurl, jdk, jre, gradle }:
stdenv.mkDerivation rec {
name = "freeplane-${version}";
version = "1.6.13";
src = fetchurl {
url = "mirror://sourceforge/project/freeplane/freeplane%20stable/freeplane_src-${version}.tar.gz";
sha256 = "0aabn6lqh2fdgdnfjg3j1rjq0bn4d1947l6ar2fycpj3jy9g3ccp";
};
buildInputs = [ jdk gradle ];
buildPhase = "gradle dist";
installPhase = ''
mkdir -p $out/{bin,nix-support}
cp -r ../bin/dist $out/nix-support
sed -i 's/which/type -p/' $out/nix-support/dist/freeplane.sh
cat >$out/bin/freeplane <<EOF
#! /bin/sh
JAVA_HOME=${jre} $out/nix-support/dist/freeplane.sh
EOF
chmod +x $out/{bin/freeplane,nix-support/dist/freeplane.sh}
'';
meta = with stdenv.lib; {
description = "Mind-mapping software";
homepage = https://www.freeplane.org/wiki/index.php/Home;
license = licenses.gpl2Plus;
platforms = platforms.linux;
};
}
During the gradle build step it is throwing the following error:
building path(s)
‘/nix/store/9dc1x2aya5p8xj4lq9jl0xjnf08n7g6l-freeplane-1.6.13’
unpacking sources unpacking source archive
/nix/store/c0j5hgpfs0agh3xdnpx4qjy82aqkiidv-freeplane_src-1.6.13.tar.gz
source root is freeplane-1.6.13 setting SOURCE_DATE_EPOCH to timestamp
1517769626 of file freeplane-1.6.13/gitinfo.txt patching sources
configuring no configure script, doing nothing building
FAILURE: Build failed with an exception.
What went wrong: Failed to load native library 'libnative-platform.so' for Linux amd64.
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. builder for ‘/nix/store/id4vfk3r6fd4zpyb15dq9xfghf342qaa-freeplane-1.6.13.drv’
failed with exit code 1 error: build of
‘/nix/store/id4vfk3r6fd4zpyb15dq9xfghf342qaa-freeplane-1.6.13.drv’
failed
Running gradle dist from terminal works fine. I'm guessing that maybe one of the globally installed Nix packages provides a fix to the issue and they are not visible during the build.
I searched a lot but couldn't find any working solution. For example, removing the ~/.gradle folders didn't help.
Update
To reproduce the issue just git clone https://github.com/razvan-panda/nixpkgs, checkout the freeplane branch and run nix-build -A freeplane in the root of the repository.
Link to GitHub issue
Maybe you just don't have permission for the folder/file
sudo chmod 777 yourFolderPath
you can also : sudo chmod 777 yourFolderPath/* (All folder)
Folder will not be locked,then You can use it normally
[At least I succeeded。。。]
EX:
sudo chmod 777 Ruby/
now ,that's ok
To fix this error: What went wrong: Failed to load native library 'libnative-platform.so' for Linux amd64. do the following:
Check if your Gradle cache (**~user/.gradle/**native folder exist at all or not).
Check if your Gradle cache (~user/.gradle/native folder exist and the file in question i.e. libnative-platform.so exists in that directory or not).
Check if the above folder ~user/.gradle or ~/.gradle/native or file: ~/.gradle/native/libnative-platform.so has valid permissions (should not be read-only. Running chmod -R 755 ~/.gradle is enough).
IF you don't see native folder at all or if your native folder seems corrupted, run your Gradle task ex: gradle clean build using -g or --gradle-user-home option and pass it's value.
Ex: If I ran mkdir /tmp/newG_H_Folder; gradle clean build -g /tmp/newG_H_Folder, you'll see Gradle will populate all the required folder/files (that it needs to run even before running any task or any option) are now in this new Gradle Home folder (i.e. /tmp/newG_H_Folder/.gradle directory).
From this folder, you can copy - just the native folder to your user's ~/.gradle folder (take backup of existing native folder in ~/.gradle first if you want to) if it already exists -or copy the whole .gradle folder to your ~ (home directory).
Then rerun your Gradle task and it won't error out anymore.
Gradle docs says:
https://docs.gradle.org/current/userguide/command_line_interface.html
-g, --gradle-user-home
Specifies the Gradle user home directory. The default is the .gradle directory in the user’s home directory.

Watchman: where is the default log file?

Where does the build tool watchman store it's log file by default?
Check curent log file by default:
ps aux | grep watchman
mac 77620 0.0 0.0 2475836 672 ?? S< 2:26PM 0:00.23 /usr/local/Cellar/watchman/4.7.0/libexec/bin/watchman --foreground --logfile=/usr/local/var/run/watchman/mac-state/log --log-level=1 --sockname=/usr/local/var/run/watchman/mac-state/sock --statefile=/usr/local/var/run/watchman/mac-state/state --pidfile=/usr/local/var/run/watchman/mac-state/pid
Also, you are allowed to set your own log file.
watchman -o /tmp/log
see more:
watchman --help
-o, --logfile=PATH Specify path to logfile
Watchman places logs in a file named <STATEDIR>/<USER>.log, where STATEDIR is set at the time that you built watchman.
By default, STATEDIR is <PREFIX>/var/run/watchman/<USER>-state/log.
If you're running a homebrew build of watchman, you'll find the logs in a path named something like /usr/local/Cellar/watchman/3.2.0/var/run/watchman/<USER>.log.
Info taken from the docs at https://facebook.github.io/watchman/docs/troubleshooting.html#where-are-the-logs

building chromium latest release on android

I have to build latest release of chromium browser for android.
I am using the following step,
Create a Chromium root directory
mkdir chromium ; cd chromium
Download and export PATH of depot_tools
export PATH=$PATH:~/path/to/depot_tools/
Checked out the source for build 32.0.1665.2
gclient config https://src.chromium.org/chrome/releases/32.0.1665.2
4 The above command create a .gclient file in chromium root directory, and add the target android in .gclient.
target_os = ['android']
To download the initial code:
gclient sync
Install the Dependencies
6.1) cd /path/to/chromium/src
6.2) ./build/install-build-deps.sh
gclient runhooks call GYP to generate your platform-specific files. This should give you a complete source tree
gclient runhooks
Compile :
To build the ARM Android content shell:
1) cd /path/to/chromium/src
2) . build/android/envsetup.sh
3) android_gyp
4) ninja -C out/Release -j10 content_shell_apk
After following the above command i am getting the content_shell.apk which has version chrome/19.77.34.5, i am checking the version of chromium using the link http://whatsmyuseragent.com,
Please help me to build chromium latest version(32.0.1665.2) on android
Content shell does not display correct user agent version in android as well as linux (right now content_shell displays chrome/19.77.34.5).
This seems to be deliberate from src/content/content_shell.gypi
'variables': {
'content_shell_product_name': 'Content Shell',
# The "19" is so that sites that sniff for version think that this is
# something reasonably current; the "77.34.5" is a hint that this isn't a
# standard Chrome.
'content_shell_version': '**19.77.34.5**',
You can always use chromium_testshell which will give correct version (which is currently Chrome/35.0.1879.0).

Not able to build .net solution in Team city by using Nant.exe

I have using team city to build my project by using of Nant as build. So I have created one batch file in to build my project by where I using Nant.exe which is responsible for build my solution.
When I am ruing this batch file from command prompt I am successfully able to build my solution. But When I run the same file from TeamCity its giving me Build fail error.
So That I have verified path and that also correct. Below are the path I have stored in team city.
Path to a build file: Build.bat (bat file for build)
Working directly : D:\CMS (path where my bat file is located.
NAnt home: Path were Nant exe located.
Targeted framwork : Net 4.0
When I am ruing this build by team city every time build fails with below log generated.
[21:27:54]: Checking for changes
[21:27:55]: Clearing temporary directory: C:\TeamCity\buildAgent\temp\buildTmp
[21:27:55]: Checkout directory: D:\Projects\JoyaCMS\src
[21:27:56]: Repository sources transferred
[21:27:55]: Updating sources: server side checkout... (1s)
[21:27:57]: Publishing internal artifacts (2s)
[21:27:57]: Starting: D:\Projects\JoyaCMS\src\UppercuT\lib\NAnt\NAnt.exe - buildfile:D:\Projects\JoyaCMS\src\build.bat -targetframework:net-4.0 - extension:C:\TeamCity\buildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NAntLoggers .dll -listener:JetBrains.BuildServer.NAntLoggers.NAntListener
[21:27:57]: in directory: D:\Projects\JoyaCMS\src
[21:27:57]: Process exited with code 1
[21:27:57]: NAnt output:
[21:27:57]: NAnt 0.91 (Build 0.91.3881.0; alpha2; 8/17/2010)
[21:27:57]: Copyright (C) 2001-2010 Gerry Shaw
[21:27:57]: http://nant.sourceforge.net
[21:27:57]: BUILD FAILED
[21:27:57]: For more information regarding the cause of the build failure, run the build again in debug mode.
[21:27:57]: Try 'nant -help' for more information
[21:27:57]: D:\Projects\JoyaCMS\src\build.bat(1,1):
[21:27:57]: Error loading buildfile.
[21:27:57]: Data at the root level is invalid. Line 1, position 1.
[21:28:02]: Publishing internal artifacts (1s)
[21:28:05]: Build finished
So let me know how can I resolve this issue in team city. and what setting I need to perform more to resolve this issue.
Thanks,
Amit
First of all I noticed a few occurrences of additional whitespace characters in your NAnt call e.g.- extension:C:\TeamCity\buildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NAntLoggers .dll. Might be an SO formatting issue, but in case they're part of your batch, remove them first.
If this doesn't help, activate verbose build output via NAnt switch -v+. That should give more information.

Build Tensorflow with Bazel

I would like build tensorflow with Bazel to use the compiled libary in c++. I run the following commands in cmd.
C:\Users\Furkan\Desktop\tensorflow-1.14.0>bazel build --config=opt
WARNING: Usage: bazel build <options> <targets>.
Invoke `bazel help build` for full description of usage and options.
Your request is correct, but requested an empty set of targets. Nothing will be built.
INFO: Build option --define has changed, discarding analysis cache.
INFO: Analyzed 0 targets (0 packages loaded, 0 targets configured).
INFO: Found 0 targets...
INFO: Elapsed time: 0.124s, Critical Path: 0.01s
INFO: 0 processes.
INFO: Build completed successfully, 1 total action
After that they create the folders in tensorflow, but the folders are empty.. What I do wrong??
bazel: 0.25.2
tensorflow: 1.14.0
I guess you're typing an incomplete command, you should type:
bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package
The
//tensorflow/tools/pip_package:build_pip_package
is the location of the BUILD file, if you're not including it bazel does not know what to build. Including that in your command should solve the issue.