Gemini Community Support Site

This Gemini community support site can be used to find solutions to product issues. You can log in using Open Id, Google Profile and even Facebook. Feel free to ask a question or browse FAQs and documentation. Product tour videos are also available along with how-to videos demonstrating key Gemini capabilities.




Gemini 3.5 + SVN hooks 3.5 integration fails

add-ons

We just upgraded Gemini to 3.5 from 3.1 and it mostly went smoothly, until I tried to upgrade the SVN integration piece to the 3.5 version.  Sorry if this is a dupe, but the hook appears to be failing earlier in the process than the other posts.

The debugger says
[2904] CounterSoft Gemini: Main
[2904] CounterSoft Gemini: Argument: pre-commit
[2904] CounterSoft Gemini: Argument: C:\Repository
[2904] CounterSoft Gemini: Argument: 2413-bm
[2904] CounterSoft Gemini: Constructing Service Manager.
[2904] CounterSoft Gemini: Constructed Service Manager.
[2904] CounterSoft Gemini: Gemini Username: svn_checkin
(transaction log ends here...)

Tortoise reports an unhandled exception in the pre-commit phase

Command: Commit 
Modified: C:\Projects\rjh\VDR\com.weldoninc.PC.VDR.Viewer\view\FormVDRMain.cs 
Sending content: C:\Projects\rjh\VDR\com.weldoninc.PC.VDR.Viewer\view\FormVDRMain.cs 
Error: Commit failed (details follow): 
Error: Commit blocked by pre-commit hook (exit code -532459699) with output: 
Error:  
Error: Unhandled Exception: System.Xml.XmlException: '100' is an unexpected token. The  
Error: expected token is '"' or '''. Line 20, position 74. 
Error:    at System.Xml.XmlTextReaderImpl.Throw(Exception e) 
Error:    at System.Xml.XmlTextReaderImpl.Throw(String res, String[] args) 
Error: at System.Xml.XmlTextReaderImpl.ThrowUnexpectedToken(String expectedToken1,  
Error: String expectedToken2) 
Error:    at System.Xml.XmlTextReaderImpl.ParseAttributes() 
Error:    at System.Xml.XmlTextReaderImpl.ParseElement() 
Error:    at System.Xml.XmlTextReaderImpl.ParseElementContent() 
Error:    at System.Xml.XmlTextReaderImpl.Read() 
Error:    at System.Xml.XmlLoader.LoadNode(Boolean skipOverWhitespace) 
Error:    at System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc) 
Error: at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace) 
Error:    at System.Xml.XmlDocument.Load(XmlReader reader) 
Error:    at System.Xml.XmlDocument.Load(Stream inStream) 
Error: at CounterSoft.Gemini.Commons.Rest.Serializer.ConvertToObject[T](Stream stream) 
Error: at CounterSoft.Gemini.WebServices.BaseService.GetObjectFromReponse[T](Stream stream) 
Error: at  
Error: CounterSoft.Gemini.WebServices.BaseService.ThrowResponseException(WebResponse response) 
Error: at CounterSoft.Gemini.WebServices.BaseService.ProcessResponse[T](String url,  
Error: Object obj, RequestType requestType) 
Error:    at CounterSoft.Gemini.WebServices.BaseService.WhoAmI() 
Error:    at CounterSoft.Gemini.SourceControl.SVN.Program.Main(String[] args) 
Finished!:  

When I look at the source for the SVN handler, I see that it appears to be failing here

(Program.cs:Line 120)
DiagnosticsManager.TraceMessage("Gemini Logged in user: " + GeminiServiceManager.UsersService.WhoAmI().UserName);

The only thing I can figure is that Gemini is returning some kind of an XML response that is not well understood (the reference to line 20 position 74?), but I'm not entirely sure how to examine the response and debug it in VisualStudio.  If I switch the hook stuff back to use the 3.1 binaries (still using Gemini server 3.5) it works roughly as expected (at least, it works like it did).

thanks!
-rj

horatio
· 1
horatio
Replies (8)
helpful
0
not helpful

Can you please upgrade to 3.5.1 and see if the issue is resolved?


Mark Wing
· 9108
Mark Wing
helpful
0
not helpful

Upgraded to 3.5.1, the problem remained, until I by chance changed the webservices URL to remove the 'webservices' off the end and changed it to just "http://localhost/geminiv3".  So maybe that was my fault for not paying enough attention that this needed to be changed.

Now I need to mess with it a little bit more, because the post-commit isn't writing the comments to Gemini.  The SVN connector throws an exception on this call to the service:

PostCommitHandler.cs, line 145
Program.GeminiServiceManager.IssuesService.CreateComment(issueID, sourceControlComment);

[236] CounterSoft Gemini: SVN check-in Committed Files: U   Weldon/Code/PC/VDR/VDRViewer/trunk/com.weldoninc.PC.VDR.Viewer/view/FormVDRMain.cs
[236] CounterSoft Gemini: Empty committed file data?
[236] CounterSoft Gemini: Gemini PostCommitHandler.Handle. Exception of type 'CounterSoft.Gemini.Commons.Rest.GeminiRestException' was thrown. :: CounterSoft.Gemini.WebServices ::    at CounterSoft.Gemini.WebServices.BaseService.ThrowResponseException(WebResponse response)
[236]    at CounterSoft.Gemini.WebServices.BaseService.ProcessResponse[T](String url, Object obj, RequestType requestType)
[236]    at CounterSoft.Gemini.WebServices.BaseService.GetResponse[T](String url, Object o, RequestType r)
[236]    at CounterSoft.Gemini.WebServices.IssuesService.CreateComment(Int32 issueId, IssueCommentEN comment)
[236]    at CounterSoft.Gemini.SourceControl.SVN.PostCommitHandler.Handle(String repositoryPath, Int32 revisionNumber) in C:\Gemini
v3\CounterSoftGeminiSourceControlv35_0\CounterSoft.Gemini.SourceControl.SVN\PostCommitHandler.cs:line 145
[236] CounterSoft Gemini: End Main

This is Gemini 3.5.1.  I've got VisualStudio running on the server, so I can trace the connector as it runs.


horatio
· 1
horatio
helpful
0
not helpful

I can change IIS settings if that would help, but I did see the instructions in the install docs about making sure that the Application Extention Mapping verbs were enabled.  I set mine to 'All Verbs' (Windows 2003 server) before starting these tests.

One thing I wasn't sure about is the "Executable:" in that dialog.  It is c:\windows\microsoft.net\framework\v2.0.50727\aspnet_isapi.dll.  I looked carefully at the screenshots in the documentation for a clue to see if I should point that at something else, but it looks like that is what the screenshot  shows.

EDIT:

This issue is starting to look like http://support.countersoft.com/forums/thread/11228.aspx so I'm going to head over there and try to patch the connector.


horatio
· 1
horatio
helpful
0
not helpful

Can you please amend the catch block as per the thread you have mentioned and send us the exception?


Saar Cohen
· 5000
Saar Cohen
helpful
0
not helpful

catch (GeminiRestException ex)

needs to read

catch (Gemini.Commons.Rest.GeminiRestException ex)

For some reason the compiler doesn't like the unqualified type, probably because I have something set wrong.  Here is the exception


[3028] CounterSoft Gemini: Gemini PostCommitHandler.Handle:Exception has been thrown by the target of an invocation.
[3028]    at CounterSoft.Gemini.Presenter.Base.BasePresenter.HandlePermissionException(String operation)
[3028]    at CounterSoft.Gemini.Presenter.IssuePresenter.CreateIssueComment(IssueEN issue, IssueCommentEN comment)
[3028]    at CounterSoft.Gemini.Web.Api.IssuesRestHandler.CommentCreate(RequestDetails rd). Exception of type 'CounterSoft.Gemini.Commons.Rest.GeminiRestException' was thrown. :: CounterSoft.Gemini.WebServices ::    at CounterSoft.Gemini.WebServices.BaseService.ThrowResponseException(WebResponse response)
[3028]    at CounterSoft.Gemini.WebServices.BaseService.ProcessResponse[T](String url, Object obj, RequestType requestType)
[3028]    at CounterSoft.Gemini.WebServices.BaseService.GetResponse[T](String url, Object o, RequestType r)
[3028]    at CounterSoft.Gemini.WebServices.IssuesService.CreateComment(Int32 issueId, IssueCommentEN comment)
[3028]    at CounterSoft.Gemini.SourceControl.SVN.PostCommitHandler.Handle(String repositoryPath, Int32 revisionNumber) in C:\Geminiv3\CounterSoftGeminiSourceControlv350\CounterSoft.Gemini.SourceControl.SVN\PostCommitHandler.cs:line 149
[3028] CounterSoft Gemini: End Main



horatio
· 1
horatio
helpful
0
not helpful

Ok, it seems like the bug has not gone.

Please amend the line for create comment to read:

Add the highlighted after line 144 of the PostCommitHandler:

   sourceControlComment.IssueID = issueID;

   sourceControlComment.ProjectID = Program.GeminiServiceManager.IssuesService.GetIssue(issueID).ProjectID;

   Program.GeminiServiceManager.IssuesService.CreateComment(issueID, sourceControlComment);


Saar Cohen
· 5000
Saar Cohen
helpful
0
not helpful

Okay, sorry for any confusion.  This thread started off as a different issue than 11228, but then appeared to take on the characteristics of 11228.  I added these two blocks as per thread 11228, which seems to be the same line you suggested to insert

if (Properties.Settings.Default.AddIssueComment)
{
   sourceControlComment.IssueID = issueID;
   // Added the following line as per Countersoft's instructions
   // http://support.countersoft.com/forums/thread/11228.aspx
   sourceControlComment.ProjectID = Program.GeminiServiceManager.IssuesService.GetIssue(issueID).ProjectID;
   Program.GeminiServiceManager.IssuesService.CreateComment(issueID, sourceControlComment);
}

[...]

// Added the following block as per Countersoft's instructions
// http://support.countersoft.com/forums/thread/11228.aspx
try
{
  Program.GeminiServiceManager.IssuesService.CreateSourceControlFile(issueID, sourceControlFileLink);
}
catch { }

stop the exceptions being thrown.  However, the debug logs show something isn't exactly right

[4040] CounterSoft Gemini: Main
[4040] CounterSoft Gemini: Argument: post-commit
[4040] CounterSoft Gemini: Argument: C:\Repository
[4040] CounterSoft Gemini: Argument: 2420
[4040] CounterSoft Gemini: Constructing Service Manager.
[4040] CounterSoft Gemini: Constructed Service Manager.
[4040] CounterSoft Gemini: Gemini Username: svncheckin
[4040] CounterSoft Gemini: Gemini Logged in user: svn
checkin
[4040] CounterSoft Gemini: Issue ID: 1
[4040] CounterSoft Gemini: Commit Comment: GEM:1 svn hook test
[4040] 
[4040] CounterSoft Gemini: Gemini User ID: svn_checkin
[4040] CounterSoft Gemini: SVN check-in Author: rhorn
[4040] CounterSoft Gemini: SVN check-in Repository Path: C:\Repository
[4040] CounterSoft Gemini: SVN check-in Revision Number: 2420
[4040] CounterSoft Gemini: SVN check-in Committed Files: U   Weldon/Code/PC/VDR/VDRViewer/trunk/com.weldoninc.PC.VDR.Viewer/view/FormVDRMain.cs
[4040] CounterSoft Gemini: Empty committed file data?
[4040] CounterSoft Gemini: Empty committed file data?
[4040] CounterSoft Gemini: End Main

Regardless of the "Empty committed file data?" messages, the commit and the log into gemini seems to work.  Again, I apologize for any confusion.  In order to generate the REST exception you asked for, I commented out the code listed above.


horatio
· 1
horatio
helpful
0
not helpful

You should leave this statment:

 Program.GeminiServiceManager.IssuesService.CreateSourceControlFile(issueID, sourceControlFileLink);

to execute


Saar Cohen
· 5000
Saar Cohen