Uploaded image for project: 'Bitbucket Cloud'
  1. Bitbucket Cloud
  2. BCLOUD-19152

Cloning a repo with LFS from bitbucket-pipelines.yml is not working as expected

    XMLWordPrintable

Details

    Description

      Hey guys,

      I have a private repository with a bitbucket-pipelines.yml in the root directory. I am currently migrating all of our CI tooling from Jenkins to Bitbucket pipelines.

      This particular repository uses Git LFS. I enabled the clone with Git LFS using the clone section of the pipeline. Here is my valid pipeline:

      image: zhughes3/ubuntu-ruby-node:latest
      
      clone:
        lfs: true
      
      pipelines:
        custom:
          manual:
            - step:
                script:
                  - pwd
                  - ls -al
        branches: 
          develop:
            - step:
                script:
                  - pwd
                  - ls -al
          release/*:
            - step:
                script:
                  - pwd
                  - ls -al
      

      Here is the output from the Pipeline:

      + umask 000
      + git clone -n https://x-token-auth:$REPOSITORY_OAUTH_ACCESS_TOKEN@bitbucket.org/$BITBUCKET_REPO_FULL_NAME.git $BUILD_DIR
      Cloning into '/opt/atlassian/pipelines/agent/build'...
      + git checkout 974062f284292a880b1d58c0278ffae1770cbf60
      Downloading B2C-Templates/iamtemplates/images/brand.png (8.7 KB)
      Error downloading object: B2C-Templates/iamtemplates/images/brand.png (89e49e8): Smudge error: Error downloading B2C-Templates/iamtemplates/images/brand.png (89e49e8324d505aa0edb96593e241378b727c699efa99ffe4a305aef857c9e5f): [89e49e8324d505aa0edb96593e241378b727c699efa99ffe4a305aef857c9e5f] Object does not exist on the server: [404] Object does not exist on the server
      Errors logged to /opt/atlassian/pipelines/agent/build/.git/lfs/logs/20190722T161835.702758305.log
      Use `git lfs logs last` to view the log.
      error: external filter 'git-lfs filter-process' failed
      fatal: B2C-Templates/iamtemplates/images/brand.png: smudge filter lfs failed
      

      We had seen the same exact issue in Jenkins. To fix this, we had to enable a setting to manually run a git lfs pull &lt;GIT_ORIGIN&gt; after doing the git checkout <TAG> . How do I perform a git lfs pull in the above pipeline?

      Also, I initially set the clone > lfs: true after finding this article. In it, it talks about manually &#34~;include an appropriate Git client in your build image, and pull with SSH authentication to retrieve the files.&~#34-; How would I do this if the pipeline automatically tries to clone the repository that the bitbucket-pipelines.yml file lives in?

      Attachments

        Activity

          People

            Unassigned Unassigned
            5cede6b50965 Zachary Hughes
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: