I'm trying to setup Hudson to build my Android project.
The problem is that jobs are started by user "hudson" that doesn't have appropriate permissions (my project is located in my home directory) so I'm getting "permission denied" in Hudson build log.
Here is the output of dummy task that prints current user name:
Started by user anonymous
[workspace] $ /bin/sh -xe /tmp/hudson2129720862026016628.sh
+ whoami
hudson
[DEBUG] Skipping watched dependency update; build not configured with trigger: SipPhone 3rd party libs #2
Finished: SUCCESS
What is the best practice for solving this issue? Can I make Hudson to run build from my user?
Thanks
Found solution: it's necessary to change user in /etc/default/hudson
config file (HUDSON_USER variable)
Related
I am using Hadoop 3.2.0 and trying to run a simple application in a docker container and I have made the required configuration changes both in yarn-site.xml and container-executor.cfg to choose LinuxContainerExecutor and docker runtime.
I use the example of distributed shell in one of the hortonworks blog. https://hortonworks.com/blog/trying-containerized-applications-apache-hadoop-yarn-3-1/
The problem I face here is when the application is submitted to YARN it fails with a reason related to directory creation issue with the below error
2019-02-14 20:51:16,450 INFO distributedshell.Client: Got application
report from ASM for, appId=2, clientToAMToken=null,
appDiagnostics=Application application_1550156488785_0002 failed 2
times due to AM Container for appattempt_1550156488785_0002_000002
exited with exitCode: -1000 Failing this attempt.Diagnostics:
[2019-02-14 20:51:16.282]Application application_1550156488785_0002
initialization failed (exitCode=20) with output: main : command
provided 0 main : user is myuser main : requested yarn user is
myuser Failed to create directory
/data/yarn/local/nmPrivate/container_1550156488785_0002_02_000001.tokens/usercache/myuser
- Not a directory
I have configured yarn.nodemanager.local-dirs in yarn-site.xml and I can see the same reflected in YARN web ui localhost:8088/conf
<property>
<name>yarn.nodemanager.local-dirs</name>
<value>/data/yarn/local</value>
<final>false</final>
<source>yarn-site.xml</source>
</property>
I do not understand why is it trying to create usercache dir inside the nmPrivate directory.
Note : I have verified the permissions for myuser to the directories and also have tried clearing the directories manually as suggested in a related post. But no fruit. I do not see any additional information about container launch failure in any other logs.
How do I debug why the usercache dir is not resolved properly??
Really appreciate any help on this.
Realized that this is all because of the users the services were started with and the permissions to the directories the services work on.
After making sure the required changes are done, I am able to seamlessly run the examples and other applications..
Thanks Hadoop user community for the direction. Adding the link here for more details.
http://mail-archives.apache.org/mod_mbox/hadoop-user/201902.mbox/browser
SonarQube helps to highlight all SONAR violations and in the analysis of each Pull Request code change when done on the local system.
Is there any option/set-up where I can automate any Pull Request to be analyzed by SonarQube in GIT and send out an email or update a dashboard with the latest SONAR code violations? All I want is to automate the SONAR analysis as soon as someone initiates a pull request.
You would need to have a third component namely the CI server. This is the TL;DR solution for is how I did it full version in https://www.trajano.net/2016/11/integrating-travis-sonarqube/
Create tokens for your account in SonarQube.com accounts security.
Create a GitHub personal access token with repo access.
Enable Travis build for your repository.
Create a .travis.yml file.
language: java
jdk:
- oraclejdk8
sudo: false
cache:
directories:
- "$HOME/.m2"
- "$HOME/.sonar/cache"
addons:
sonarqube: true
install:
- mvn dependency:go-offline
script:
- mvn install site -Dmaven.test.failure.ignore=true
after_success:
- mvn sonar:sonar
Add the tokens using travis encrypt
travis encrypt SONAR_TOKEN=[token from sonarqube.com]
travis encrypt SONAR_GITHUB_TOKEN=[token from github.com]
Trying to set up Jenkins on one of my servers for the first time and think I might be missing something.
Jenkins 1.545
Phing 2.6.1
Jenkins builds give me the following output.
Building in workspace /var/www/vhosts/domain.co.uk/httpdocs
looking for '/var/www/vhosts/domain.co.uk/httpdocs/build.xml' ...
looking for '/var/www/vhosts/domain.co.uk/httpdocs/build.xml' ...
looking for 'build.xml' ...
buildfile 'build.xml' not found.
Build step 'Invoke Phing targets' marked build as failure
Finished: FAILURE
If I run my build.xml on it's own it works fine.
I'm using a custom workspace at the moment, before I tried a symlink from the default workspace to my webroot, when I did that it found the build file but failed when trying to run phing. I know it's a problem with permissions but I'm not sure exactly what.
I'm running this on a plesk web server and have tried adding the jenkins user to the psacln and psaserv groups but that didn't work either.
I use hudson but I think is the same problem.
Provide to ant job the full path (advanced settings)
${WORKSPACE}/buil.xml
Assuming the correct set of jenkins user
RUN_AS_USER=jenkins
Go to the custom workspace and
chown -R jenkins:jenkins myworkspace
if it doesn't work
chmod -R 777 myworkspace
then you will fix later.
I hope it helps.
I am using Jenkins and Ant to run my selenium tests. It works fine when I run them on my local machine.
Now I have a Jenkins server which is on a different location and I have to run my tests on that server.
when I tried to run the tests on that server Its is failing because it couldn't find the build.xml file. can you please let me know how can I change the home directory path?
Started by user :**********
Building in workspace /var/lib/jenkins/jobs/moveon4 java tests/workspace
FATAL: Unable to find build script at C:\selenium tests for move\movetests1\build.xml
Build step 'Invoke Ant' marked build as failure
Finished: FAILURE
Are you using "Invoke Ant" in your Jenkins job configuration for the build step that executes your Ant build ? If so, the build file location is hidden away in the Advanced section - it's an annoying quirk of Jenkins.
I am trying out Gradle and am trying to upload jars to my Nexus repo using Wagon SCP as described in the Gradle user guide. I have taken the build file as specified in the user guide:
configurations {
deployerJars
}
repositories {
mavenCentral()
}
dependencies {
deployerJars "org.apache.maven.wagon:wagon-ssh:1.0-beta-2"
}
uploadArchives {
repositories.mavenDeployer {
name = 'sshDeployer' // optional
configuration = configurations.deployerJars
repository(url: "scp://repos.mycompany.com/releases") {
authentication(userName: "me", password: "myPassword")
}
}
}
(Of course with the exception that the URL and credentials are adapted to my repo.)
Now, when running gradle uploadArchives, the build freezes after a while. I cancelled the build and restarted it with info logging turned on and found that the script is prompting me for password:
gradle -i uploadArchives
Starting Build
Settings evaluated using empty settings file.
Projects loaded. Root project using build file '/Users/developer/Slask/ex24/build.gradle'.
Included projects: [root project 'ex24']
Evaluating root project 'ex24' using build file '/Users/developer/Slask/ex24/build.gradle'.
All projects evaluated.
Selected primary task 'uploadArchives'
Tasks to be executed: [task ':compileJava', task ':processResources', task ':classes', task ':jar', task ':uploadArchives']
:compileJava
Executing task ':compileJava' due to:
No history is available for task ':compileJava'.
[ant:javac] Compiling 1 source file to /Users/developer/Slask/ex24/build/classes/main
[ant:javac] warning: [options] bootstrap class path not set in conjunction with -source 1.5
[ant:javac] 1 warning
:processResources
Skipping task ':processResources' as it has no source files.
:processResources UP-TO-DATE
:classes
Skipping task ':classes' as it has no actions.
:jar
Executing task ':jar' due to:
No history is available for task ':jar'.
:uploadArchives
Task ':uploadArchives' has not declared any outputs, assuming that it is out-of-date.
Publishing configuration: configuration ':archives'
:: loading settings :: url = jar:file:/usr/local/Cellar/gradle/1.0-milestone-7/libexec/lib/ivy-2.2.0.jar!/org/apache/ivy/core/settings/ivysettings.xml
Publishing to Resolver org.gradle.api.publication.maven.internal.ant.DefaultGroovyMavenDeployer#53c0f47a
[ant:null] Deploying to scp://192.168.0.100/mynexusrepo
[INFO] Retrieving previous build number from remote
Password::
Apparently, the password configured in the build script is ignored.
Anyway, I entered the password and then got prompted some more times, where I obeyed and re-entered the password.
Finally, the build completed sucessfully.
Afterwards I checked my repo and the artifact had been uploaded successfully.
So, uploading jars to a repo works.
However, that the gradle prompts me for password does not work for me, since I planned to use this in a automated build process with Jenkins.
NOW TO MY QUESTION:
Does anyone know if there is a way to turn this password prompting off?
I don't know why it's prompting you for the password. That may be something to fix in a newer version of wagon. I do know that you can use this to avoid the need for a password:
repository(url: 'scp://example.com/var/repos') {
authentication(userName: "me", privateKey: "/home/me/.ssh/id_rsa")
}