Bug 5435 - Can't publish solution to github repository
Summary: Can't publish solution to github repository
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Version Control ()
Version: 2.8.5
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Alan McGovern
URL:
Depends on:
Blocks:
 
Reported: 2012-05-31 07:38 UTC by Peter Kornfeld
Modified: 2012-07-09 14:52 UTC (History)
1 user (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
01 github (103.50 KB, image/png)
2012-07-01 13:41 UTC, Peter Kornfeld
Details
02 solution in md (79.28 KB, image/png)
2012-07-01 13:41 UTC, Peter Kornfeld
Details
03 publishing using pre-definded git repository (98.49 KB, image/png)
2012-07-01 13:42 UTC, Peter Kornfeld
Details
04 failed (93.96 KB, image/png)
2012-07-01 13:42 UTC, Peter Kornfeld
Details
02-01 publish (154.12 KB, image/png)
2012-07-02 02:49 UTC, Peter Kornfeld
Details
02-02 merge master (163.30 KB, image/png)
2012-07-02 02:49 UTC, Peter Kornfeld
Details
02-03 push changes (150.26 KB, image/png)
2012-07-02 02:50 UTC, Peter Kornfeld
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Peter Kornfeld 2012-05-31 07:38:48 UTC
Hello,

While try to publish solution to a github repository I got some errors.

1. After confirmation of publish got this...

Version control operation failed: Object reference not set to an instance of an object. Object reference not set to an instance of an object.

[Details]

System.NullReferenceException: Object reference not set to an instance of an object
  at Sharpen.HttpURLConnection.GetResponseCode () [0x00000] in <filename unknown>:0 
  at NGit.Util.HttpSupport.Response (Sharpen.HttpURLConnection c) [0x00000] in <filename unknown>:0 
  at NGit.Transport.TransportHttp.Connect (System.String service) [0x00000] in <filename unknown>:0 
  at NGit.Transport.TransportHttp.OpenPush () [0x00000] in <filename unknown>:0 
  at NGit.Transport.PushProcess.Execute (NGit.ProgressMonitor monitor) [0x00000] in <filename unknown>:0 
  at NGit.Transport.Transport.Push (NGit.ProgressMonitor monitor, ICollection`1 toPush) [0x00000] in <filename unknown>:0 
  at MonoDevelop.VersionControl.Git.GitRepository.Push (IProgressMonitor monitor, System.String remote, System.String remoteBranch) [0x0005d] in /builddir/build/BUILD/monodevelop-2.8.1/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitRepository.cs:921 
  at MonoDevelop.VersionControl.Git.GitRepository.Publish (System.String serverPath, FilePath localPath, MonoDevelop.Core.FilePath[] files, System.String message, IProgressMonitor monitor) [0x00094] in /builddir/build/BUILD/monodevelop-2.8.1/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitRepository.cs:348 
  at MonoDevelop.VersionControl.PublishWorker.Run () [0x00000] in /builddir/build/BUILD/monodevelop-2.8.1/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/PublishCommand.cs:93 
  at MonoDevelop.VersionControl.Task.BackgroundWorker (System.Object state) [0x00000] in /builddir/build/BUILD/monodevelop-2.8.1/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/Task.cs:49 

2. When try to publish a second time I got an other error...

Version control operation failed: No changes. No changes.

[Details]

NGit.Api.Errors.JGitInternalException: No changes
  at NGit.Api.CommitCommand.CreateTemporaryIndex (NGit.ObjectId headId, NGit.Dircache.DirCache index) [0x00000] in <filename unknown>:0 
  at NGit.Api.CommitCommand.Call () [0x00000] in <filename unknown>:0 
  at MonoDevelop.VersionControl.Git.GitRepository.Commit (MonoDevelop.VersionControl.ChangeSet changeSet, IProgressMonitor monitor) [0x000ed] in /builddir/build/BUILD/monodevelop-2.8.1/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitRepository.cs:583 
  at MonoDevelop.VersionControl.Git.GitRepository.Publish (System.String serverPath, FilePath localPath, MonoDevelop.Core.FilePath[] files, System.String message, IProgressMonitor monitor) [0x0008b] in /builddir/build/BUILD/monodevelop-2.8.1/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitRepository.cs:345 
  at MonoDevelop.VersionControl.PublishWorker.Run () [0x00000] in /builddir/build/BUILD/monodevelop-2.8.1/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/PublishCommand.cs:93 
  at MonoDevelop.VersionControl.Task.BackgroundWorker (System.Object state) [0x00000] in /builddir/build/BUILD/monodevelop-2.8.1/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/Task.cs:49 

Regards
Peter
Comment 1 Alan McGovern 2012-06-29 18:00:56 UTC
If you are on MonoDevelop version 2.8.1 then you will need to upgrade in order to use Http based push urls. I can't remember which exact commit fixed this, but i do remember doing some work on this a few months ago. I did create a repository on github and pushed a new project to it using both the http and https urls (providing my username and password) and it worked successfully.

If the version number in the bug report is incorrect and you are actually on a newer version of MonoDevelop, please reopen the bug and provide exact details for how you are triggering this issue so I can reproduce it locally.
Comment 2 Peter Kornfeld 2012-07-01 13:41:26 UTC
Created attachment 2139 [details]
01 github
Comment 3 Peter Kornfeld 2012-07-01 13:41:50 UTC
Created attachment 2140 [details]
02 solution in md
Comment 4 Peter Kornfeld 2012-07-01 13:42:13 UTC
Created attachment 2141 [details]
03 publishing using pre-definded git repository
Comment 5 Peter Kornfeld 2012-07-01 13:42:32 UTC
Created attachment 2142 [details]
04 failed
Comment 6 Peter Kornfeld 2012-07-01 13:43:43 UTC
Thanks Alan!

Unfortunately it still not works in 2.8.5
I added some screenshots that may help...
Comment 7 Peter Kornfeld 2012-07-01 13:46:41 UTC
It should help also...

The local .git directory with the local git information is created event the error, so the solution show as under version control...
Comment 8 Alan McGovern 2012-07-01 15:34:09 UTC
Would you be able to check with MonoDevelop 3.0 or higher? I know I fixed some issues with http/https but i cannot find the exact commit which resolved the issue. This makes it impossible for me to tell which release the bug was fixed in. As everything does work with 3.0, i can only assume that it happened somewhere between the last release in the 2.8 series and the first release in the 3.0 series.
Comment 9 Peter Kornfeld 2012-07-02 02:49:23 UTC
Created attachment 2143 [details]
02-01 publish
Comment 10 Peter Kornfeld 2012-07-02 02:49:38 UTC
Created attachment 2144 [details]
02-02 merge master
Comment 11 Peter Kornfeld 2012-07-02 02:50:03 UTC
Created attachment 2145 [details]
02-03 push changes
Comment 12 Peter Kornfeld 2012-07-02 02:55:05 UTC
As I have problem to install MD from source on Fedora, I installed MD 3.0.3.2 on a Win7 machine to test.

It's looks much better with this version but event there is no error no files actually pushed to the git repository.

I added some images to see the messages I got.

The steps I took:

1. publish - got error about a non-fast-forward update an need of merge...
2. merge branch with master - got no message at all
3. push changes - got message that reads 'funny refname'

at the and - there are no files in the repo...
Comment 13 Alan McGovern 2012-07-02 19:58:39 UTC
Ah, I suspect I know what the problem is. You created a repository on github and choose the option to create a README file so the repository can be cloned immediately. This forces a respository to be created which has a 'master' branch and a commit. The 'publish to repository' option only works when the remote repository is empty (i.e. it contains no commits). If it already contains commits, you get an error.

I'm not entirely sure what causes the 'funny refname' error. It's being propagated from inside our git library. I suspect that the locally create repository has refnames which are conflicting with the remote repository and that is causing the problem.

The workaround for now is that you should not click the 'Initialize this repository with a README' button when creating your repository in github. I will need to review the relevant code and see how we can gracefully detect and handle this situation.
Comment 14 Peter Kornfeld 2012-07-03 02:45:31 UTC
You were right!
When creating an empty repo MD was able to publish with no messages at all.

Now I can confirm that MD 3.0.3.2 or better works good with git version controlling...(It should be nice to find the exact version)...

However I have one more - for now less important to me - problem. The user name on the commit reads 'unknown-user, even MD prompted me to login credentials when publishing...

Thank you very much for your help...
Comment 15 Alan McGovern 2012-07-05 07:12:58 UTC
Perfect, that's great! I'm glad it's working now.

For your second issue, the username can be set in the 'Author Information' section of the MonoDevelop preferences. I'll close this bug as the issue appears to be resolved now. Thanks for reporting the problem.
Comment 16 Peter Kornfeld 2012-07-05 07:36:56 UTC
You are great Alan, and I really feel bad to torment you, but today - finally - I installed MD 3.1 from source on my Fedora 17 box and it still not works.
(next week I will check it on an Ubuntu box...)

It seams to be an issue with the OS, maybe some dependency...
There is a way I can help to debug it?

(
just to be sure, here the trace of the exception

System.NullReferenceException: Object reference not set to an instance of an object
  at Sharpen.HttpURLConnection.GetResponseCode () [0x00000] in /home/peter/Downloads/monodevelop/main/external/ngit/Sharpen/Sharpen/HttpURLConnection.cs:177 
  at NGit.Util.HttpSupport.Response (Sharpen.HttpURLConnection c) [0x00000] in /home/peter/Downloads/monodevelop/main/external/ngit/NGit/NGit.Util/HttpSupport.cs:264 
  at NGit.Transport.TransportHttp.Connect (System.String service) [0x00114] in /home/peter/Downloads/monodevelop/main/external/ngit/NGit/NGit.Transport/TransportHttp.cs:548 
  at NGit.Transport.TransportHttp.OpenPush () [0x00006] in /home/peter/Downloads/monodevelop/main/external/ngit/NGit/NGit.Transport/TransportHttp.cs:454 
  at NGit.Transport.PushProcess.Execute (NGit.ProgressMonitor monitor) [0x00012] in /home/peter/Downloads/monodevelop/main/external/ngit/NGit/NGit.Transport/PushProcess.cs:137 
  at NGit.Transport.Transport.Push (NGit.ProgressMonitor monitor, ICollection`1 toPush) [0x00072] in /home/peter/Downloads/monodevelop/main/external/ngit/NGit/NGit.Transport/Transport.cs:1359 
  at MonoDevelop.VersionControl.Git.GitRepository.Push (IProgressMonitor monitor, System.String remote, System.String remoteBranch) [0x0005d] in /home/peter/Downloads/monodevelop/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitRepository.cs:924 
  at MonoDevelop.VersionControl.Git.GitRepository.Publish (System.String serverPath, FilePath localPath, MonoDevelop.Core.FilePath[] files, System.String message, IProgressMonitor monitor) [0x00094] in /home/peter/Downloads/monodevelop/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitRepository.cs:343 
  at MonoDevelop.VersionControl.PublishWorker.Run () [0x00000] in /home/peter/Downloads/monodevelop/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/PublishCommand.cs:95 
  at MonoDevelop.VersionControl.Task.BackgroundWorker (System.Object state) [0x00000] in /home/peter/Downloads/monodevelop/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/Task.cs:49 
)
Comment 17 Alan McGovern 2012-07-05 07:41:38 UTC
Would you be able to tell me what url you are trying to publish to? I've had a few reports of this bug but have not been able to reproduce it yet.
Comment 18 Peter Kornfeld 2012-07-05 07:42:59 UTC
https://github.com/kepeter/CecIL.git
Comment 19 Alan McGovern 2012-07-05 12:48:00 UTC
The issue you experienced there is a duplicate of bug #5894. I just fixed this in git and it should be contained in the next release. The change is to make monodevelop prompt you to either accept or reject an untrusted certificate if one is encountered.

The 'correct' fix is to add GitHub's ssl certificate to the trusted store  on your computer using certmgr: http://linux.die.net/man/1/certmgr.

Alternatively you can use the ssh based connections (SSH or git-readonly) assuming you have an ssh key registered with github. This will bypass the problem completely.
Comment 20 Peter Kornfeld 2012-07-09 14:52:12 UTC
Got last bits from github and all work like charm...

Thank you Alan, very much!