Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infinite Loop when Git Permission Denied #38

Closed
danger-ranger opened this issue Jun 9, 2017 · 5 comments
Closed

Infinite Loop when Git Permission Denied #38

danger-ranger opened this issue Jun 9, 2017 · 5 comments

Comments

@danger-ranger
Copy link

https://media.giphy.com/media/fExunDejohBMQ/giphy.gif

@danger-ranger
Copy link
Author

Please make sure you have the correct access rights
and the repository exists.
From github.com:pivotal-cf/s3-image-resource
 * branch            master     -> FETCH_HEAD
HEAD is now at 8069372 adds test tag name file
ERROR: Permission to pivotal-cf/s3-image-resource.git denied to concourse-olm-bot.
fatal: Could not read from remote repository.

@RaniSputnik
Copy link

We are also seeing this same issue, but we get no error message.

From github.com:Organisation/Repository
 * branch            develop    -> FETCH_HEAD
HEAD is now at 5732f88 Add versions directory (#22)
From github.com:Organisation/Repository
 * branch            develop    -> FETCH_HEAD
HEAD is now at 5732f88 Add versions directory (#22)
From github.com:Organisation/Repository
 * branch            develop    -> FETCH_HEAD
HEAD is now at 5732f88 Add versions directory (#22)
From github.com:Organisation/Repository
 * branch            develop    -> FETCH_HEAD

I think I've found the issue in the git driver.

This code assumes that an error will be returned OR a write will occurr. If neither of those two things happens, the loop is never broken.

for {
err = driver.setUpRepo()
if err != nil {
return err
}
wrote, err := driver.writeVersion(newVersion)
if err != nil {
return err
}
if wrote {
break
}
}

When calling setupRepo we occassionally return no error and no write

if strings.Contains(string(pushOutput), falsePushString) {
return false, nil
}
if strings.Contains(string(pushOutput), pushRejectedString) {
return false, nil
}
if strings.Contains(string(pushOutput), pushRemoteRejectedString) {
return false, nil
}

I think this is incorrect, we should probably return an error for each of the three cases above.

@RaniSputnik
Copy link

This is what our plan looks like;

 - name: assign-version-image
    plan:
      - aggregate:
        - get: source
          resource: git-develop
          trigger: true
          passed: [run-tests]
        - get: image-version-temp
        - get: image-version-dev
          params:
            bump: patch

        attempts: ((attempts))
        timeout: ((timeout))

      - put: image-version-temp
        params:
          file: image-version-dev/number

In our case the failure is occurring in the put: image-version-temp step.

@renbeynolds
Copy link

renbeynolds commented Jan 3, 2019

We are seeing the same behavior as well:

Concourse Version: 4.2.1

Config:

- name: version
  type: semver
  source:
    driver: git
    uri: ((versions_repo))
    branch: master
    file: ((version_path))
    private_key: ((private_key))

- name: release-patch
  plan:
  - aggregate:
    - get: snapshot
      passed: [deploy]
    - get: version
      params:
        bump: patch
    - get: pipeline-repo
    - get: release-repo
  - put: release
    params:
      file: updated-snapshot/*
      version_file: version/version
  - put: version
    params: { file: version/version }

Log:

Cloning into '/tmp/semver-git-repo'...
Warning: Permanently added 'gitlab.domain' (ECDSA) to the list of known hosts.
HEAD is now at 2e88ca1 bump to 0.37.0
From gitlab.domain/product-versions
 * branch            master     -> FETCH_HEAD
HEAD is now at 2e88ca1 bump to 0.37.0
From gitlab.domain/product-versions
 * branch            master     -> FETCH_HEAD
HEAD is now at 2e88ca1 bump to 0.37.0
From gitlab.domain/product-versions
 * branch            master     -> FETCH_HEAD
HEAD is now at 2e88ca1 bump to 0.37.0
From gitlab.domain/product-versions
 * branch            master     -> FETCH_HEAD
HEAD is now at 2e88ca1 bump to 0.37.0
From gitlab.domain/product-versions
 * branch            master     -> FETCH_HEAD
HEAD is now at 2e88ca1 bump to 0.37.0
From gitlab.domain/product-versions
 * branch            master     -> FETCH_HEAD
HEAD is now at 2e88ca1 bump to 0.37.0
From gitlab.domain/product-versions
 * branch            master     -> FETCH_HEAD
HEAD is now at 2e88ca1 bump to 0.37.0

@vito
Copy link
Member

vito commented Aug 1, 2019

gonna close this in favor of #89 which is admittedly a dupe of this report, but has a PR associated to it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants