This is Xamarin's bug tracking system. For product support, please use the support links listed in your Xamarin Account.
Bug 350 - IOException: Unknown repository format ""; expected "0". When Create Solution
Summary: IOException: Unknown repository format ""; expected "0". When Create Solution
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: General (show other bugs)
Version: unspecified
Hardware: Macintosh Mac OS
: --- blocker
Target Milestone: ---
Assignee: Lluis Sanchez
URL:
: 680 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-08-20 02:09 UTC by Rodney S. Foley
Modified: 2011-10-03 22:29 UTC (History)
4 users (show)

See Also:
Tags:


Attachments
Apple Crash Report (66.26 KB, application/octet-stream)
2011-08-20 02:15 UTC, Rodney S. Foley
Details
patch (782 bytes, patch)
2011-09-02 12:31 UTC, Alan McGovern
Details | Diff

Description Rodney S. Foley 2011-08-20 02:09:48 UTC
Description of Problem:
Attempting to create a new Solution into a folder that is already a initialized as a Git repo.  I don't check the Git check box since I don't want it to set up Git it should just recognize it after words.

Mac OS LION, MD 2.8 Alpha 1, Just creating Solution with a C# Library project.

Steps to reproduce the problem:
1. Create New Solution and Select C# Library Project
2. Give Project and Solution an name
3. Click Forward
4. DO NOT CHECK ANY THING on Project Features
5. Click Ok
6. It starts creating the files and then throws the exception
7. After clearing the exception the solution and project seem to be created but the Project Features dialog is still showing.


Actual Results:
Throws an exception related to Git

Expected Results:
Should either recognize folder is already controlled by Git and use its settings, or ignore this for now and just create the solution and projects and wait until Git is enabled for the solution or project.  Either way, as long as it doesn't thrown an exception and leave MD in an unknown state.

How often does this happen? 
Everytime

Additional Information:

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IO.IOException: Unknown repository format ""; expected "0".
  at NGit.Storage.File.FileRepository..ctor (BaseRepositoryBuilder options) [0x00000] in <filename unknown>:0 
  at NGit.Storage.File.FileRepository..ctor (Sharpen.FilePath gitDir) [0x00000] in <filename unknown>:0 
  at NGit.Storage.File.FileRepository..ctor (System.String gitDir) [0x00000] in <filename unknown>:0 
  at MonoDevelop.VersionControl.Git.LocalGitRepository..ctor (System.String path) [0x00000] in <filename unknown>:0 
  at MonoDevelop.VersionControl.Git.GitRepository..ctor (FilePath path, System.String url) [0x00014] in /sources/monodevelop/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitRepository.cs:71 
  at MonoDevelop.VersionControl.Git.GitVersionControl.GetRepositoryReference (FilePath path, System.String id) [0x0007f] in /sources/monodevelop/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitVersionControl.cs:61 
  at MonoDevelop.VersionControl.Git.GitVersionControl.GetRepositoryReference (FilePath path, System.String id) [0x0009c] in /sources/monodevelop/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitVersionControl.cs:65 
  at MonoDevelop.VersionControl.Git.GitVersionControl.GetRepositoryReference (FilePath path, System.String id) [0x0009c] in /sources/monodevelop/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitVersionControl.cs:65 
  at MonoDevelop.VersionControl.VersionControlService.GetRepositoryReference (System.String path, System.String id) [0x00017] in /sources/monodevelop/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlService.cs:199 
  at MonoDevelop.VersionControl.VersionControlService.GetRepository (IWorkspaceObject entry) [0x00028] in /sources/monodevelop/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlService.cs:185 
  at MonoDevelop.VersionControl.Views.SubviewAttachmentHandler.HandleDocumentOpened (System.Object sender, MonoDevelop.Ide.Gui.DocumentEventArgs e) [0x00011] in /sources/monodevelop/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/SubviewAttachmentHandler.cs:42 
  at MonoDevelop.Ide.Gui.Workbench.OnDocumentOpened (MonoDevelop.Ide.Gui.DocumentEventArgs e) [0x0000d] in /sources/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs:961 
  at MonoDevelop.Ide.Gui.Workbench.WrapDocument (IWorkbenchWindow window) [0x00055] in /sources/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs:566 
  at MonoDevelop.Ide.Gui.ViewCommandHandlers..ctor (IWorkbenchWindow window) [0x0000d] in /sources/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ViewCommandHandlers.cs:49 
  at MonoDevelop.Ide.Gui.SdiWorkspaceWindow..ctor (MonoDevelop.Ide.Gui.DefaultWorkbench workbench, IViewContent content, Gtk.Notebook tabControl, MonoDevelop.Components.TabLabel tabLabel) [0x0011c] in /sources/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs:98 
  at MonoDevelop.Ide.Gui.DefaultWorkbench.ShowView (IViewContent content, Boolean bringToFront) [0x00113] in /sources/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DefaultWorkbench.cs:379 
  at MonoDevelop.Ide.Gui.LoadFileWrapper.Invoke (System.String fileName) [0x0017b] in /sources/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs:1058 
  at MonoDevelop.Ide.Gui.Workbench.RealOpenFile (MonoDevelop.Ide.Gui.FileOpenInformation openFileInfo) [0x00387] in /sources/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs:745 
  at MonoDevelop.Ide.Gui.Workbench.OpenDocument (FilePath fileName, Int32 line, Int32 column, OpenDocumentOptions options, System.String encoding, IViewDisplayBinding binding) [0x001c4] in /sources/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs:381 
  at MonoDevelop.Ide.Gui.Workbench.OpenDocument (FilePath fileName, OpenDocumentOptions options) [0x00000] in /sources/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs:312 
  at MonoDevelop.Ide.Templates.ProjectTemplate.OpenCreatedSolution () [0x0003b] in /sources/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/ProjectTemplate.cs:226 
  at MonoDevelop.Ide.Projects.NewProjectDialog.OpenEvent (System.Object sender, System.EventArgs e) [0x00206] in /sources/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/NewProjectDialog.cs:369 
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x000d5] in /private/tmp/monobuild/build/BUILD/mono-2.10.4/mcs/class/corlib/System.Reflection/MonoMethod.cs:226 
  --- End of inner exception stack trace ---
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x000eb] in /private/tmp/monobuild/build/BUILD/mono-2.10.4/mcs/class/corlib/System.Reflection/MonoMethod.cs:234 
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in /private/tmp/monobuild/build/BUILD/mono-2.10.4/mcs/class/corlib/System.Reflection/MethodBase.cs:96 
  at System.Delegate.DynamicInvokeImpl (System.Object[] args) [0x000bf] in /private/tmp/monobuild/build/BUILD/mono-2.10.4/mcs/class/corlib/System/Delegate.cs:408 
  at System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args) [0x00018] in /private/tmp/monobuild/build/BUILD/mono-2.10.4/mcs/class/corlib/System/MulticastDelegate.cs:70 
  at System.Delegate.DynamicInvoke (System.Object[] args) [0x00000] in /private/tmp/monobuild/build/BUILD/mono-2.10.4/mcs/class/corlib/System/Delegate.cs:382 
  at GLib.Signal.ClosureInvokedCB (System.Object o, GLib.ClosureInvokedArgs args) [0x00000] in <filename unknown>:0 
  at GLib.SignalClosure.Invoke (GLib.ClosureInvokedArgs args) [0x00000] in <filename unknown>:0 
  at GLib.SignalClosure.MarshalCallback (IntPtr raw_closure, IntPtr return_val, UInt32 n_param_vals, IntPtr param_values, IntPtr invocation_hint, IntPtr marshal_data) [0x00000] in <filename unknown>:0
Comment 1 Rodney S. Foley 2011-08-20 02:14:55 UTC
Update:  MD is definitely in an unstable state after this exception.  Every Menu Item I select throws the same exception above. When I  simple left clicked the solution name it throw a similar one but mentioned something about switching branches, all the exceptions where coming quick I didn't capture that different one.  Then after about 20 exception boxes popping up one after another, MD crashed.  I will attach the crash report in case it helps.
Comment 2 Rodney S. Foley 2011-08-20 02:15:30 UTC
Created attachment 159 [details]
Apple Crash Report
Comment 3 Rodney S. Foley 2011-08-20 22:45:59 UTC
Additional details in case they are helpful if you have trouble reproducing.

The Git repo is one I have created using the GitHub Mac App and synced with the Mac. Not sure if GitHub app does something different that git command line or not. 

Also I was able to repo this in 2.6 RC1 as well as 2.8 Alpha1.
Comment 4 Alan McGovern 2011-09-02 12:30:54 UTC
The issue is that the mac github application doesn't generate a .git/config file which is where important information such as the version of the repository is written. A normal call to git --init would generate this. We have a workaround locally and I've reported the issue to github. Hopefully they'll issue an update for their app to generate this file correctly but we will also need to handle the case where it's not there in a sane manner.
Comment 5 Alan McGovern 2011-09-02 12:31:53 UTC
Created attachment 244 [details]
patch

Patch
Comment 6 Lluis Sanchez 2011-09-21 12:26:39 UTC
Patch committed.
Comment 7 mhutch 2011-10-03 22:29:35 UTC
*** Bug 680 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.