Inedo Community Forums Forums
    • Recent
    • Tags
    • Popular
    • Login

    Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

    If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

    Invalid Refspec Error

    Scheduled Pinned Locked Moved Support
    buildmastergit
    10 Posts 1 Posters 201 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ? This user is from outside of this forum
      Guest
      last edited by

      I've added the Git extension and connected to our BitBucket repository. When I try to perform an action to get the latest source through BuildMaster, I receive a dialog window that shows the repository, I click on it, it lists all of the branches it sees correctly, but when I click on a branch (e.g. master), I receive an error "ERROR: fatal: Invalid refspec 'master'". I've tried restarting both BuildMaster services but nothing I try seems to fix the issue.

      The Test Connection function in the Git extension passes correctly and when I look in the installation directory I'm able to see that BuildMaster has pulled down my source correctly.

      Please advise.

      Product: BuildMaster
      Version: 4.8.3

      1 Reply Last reply Reply Quote 0
      • ? This user is from outside of this forum
        Guest
        last edited by

        Hi Jaryd,

        Hmm, that's a fairly obscure error.

        According to the equally obscure Git manual, [https://git-scm.com/book/en/v2/Git-Internals-The-Refspec](The Refspec) , it could be a problem with a remote refspec.

        Can you try using the standard git client instead of the built-in one?

        1 Reply Last reply Reply Quote 0
        • ? This user is from outside of this forum
          Guest
          last edited by

          I'm currently pointing to the git executable located at "C:\Program Files\Git\bin\git.exe". I don't believe that is the built-in git executable and is the standalone version I downloaded and installed to use with normal development.

          1 Reply Last reply Reply Quote 0
          • ? This user is from outside of this forum
            Guest
            last edited by

            Hmm, ok ; so I'm guessing this is an empty repository? You will need to have files committed to the branch first, otherwise git will give that error.

            Branches are enumerated with "ls-remote --heads origin": https://github.com/Inedo/bmx-git/blob/master/Git/Clients/StandardGitClient.cs#L30

            Branches are switched using fetch/reset/clean: https://github.com/Inedo/bmx-git/blob/master/Git/Clients/StandardGitClient.cs#L35

            1 Reply Last reply Reply Quote 0
            • ? This user is from outside of this forum
              Guest
              last edited by

              This is not an empty repository. There are hundreds of files in it. Like I said, I can see all of them being pulled down by BuildMaster.

              1 Reply Last reply Reply Quote 0
              • ? This user is from outside of this forum
                Guest
                last edited by

                OK, so in that case, it may verywell be an invalid refspec?

                • git ls-remote --heads origin
                • git fetch origin <branch>
                • git reset --hard <ref>
                • git clean -dfq

                Can you try those commands against your git client?

                1 Reply Last reply Reply Quote 0
                • ? This user is from outside of this forum
                  Guest
                  last edited by

                  I tried all of those commands, everything executed correctly and I received no errors in git. However, I'm still receiving the same error in BuildMaster. Nothing seems to have changed.

                  1 Reply Last reply Reply Quote 0
                  • ? This user is from outside of this forum
                    Guest
                    last edited by

                    Were you able to get past this? What happens if you enter the path directly without browsing via the UI then executing the deployment plan? The format for the path in BuildMaster follows the pattern:

                    <BuildMaster repository name>|master:path/to/files
                    
                    1 Reply Last reply Reply Quote 0
                    • ? This user is from outside of this forum
                      Guest
                      last edited by

                      Manually entering the path as suggested seemed to work and at least get me passed that point. However, after selecting which project I want to create a deployable for on the next page, clicking Next throws a server error that states it can't find the path to the project. The path it is using is correct, but the base path is not.

                      The path I manually entered was to a path I found under the BuildMaster installation where BuildMaster seemed to have pulled down the source from the Git provider I created. Is that not the path I should have used? Should I use a path somewhere else on the drive that I manually download the source to? Although that doesn't make sense to me as I would expect BuildMaster to take care of everything automatically.

                      1 Reply Last reply Reply Quote 0
                      • ? This user is from outside of this forum
                        Guest
                        last edited by

                        The reason you have to Get Latest is because otherwise if you built straight from the BuildMaster-managed "ScrRepo" directory, there would be artifacts from the SCM tool also included (for git, .git files), and other times added files from the BuildMaster build steps that you wouldn't want stored with the repo.

                        Once you "Get Latest" somewhere, you can operate on a fresh set of files to perform whatever build tasks are necessary for deployment. Note the "Get Latest" action will essentially perform a clone or pull from BitBucket, then copy the files to the source directory of the action.

                        1 Reply Last reply Reply Quote 0

                        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                        With your input, this post could be even better 💗

                        Register Login
                        • 1 / 1
                        • First post
                          Last post
                        Inedo Website Home • Support Home • Code of Conduct • Forums Guide • Documentation