问题
We use visualsvn with tortoiseSVN on the client for version control of the binaries. That is, when we want to test a project, the test branch is merged with the build branch. This essentially updates the jar file to a newer version.
For some reason i cannot commit the now merged test branch, i get a 502 'Bad Gateway' error. I can commit some of the updated files, i have comitted the delete of the old jar file but i cannot commit the new jar.
The error i get points to the build branch, not the test branch, which i think may be the cause. I have tried deleting the offending file and replacing it with a copy from the build (sort of manual merge). But i get the same error.
Commit failed (details follow):
Unexpected HTTP status 502 'Bad Gateway' on
'/svn/binaries/!svn/rvr/11730/myProject/branches/build/newestversion.jar'
EDIT: The error has something to do with the merge. After undoing the add, i have copied the jar file into the test directory, added it and commited without any hick-ups.
The error propagates: after merging staging with test, i get the same error as above but with:
'/svn/binaries/!svn/rvr/11737/myProject/branches/tst/newestversion.jar'
回答1:
Per investigation with support@visualsvn.com, the root cause was the following line in the %VISUALSVN_SERVER%conf\httpd-custom.conf
file:
RequestHeader edit Destination ^https http early
Removing this line resolves the issue.
BTW, I can guess that the line was added to implement automatic redirection from HTTP to HTTPS. With modern VisualSVN Server versions, you can enable this redirection via the VisualSVN Server Manager console. Therefore, no need to add that line to the conf file.
You can follow these steps:
- Start the VisualSVN Server Manager console.
- Click Action | Properties.
- Click Network tab.
- Select the Automatically redirect HTTP to HTTPS (listen on port 80) option.
- Click Apply.
回答2:
HTTP status code 502 is a server side error:
RFC 7231 section 6.6.3:
The 502 (Bad Gateway) status code indicates that the server, while acting as a gateway or proxy, received an invalid response from an inbound server it accessed while attempting to fulfill the request.
As you are checking in binary files it could be a timeout from a server between you and the svn servern as the checking takes too long. So you should check the svn server and any server between you and the svn server.
回答3:
In my case, I was using RouixSVN and I only had to clear the SVN authentication data on my computer and log in again and it worked. Hope it helps someone else.
On an Ubuntu system this is done by deleting:
~/.subversion/auth
on Windows:
%APPDATA%\Subversion\auth
来源:https://stackoverflow.com/questions/49942606/cannot-commit-jar-file-to-svn-after-merge-502-bad-gateway