Permission Denied when executing liquibase command in Jenkins - bash

I'm getting this permission denied error when I'm trying to execute a liquibase command as a shell command.
/tmp/jenkins976.sh: line 3: /home/ec2-user/liquibase/liquibase: Permission denied
I've given the necessary permissions to the liquibase executable.
This worked fine with a previous version of jenkins and started getting this error after upgrading jenkins.
Current Jenkins version: 2.168
Appreciate any help to resolve this issue.

Related

Permission Denied in Jenkins "Execute shell" step

I'm getting:
[[1;31mERROR[m] Failed to execute goal [32morg.apache.maven.plugins:maven-compiler-plugin:3.1:compile[m [1m(default-compile)[m on project [36mtest[m: [1;31mError while storing the mojo status[m: /var/lib/jenkins/workspace/e2e-tests/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst (Permission denied) -> [1m[Help 1][m
in an "Execute Shell" script (mvn test) in a Jenkins job.
I see that the /var/lib/jenkins/workspace folder has "drwxr-x--- 3 jenkins jenkins" permission. If I get it right, only jenkins user can write in this folder. However if I put "who" in the shell script, I see that the job is executed as root (even though in /etc/default/jenkins I see JENKINS_USER=jenkins).
To resolve the 'permission denied' problem I did:
chmod -R 777 /var/lib/jenkins/workspace
Is this the proper solution? Is it normal for the job to be run as root and not jenkins?
Thanks,
Dinko
I reverted the permissions on the /var/lib/jenkins/workspace back to drwxr-x---, rebooted the Jenkins host and restarted the job. No "Permission Denied" error was logged anymore.
Rebooting the host did solve the issue.

Git config command showing permission denied

I'm new to Git and repeatedly getting the following error.
When I type the command git config --global color.ui auto I get the error:
error: could not lock config file C:/Program Files/Java/jdk1.8.0_101/bin/.gitconfig: Permission denied
I have been getting the same permission denied error for other commands as well. I don't know if there is any problem with the path.
HOME should not be set to the JDK bin folder, but to your %USERPROFILE%.
Do check in a CMD session the value of your account:
set USER
You should see your username and USERPROFILE folder.
Then try the same git config command, in that CMD session, setting HOME first:
set HOME=%USERPROFILE%
I was facing permission denied for git config --global user.name command from Git bash in Windows.
I ran the Git bash with Administrator privileges and was able to resolve the error.
Note: I also got the same error from Intellij trying to commit changes; that too got resolved after running Intellij in Admin mode.
I had the same issue, trying to set the initial configuration for git - user.name and user.email and failing with a "Permission denied" error. It failed in Normal and Administrator mode and on all CLIs - PowerShell, CMD and GitBash.
The reason in my case was rather stupid. Somehow I had a ~/.gitconfig folder, rather than a file, so the CLIs were failing to create the file, due to filename conflict. Although the error message could have been more helpful.
The solution - just delete the folder and try again.

-su: /home/sonar-runner-2.4/bin/sonar-runner.bat: Permission denied

I started working with sonarqube and getting stuck to get the code analyzed. Trying to add the properties of sonar in the source code file. By giving the following command
sonar-runner.bat
I am getting the error
-su: /home/sonar-runner-2.4/bin/sonar-runner.bat: Permission denied
Any help at the earliest is appreciated.
According to the error message and the name of your path, you seems to be using sonar-runner on Linux OS. In this case, you need to use sonar-runner without the bat extension.
Please note that you should use Sonar Scanner (https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner) which is the successor or Sonar Runner.

Jenkins(Windows ) unable to clone through git(Linux) repository

Set-up Details:
JENKINS on windows 10
GIT plugin setup done
public private key setup done
Cloning repository through CMD works
git clone through Jenkins fails with below error
"C:\Program Files (x86)\Jenkins\workspace\Aclselenium>git clone rahulp#10.0.6.194:/Operations/repo/git/test.git
Cloning into 'test'...
Permission denied, please try again.
Permission denied, please try again.
Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists."
Running below commands through windows cmd
"whoami" command gives > "acl-wireless\rahulp"
"echo %USERNAME%" command gives `> "rahulp"`
Where as when I run above command through JENKINS I receive:
"whoami" command gives > "nt authority\system"
"echo %USERNAME%" command gives `> "RAHULPANDEY$ RAHULPANDEY$"`
Your command line access to git and your jenkins access to git are two different things. From command line, you will be given your username and password to login. But from jenkins you need to configure credentials. Go to Manage Jenkins => Configure System => GitHub and please give the credentials there.

Can not create a new jhipster project

I created a new file and when I create a new jhipster project I got this error. How can I fix it?
error An unexpected error occurred: "EACCES: permission denied, mkdir '/home/chebbi/node_modules/#angular-cli'".
info If you think this is a bug, please open a bug report with the information provided in "/home/chebbi/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
Error jhipster
ERROR! yarn install failed.
It's look like a permission problem. You can try
sudo chmod -R 777 /home/chebbi/node_modules/

Resources