A sample github repository is linked to app.wercker.com as given in the dochttp://devcenter.wercker.com/docs/quickstarts/deployment/kubernetes
while executing the build from wercker.yml (through app.wercker.com), below error is seen. Permission denied for "create_cities-controller.json.sh". Please help me resolve this issue.
export WERCKER_STEP_ROOT="/pipeline/script-aa48a107-200c-450a-8f81-24e32622a13f"
export WERCKER_STEP_ID="script-aa48a107-200c-450a-8f81-24e32622a13f"
export WERCKER_STEP_OWNER="wercker"
export WERCKER_STEP_NAME="script"
export WERCKER_REPORT_NUMBERS_FILE="/report/script-aa48a107-200c-450a-8f81-24e32622a13f/numbers.ini"
export WERCKER_REPORT_MESSAGE_FILE="/report/script-aa48a107-200c-450a-8f81-24e32622a13f/message.txt"
export WERCKER_REPORT_ARTIFACTS_DIR="/report/script-aa48a107-200c-450a-8f81-24e32622a13f/artifacts"
source "/pipeline/script-aa48a107-200c-450a-8f81-24e32622a13f/run.sh" < /dev/null
/pipeline/script-aa48a107-200c-450a-8f81-24e32622a13f/run.sh: line 2: ./create_cities-controller.json.sh: Permission denied
It looks like your pipeline is trying to execute the file create_cities-controller.json.sh but you do not have permission to execute it. This could be for a variety of reasons. The most common two would be:
the box that you are using has its "user" set to a user that does not have execute permission on that file. You can check the user using the docker inspect box:tag command (using the details of the box you used in your wercker.yml
the file might not have its execute bit turned on - this can often happen when using git on windows for example - in this case you need to make sure you tell git to set the exec bit using this command:
git update-index --chmod=+x ./create_cities-controller.json.sh (I am assuming this file comes from your source code repository - if not, then you would have to change it in the image itself, i.e. start a container from the image, do a chmod to fix it, then commit that container to update the docker image)
Related
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.
I am trying to nest a shell script into a Jenkins job but the script will infinitely get stuck when using the bash git clone command.
It doesn't even send me an error. I suspect the script is asking for a password when coming to the git clone command.
Jenkins Job Configuration :
#!/bin/sh
set -x
whoami #returns 'jenkins'
sudo -u root ./my_script.sh
my_script.sh
whoami #returns ROOT
sudo git clone 'https://myusername:mypassword#my.forge.fr/project/my-project.git' -b "master" --verbose
What have I tried so far
I edited my sudoers and added jenkins ALL=NOPASSWD: ALL
I intentionnaly wrote wrong credential in the git clone command, and I get an error remote: HTTP Basic: Access denied
With a terminal, I went in my workspace project, switched to jenkins user and ran sudo ./my_script.sh and it worked fine, no password asked.
It also work fine when ran under root user ( not a surprise )
Does anyone know how I can get my job to make this command pass ?
Edit
I am on Mac OS
I finally solved it, it did come from a credential, but not the one I thought of. The problem came from Keychain Access. Also I appologize, I did not specified I was on Mac, I thought it wasn't relevant here since I was using bash.
When running the script under the Jenkins user, it worked fine as I was using sudo, but when I tried to run directly the sudo git clone 'https://myusername:mypassword#my.forge.fr/project/my-project.git' -b "master" --verbose I got an error :
I couldn't find the error message in english, but basically it says "unable to find a Keychain to store..." and the answers "cancel" and "reset my default keychain"
From there I :
Created a new Keychain called jenkins-dev in the Keychain manager
I copied it from /Users/myuser/Library/Keychains to /Users/Shared/Jenkins/Library/Keychains under myuser
Then I ran security unlock-keychain /Users/Shared/Jenkins/Library/Keychains/jenkins-dev.keychain-db under jenkins user
finally security default-keychain /Users/Shared/Jenkins/Library/Keychains/jenkins-dev.keychain-db under jenkins user
I ran once more the git clone ... command line under jenkins user, and then it found the keychain, stored the access and my Jenkins script wasn't stuck anymore
Hope this can help
Do you have a key in ~/.ssh/id_rsa.pub in that machine?
I am trying to clone a project from gitlab using GO CI/CD pipeline. Steps i did as below,
I already have ssh key which i have added to gitlab.
tried to clone from my local machine and i am able to clone using "git clone" command
I also tried on the Go-agent server using command "git clone" and project is cloned there.
After clone the project I opened the ssh folder and "known_hosts" file is modified with some key. So i have placed the ssh folder at "C:\Windows\System32\config\systemprofile" location because GO- CD pipeline looks there only.
But whenever i am trying to test the connection of pipeline it says access denied. below is the error
:
Repository ssh://git#gitlab.demo.com/exampleproject/someproject.git not found! :
Error performing command: --- Command ---
git ls-remote ssh://git#gitlab.demo.com/exampleproject/someproject.git
--- Environment ---
{}
--- INPUT ----
--OUTPUT ---
--- ERROR ---
STDERR: Host key verification failed.
STDERR: fatal: Could not read from remote repository.
STDERR:
STDERR: Please make sure you have the correct access rights
STDERR: and the repository exists.
I also tried running command ssh -T git#gitlab.demo.com but it shows "Permission denied (publickey).". Can anyone tell me why? what configuration i am missing?
If you have created a key using the default name of id_rsa, try copying it to C:\Windows\SysWOW64\config\systemprofile.ssh (https://startbigthinksmall.wordpress.com/2012/04/26/how-to-authorize-local-system-account-for-openssh/).
If that doesn't work after restarting your service, or if you think you will need to use more than one identity, the following might be helpful:
I assume restarting your Go-CD server service didn't work and that you are running your Go Server service using the default Local System account. I prefer to run using a domain account as that helps with some tricky permissions issues and this type of configuration. Take a look at this answer first: .ssh/config file for windows (git)
If you are running under a service account, your RSA keys are typically written to ~/.ssh/ - which likely translates to: C:/Users/your-account/.ssh. If this folder doesn't exist, open a command window in admin mode, cd to your account folder and run mkdir .ssh.
When Go-CD makes a connection to a Git repository using SSH, it uses git commands which in turn call ssh commands. With all these layers there are a number of approaches to configuring what identity or identities to use. An article to read first is (https://medium.com/#pinglinh/how-to-have-2-github-accounts-on-one-machine-windows-69b5b4c5b14e) Notice how the sshCommand overrides which identity git will use by specifying the file path to your rsa file.
Instead of editing the git configuration directly, my opinion is that editing the global ssh configuration will better handle multiple identities/keys and will be easier for Go-CD to handle. See https://www.ssh.com/ssh/config/. By default the ssh configuration file is located at ~/.ssh/config. If you don't have one, create a text file named config without any extension. Edit the file and add an entry that specifies the path to your Identity File (RSA Key) or files. For example (https://superuser.com/questions/366649/ssh-config-same-host-but-different-keys-and-usernames):
Host github_username1
Hostname github.com
User git
IdentityFile ~/.ssh/rsa_1
Host github_username2
Hostname github.com
User git
IdentityFile ~/.ssh/rsa_2
This establishes an host alias you can use for your material. So, instead of using git#gitlab.com/pathtorepo, you would use git#github_username2/pathtorepo if you were using the second host shown above.
Always give your Go-CD service a bounce after making changes, just in case.
I am building dockerfile to create an image where I want to build a package. I want to pull this package inside the docker image. I need to do a git clone for that. I saw the discussion on this post :
Using SSH keys inside docker container
Based on that, here is the content in my Dockerfile :
ENV SSH_HOME /Users/myid
ADD $SSH_HOME/.ssh/id_rsa /root/.ssh/id_rsa
RUN echo " IdentityFile ~/.ssh/id_rsa" >> /etc/ssh/ssh_config
When I run docker build, I am getting an error due to relative path. If I provide absolute path, it says the location is outside of context. Any idea how to fix this? I am running on Mac OSX 10.
With the script above, I am getting the following error :
ADD failed: stat /var/lib/docker/tmp/docker-builder6164655/Users/myid/.ssh/id_rsa: no such file or directory
Looks like it might be related to this bug here
The broken example is very similar to your path problem:
# Dockerfile
FROM ubuntu:14.04
COPY start.sh /start.sh
# comes back with:
stat /var/lib/docker/aufs/mnt/e89417ccaafbc91c3f930b56819427f83b3f2d3b3a246fbd6b48c9abcc7233f6/start.sh: no such file or directory
I'd try
updating to the most recent docker
restarting your docker engine
The complete error is:
Failed to initialize central HHBC repository:
Failed to initialize schema in /home/shreeram/.hhvm.hhbc:
I am trying to configure hhvm ana apache2.
For that i am following this link how-to-setup-hhvm-on-ubuntu-14-04-server-with-apache-2-4-part-1/
In above link i am stuck in the step when i put this command in the terminal:
curl -sS https://getcomposer.org/installer | php
The result of that command is the error mentioned above.
The shreeram directory has both read and write permission.
Could anyone help me to understand what i am missing there?
Are you sure permissions are correct on /home/shreeram, and that /home/shreeram/.hhvm.hhbc is readable and writable by the user running php? This issue really does sound like a permissions problem.
As the same user that was running php, does touch /home/shreeram/.hhvm.hhbc work? What about echo > /home/shreeram/.hhvm.hhbc?
If that's all fine, try rm /home/shreeram/.hhvm.hhbc and then try to install Composer again. Although it's typically a permission error, there are cases when the repo can become corrupt (particularly if the enclosing directory is on NFS or some other network filesystem) and you can just remove it and start over.