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

git pull fatal: NullReferenceException encountered. On an local instance of Bitbucket #1868

Closed
dougheeren opened this issue Oct 7, 2018 · 15 comments

Comments

@dougheeren
Copy link

  • [ X] I was not able to find an open or closed issue matching what I'm seeing

Setup

  • Which version of Git for Windows are you using? Is it 32-bit or 64-bit?
$ git --version --build-options

git version 2.19.1.windows.1
cpu: x86_64
built from commit: 11a3092e18f2201acd53e45aaa006f1601b6c02a
sizeof-long: 4
sizeof-size_t: 8

  • Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?
$ cmd.exe /c ver

Microsoft Windows [Version 10.0.17134.320]
  • What options did you set as part of the installation? Or did you choose the
    defaults?
# One of the following:
> type "C:\Program Files\Git\etc\install-options.txt"
> type "C:\Program Files (x86)\Git\etc\install-options.txt"
> type "%USERPROFILE%\AppData\Local\Programs\Git\etc\install-options.txt"
$ cat /etc/install-options.txt

Editor Option: VisualStudioCode
Custom Editor Path:
Path Option: Cmd
SSH Option: OpenSSH
CURL Option: WinSSL
CRLF Option: CRLFCommitAsIs
Bash Terminal Option: MinTTY
Performance Tweaks FSCache: Enabled
Use Credential Manager: Enabled
Enable Symlinks: Enabled
Enable Builtin Rebase: Disabled
Enable Builtin Stash: Disabled

  • Any other interesting things about your environment that might be related
    to the issue you're seeing?

We are using a local install of Bitbucket.

Details

  • Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other

All three shells Git Bash, CMD and PowerShell exhibit the issue.

$ get pull
  • What did you expect to occur after running these commands?

I expected it to pull the code from the remote origin and print. Already up to date.

  • What actually happened instead?

fatal: NullReferenceException encountered.
Object reference not set to an instance of an object.
OpenSSH window for https://myusername@ourbitbucketserver.com pops up.
Enter my massword and press OK.
fatal: NullReferenceException encountered.
Object reference not set to an instance of an object.
Already up to date.

  • If the problem was occurring with a specific repository, can you provide the
    URL to that repository to help us with testing?

All repositories on our internal instance of Bitbucket. This issue does not occur against GitHub. I suspect that it is because we our admin implemented single sign on. I am not using ssh for the repositories in question only https. I can provide the URL, but only if contacted directly I don't want to expose it here.

@daddyman
Copy link

daddyman commented Oct 8, 2018

I am seeing the same thing using 2.19.1 against our internal Bitbucket server. Reverting back to 2.19.0 the problem no longer occurs.

@marcinsmialek
Copy link

marcinsmialek commented Oct 8, 2018

I'm getting the same on internal BitBucket server as well with 2.19.1, while there are no issues with 2.19.0:

git pull
fatal: NullReferenceException encountered.
   Object reference not set to an instance of an object.
Password for 'https://xxx@xxx':
fatal: NullReferenceException encountered.
   Object reference not set to an instance of an object.
Already up to date.

My installation was updated from 2.19.0 to 2.19.1 with Chocolatey

@PhilipOakley
Copy link

I don't find the error message in the code: git grep ' not set ' origin/master (the search was one that did give some output for a quick peruse...) - maybe the issue is in the handling of the credentials.

Has it also been reported to BitBucket?

@li-fstz
Copy link

li-fstz commented Oct 8, 2018

git push getting the same on Azure DevOps as well with 2.19.1.

fatal: NullReferenceException encountered.
未将对象引用设置到对象的实例。

@marcinsmialek
Copy link

I can see this issue appear only when interacting with http repos. It may be a duplicate of this:
microsoft/Git-Credential-Manager-for-Windows#774

@PhilipOakley
Copy link

the new release Comes with Git Credential Manager v1.18.0. (ignore the first 'comes with'..)

@PhilipOakley
Copy link

I'm guessing that the PR Treat null credentials and tokens as invalid; not as exception errors may be involved from a cursory glance at the various commits that are included in v1.18.0

@epilsits
Copy link

epilsits commented Oct 8, 2018

Installing the previous version of git credential manager, 1.17.2, resolves the authentication issues for now.

https://github.com/Microsoft/Git-Credential-Manager-for-Windows/releases/tag/v1.17.2

@ghost
Copy link

ghost commented Oct 8, 2018

I am seeing the same thing using 2.19.1 against our internal Bitbucket server. Reverting back to 2.19.0 the problem no longer occurs.

@PhilipOakley
Copy link

@adrian109 you may want to consider @epilsits 's solution because of the reason for the V2.19.1 release given in https://public-inbox.org/git/xmqqy3bcuy3l.fsf@gitster-ct.c.googlers.com/

Ultimately, someone will need to have a careful look at (probably the format of) the credentials being passed to see what caused that 'null reference' that is now being treated as 'fatal'

@epilsits
Copy link

epilsits commented Oct 9, 2018

Fixed in git credential manager 1.18.1. Just install over top.

https://github.com/Microsoft/Git-Credential-Manager-for-Windows/releases/tag/v1.18.1

@lassevk
Copy link

lassevk commented Oct 11, 2018

I'm assuming this will be fixed in an upcoming version of git as well? That is, distributing the new credential manager.

@PhilipOakley
Copy link

@lassevk moderately soon, hopefully, there will be a minor version release of Git for Windows that will include the updated GCM v1.18.1. [just need more volunteer time for the PR and tests ;-)
That should eliminate the `Fatal: NullReferenceException" but appears not to fix the #1874 https://github.com//issues/1874 delays. (still to hear from the OP if the issue is definitely the AV, or something elese)

@dougheeren
Copy link
Author

dougheeren commented Oct 11, 2018

I've been able to fix it by:
git config credential.helper store
git config --unset credential.helper
git config --global credential.helper store
Referenced in this SO article https://stackoverflow.com/questions/5343068/is-there-a-way-to-skip-password-typing-when-using-https-on-github

However, I was going to revert to 2.19.0 to fix it until this worked. Not ideal because it stores the credentials in a text file according to the article, but I am working again.

@dscho
Copy link
Member

dscho commented Oct 12, 2018

This comment nails it: it is fixed in Git Credential Manager v1.18.1, which you can install on top of Git for Windows.

I'm assuming this will be fixed in an upcoming version of git as well? That is, distributing the new credential manager.

To answer the implied question (I cannot answer the explicit question whether you assume this): yes, the next official Git for Windows version will have a new Git Credential Manager version. Also, the current snapshot at https://wingit.blob.core.windows.net/files/index.html should have it already.

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

8 participants