Concourse: resource script '/opt/resource/check []' failed: exit status 128 - concourse

Environment:
OS: Ubuntu 18.04
Concourse: 3.14.0
Server is behind proxy. Concourse installation is binary, non-docker. Proxy has been setup in /etc/environment as:
> http_proxy="http://proxy01.localnet.local:8080/"
> https_proxy="http://proxy01.localnet.local:8080/"
In that server, I can successfully access outside:
$ git clone https://github.com/pivotal-cf/pcf-pipelines
Cloning into 'pcf-pipelines'...
remote: Counting objects: 20990, done.
remote: Compressing objects: 100% (29/29), done.
remote: Total 20990 (delta 13), reused 22 (delta 8), pack-reused 20953
Receiving objects: 100% (20990/20990), 25.70 MiB | 8.46 MiB/s, done.
Resolving deltas: 100% (11497/11497), done.
Error:
resource script '/opt/resource/check []' failed: exit status 128
stderr:
Cloning into '/tmp/git-resource-repo-cache'...
ssh: connect to host github.com port 22: Operation timed out
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
That's it. I can't find anything that can lead me to troubleshoot the environment.
Any feedback is greatly appreciated!!

Not knowing your git resource's source config, I bet that you're missing the private_key field there. With SSH urls, you always have to authenticate with a private key -- no such thing as anonymous git access. Anonymous access does exist over HTTPS, though, so that's why it fixed the problem.

Answering my own question: In pipelines.yml file I had to modify github URL and change it from
uri: git#github.com:pivotal-cf/pcf-pipelines.git
To this:
uri: https://github.com/pivotal-cf/pcf-pipelines
After that, it started working.

Recently I encountered this error with a 4XX error code. Turns out it was docker. An engineer had made their fork of a docker image public, so when our docker image was tagged no credentials were being supplied to the build and we were handed a 4XX error with this cryptic useless error message.
If you've recently edited a concourse pipeline with a dockerfile and are seeing this message, check the username and password are supplied and valid (can use docker login from cli or login at https://hub.docker.com. A short-term fix can be to make the image public, but a longer-term fix is to provide credentials to fetch a private image.

Related

I'm trying to run Plaid quickstart tutorial but it says I'm unable to fetch link_token

So I've been trying to do a quickstart tutorial by Plaid (https://www.youtube.com/watch?v=sGBvKDGgPjc&t=540s) so I can implement it in my app after. I was using Windows 11 and Visual Studio Code.
I cloned their git using git clone -c core.symlinks=true https://github.com/plaid/quickstart
It printed this at the end:
Cloning into 'quickstart'...
remote: Enumerating objects: 3603, done.
remote: Counting objects: 100% (962/962), done.
remote: Compressing objects: 100% (262/262), done.
Receiving objects: 100% (3603/3603), 2.98 MiB | 8.47 MiB/s, done.ed 2641
Resolving deltas: 100% (2205/2205), done.
error: unable to create symlink go/.env: Permission denied
error: unable to create symlink go/.env.example: Permission denied
error: unable to create symlink java/.env: Permission denied
error: unable to create symlink java/.env.example: Permission denied
error: unable to create symlink node/.env: Permission denied
error: unable to create symlink node/.env.example: Permission denied
error: unable to create symlink python/.env: Permission denied
error: unable to create symlink python/.env.example: Permission denied
error: unable to create symlink ruby/.env: Permission denied
error: unable to create symlink ruby/.env.example: Permission denied
fatal: unable to checkout working tree
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry with 'git restore --source=HEAD :/'
Configured .env:
PLAID_CLIENT_ID=*client id*
PLAID_SECRET=*secret id*
PLAID_ENV=sandbox
PLAID_PRODUCTS=auth,transactions
PLAID_COUNTRY_CODES=US,CA
PLAID_REDIRECT_URI=
I started the server and tried to start frontend as in the video but it shows this error in a rectangle instead. Does anyone know what the issue is?
I haven't changed anything in the code. I only added .env and added API keys, that's it.
Edit: I moved my .env file to node folder where backend file is, and it seem to fixed the problem. It's all working now
A couple of thoughts:
The .env file you provided here is missing a PLAID_ENV=sandbox line, that would definitely cause an error if it's actually missing from the .env and not a copy and paste error in your question.
Those error codes make me think the Quickstart might not be able to read the .env file. If you log out the client id and secret to the terminal window, are they correct?
Take a look at the terminal window where the backend is running -- do you see any errors?

Unable to push to github, Remote end hung up unexpectedly

I'm trying to upload a relatively large Unreal engine 4 project through sourcecontrol on Github.
It uploads completely, and when it reaches 100% it fails giving me this error:
Writing objects: 100% (8901/8901), 11.30 GiB | 33.67 MiB/s
Writing objects: 100% (8901/8901), 11.32 GiB | 31.25 MiB/s, done.
Total 8901 (delta 632), reused 8579 (delta 403)
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
error: RPC failed; curl 56 Send failure: Connection was reset
Everything up-to-date
(The error was parsed as 4: The remote disconnected. Check your Internet connection and try again.)
My connection is fine, because I tried it several times, and it always fails at 100%.
I tried it with Sourcetree and Github Desktop, and it produces the same error.
Check first if this is a client setting issue:
git config http.postBuffer 524288000
(and you can increase that setting since Git 2.13)
Also make sure to not exceed a GitHub size limit.
Had this issue recently, when I was using the HTTPs url of the repo for push, later switched to SSH and it works like expected. My Repo size was 500MB and using SSH fixed it for me.
Setting up SSH keys if you don't have one
create the SSH Key:
ssh-keygen -t rsa -b 4096 -C "github_registered_mail_id#xyz.com"
copy the key(everything) from the created public key file usually present in ".ssh/id_rsa.pub"
logon to github and add the public key under
settings->SSH_and_GPG_Keys->new_key
after adding the public SSH Key into Github, test the SSH connection using
ssh -vT git#github.com
Once you have your SSH ready.
Setup upstream(push) remote URL which will be SSH url of the repo instead of usual HTTPS url.
git remote add <remote-name> git#github.com:username/repo_name
Set your branches to use the new upstream url
git push --set-upstream <remote-name> <branch_name>
Push the large repository as usual
git push <remote-name> <branch_name>

cloning github through SSH auth with multiple accounts freezes

I've created and set up multiple ssh keys for authenticating with multiple github accounts. After successfully tried it out by means of ssh -Tcommand, I tried to clone a repo, but this freezes unexpectedly:
MacBook-Pro-di-Matteo:.ssh matteo$ ssh -T git#github.com-bertamini.matteo
Hi bertuz-gist! You've successfully authenticated, but GitHub does not provide shell access.
MacBook-Pro-di-Matteo:.ssh matteo$ git clone git#github.com-bertamini.matteo:bertuz/bertuzFox.git tst
Cloning into 'tst'...
remote: Counting objects: 253, done.
remote: Compressing objects: 100% (12/12), done.
I can't figure out if it is my fault or a temporary github glitch. Any help?
As illustrated by "Git fetch/pull/clone hangs on receiving objects", that kind of issue is generally caused by:
the remote side having an issue (but GitHub status history doesn't show any issue)
the network (middle or client side)
the ssh config, if ssh url are used (ServerAliveInterval 60)
The OP Bertuz confirms in the comments the reason is the second one (network):
The wifi I was using used to block git connections.
Now everything works smoothly. Shall I delete the question?

Jenkins returned status code 128 with github

With GitHub command I have:
ssh -T git#github.com
Hi (MyName)! You've successfully authenticated, but GitHub does not provide shell access.
My connection with GitHub is ok (no problem), but with Jenkins I have this error:
ERROR: Error cloning remote repo 'origin' : Could not clone git#github.com:Name-MysRepo/MyRepo.git
hudson.plugins.git.GitException: Could not clone git#github.com:Name-MysRepo/MyRepo.git
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.clone(CliGitAPIImpl.java:219)
at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1001)
at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:942)
at hudson.FilePath.act(FilePath.java:904)
at hudson.FilePath.act(FilePath.java:877)
at hudson.plugins.git.GitSCM.determineRevisionToBuild(GitSCM.java:942)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1101)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1369)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:676)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:581)
at hudson.model.Run.execute(Run.java:1575)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:477)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:241)
Caused by: hudson.plugins.git.GitException: Command "git clone --progress -o origin git#github.com:Name-MysRepo/MyRepo.git /root/.jenkins/jobs/TestKRGDAOV01/workspace" returned status code 128:
stdout: Cloning into '/root/.jenkins/jobs/TestKRGDAOV01/workspace'...
stderr: Permission denied (publickey).
fatal: The remote end hung up unexpectedly
Is this problem with public key?
I use Jenkins under Tomcat 7 / Ubuntu 12.
This error:
stderr: Permission denied (publickey). fatal: The remote end hung up unexpectedly
indicates that Jenkins is trying to connect to github with the wrong ssh key.
You should:
Determine the user that jenkins runs as, eg. 'build' or 'jenkins'
Login on the jenkins host that is trying to do the clone - that is, do not login to the master if a node is actually doing the build.
Try you ssh to github - if it fails, then you need to add the proper key to <jenkins user home>/.ssh
To check are the following:
if the right public key (id_rsa.pub) is uploaded to the git-server.
if the right private key (id_rsa) is copied to /var/lib/jenkins/.ssh/
if the known_hosts file is created inside ~/.ssh folder. Try ssh -vvv git#github.com to see debug logs. If thing goes well, github.com will be added to known_hosts.
if the permission of id_rsa is set to 700 (chmod 700 id_rsa)
After all checks, try ssh -vvv git#github.com.
Also make sure you using the ssh github url and not the https
In my case I had to add the public key to my repo (at Bitbucket) AND use git clone once via ssh to answer yes to the "known host" question the first time.
i had sometime ago the same issue.
make sure that your ssh key doesn't have password and use not common user account (e.g. better to user account called jenkins or so).
check following article http://fourkitchens.com/blog/2011/09/20/trigger-jenkins-builds-pushing-github
When I got a similar status code 128 error from Jenkins:
status code 128:
stdout:
stderr: fatal: Couldn't find remote ref refs/heads/jenkins
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2172)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1864)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$500(CliGitAPIImpl.java:78)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:545)
at jenkins.plugins.git.GitSCMFileSystem$BuilderImpl.build(GitSCMFileSystem.java:358)
at jenkins.scm.api.SCMFileSystem.of(SCMFileSystem.java:197)
at jenkins.scm.api.SCMFileSystem.of(SCMFileSystem.java:173)
at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:113)
at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:67)
at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:299)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
Finished: FAILURE
It was because I hadn't pushed my new branch "jenkins" that had my Jenkinsfile. So the solution was to just push my changes
I deleted my project (root folder) and created it again. It was the fastest and simplest way in my case.
Do not forget to save all you changes, before you delete you project!
I first had another credential, then when i deleted that, and created a new one, i had the same error. I had to go to every project, and select the new Credential.
I changed the permission of my .ssh/id_rsa (private key) to 604.
chmod 700 id_rsa

Gitlab was unable to access your Gitolite system

I installed GitLab on Ubuntu server 12.
I followed this steps: http://blog.compunet.co.za/gitlab-installation-on-ubuntu-server-12-04/
Everything seems to be right... but when I try to create a new project, I get the error message:
Gitlab was unable to access your Gitolite system.
I ran the diagnostic tool ("bundle exec rake gitlab:app:status RAILS_ENV=production")
(in /home/gitlab/gitlab) Starting diagnostic
config/database.yml.............exists
config/gitlab.yml.............exists
/home/git/repositories/...........exists
/home/git/repositories/ is writable?........YES
remote: Counting objects: 12, done.
remote: Compressing objects: 100% (8/8), done.
Receiving objects: 100% (12/12), 1.12KiB, done.
Resolving deltas: 100% (1/1), done.
remote:Total 12 (delta 1), reused 0 (delta 0)
Can clone gitolite-admin?..............YES
UMASK for .gitolite.rc is 0007?............YES
/home/git/share/gitolite/hooks/common/post-receive exists?............YES
Finished
The log on admin area only shows:
ERROR -> /home/gitlab/gitlab/tmp/gitlabhq-gitolite-1348050652/gitolite
The config/gitlab.yml file is ok.
The permissions on repositories are just like the tutorial (section 3 - permissions).
I even tried to remove the lock...
What would you advise to troubleshoot this?
If it helps, I had a very similar situation happen, except in my gitlab log I had the following error:
ERROR -> Pull error -> unable to clone gitolite-admin repo
I had compared the commit of the gitolite fork metioned, and found that the changes there were already in place in my version of gitlab.
I ended up stopping the gitlab related services, deleting the contents of the gitlab tmp directory, then restarted the gitlab related services.
Afterwards, everything appeared to be working fine.
If the issue comes from permission regex fixed in this commit of this gitolite fork, you can have a look at "GitHub Tip: download commits as patches":
Your commit can be downloaded by adding a .patch at the end of its url: patch.
That way, you can apply it to your current gitolite source (without even using git itself, just by using the patch command)
I was able to resolve this issue on my server by following the installation instructions section titled "Disable StrictHostKeyChecking for localhost and your domain" and adding a new section for my gitolite host, which was set to the IP address of the server rather than localhost. Open:
/etc/ssh/ssh_config
And add the lines:
Host [gitolite hostname/IP here]
StrictHostKeyChecking no
UserKnownHostsFile=/dev/null
(replace the bracketed part with the appropriate hostname/IP)
It's already in the setup steps, but I had skipped it earlier because I didn't understand what it was suggesting. Otherwise, the SSH client tries to show the yes/no prompt to accept a new hostname and the Ruby backend interprets that as a failure to connect to gitolite.