Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 347986 - 500 error when merge conflicts with local change
Summary: 500 error when merge conflicts with local change
Status: RESOLVED FIXED
Alias: None
Product: Orion
Classification: ECD
Component: Client (show other bugs)
Version: 0.2   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 0.2   Edit
Assignee: Malgorzata Janczarska CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 348721 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-06-01 14:11 EDT by John Arthorne CLA
Modified: 2011-09-01 11:42 EDT (History)
2 users (show)

See Also:
tomasz.zarna: review+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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