Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 347986

Summary: 500 error when merge conflicts with local change
Product: [ECD] Orion Reporter: John Arthorne <john.arthorne>
Component: ClientAssignee: Malgorzata Janczarska <malgorzata.tomczyk>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: malgorzata.tomczyk, tomasz.zarna
Version: 0.2Flags: tomasz.zarna: review+
Target Milestone: 0.2   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description John Arthorne CLA 2011-06-01 14:11:29 EDT
I have a modified (unstaged) file in my working tree. I attempted to merge incoming changes that include changes to that file. The server returns a 500 error and no error message is shown to the user. In the debugger I was able to capture the stack trace of the real exception on the server that shows it is a checkout conflict. This should not come back to the user as a 500 error but instead a more helpful message about the conflict.

org.eclipse.jgit.api.errors.JGitInternalException: Exception caught during execution of merge command. org.eclipse.jgit.errors.CheckoutConflictException: Checkout conflict with files: 
bundles/org.eclipse.orion.client.core/static/js/commands.js
	at org.eclipse.jgit.api.MergeCommand.call(MergeCommand.java:251)
	at org.eclipse.orion.server.git.servlets.GitCommitHandlerV1.merge(GitCommitHandlerV1.java:361)
	at org.eclipse.orion.server.git.servlets.GitCommitHandlerV1.handlePost(GitCommitHandlerV1.java:317)
	at org.eclipse.orion.server.git.servlets.GitCommitHandlerV1.handleRequest(GitCommitHandlerV1.java:69)
	at org.eclipse.orion.server.git.servlets.GitCommitHandlerV1.handleRequest(GitCommitHandlerV1.java:1)
	at org.eclipse.orion.server.git.servlets.GitHandlerV1.handleRequest(GitHandlerV1.java:57)
	at org.eclipse.orion.server.git.servlets.GitHandlerV1.handleRequest(GitHandlerV1.java:1)
	at org.eclipse.orion.server.git.servlets.ServletGitHandler.handleRequest(ServletGitHandler.java:49)
	at org.eclipse.orion.server.git.servlets.ServletGitHandler.handleRequest(ServletGitHandler.java:1)
	at org.eclipse.orion.server.git.servlets.GitServlet.doGet(GitServlet.java:39)
	at org.eclipse.orion.server.git.servlets.GitServlet.doPost(GitServlet.java:57)

This gets turned into a 500 error by GitCommitHandlerV1#merge:

		} catch (JGitInternalException e) {
			return statusHandler.handleRequest(request, response, new ServerStatus(IStatus.ERROR, HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "An error occured when merging.", e.getCause()));
		}
Comment 1 Tomasz Zarna CLA 2011-06-09 10:48:19 EDT
*** Bug 348721 has been marked as a duplicate of this bug. ***
Comment 2 Tomasz Zarna CLA 2011-06-10 08:08:14 EDT
The message Gosia showed me should do the job.
Comment 3 Malgorzata Janczarska CLA 2011-06-10 08:10:00 EDT
done