22
votes

I am a new user with SVN, and I meet a problem on SVN commit command.

I use TortoiseSVN 1.6.6, and Ubuntu Subversion image with WMware as server.

I did create a repository on SVN server, and I can easily checkout files from the repository, but commit.

When I do commit, it always shows the problem.

Command: Commit  
Error: Commit failed (details follow):  
Error: Authorization failed  
Finished!:   

This problem only shows at local client with SVN server repository on VM. I tried creating repository on local machine with TortoiseSVN, and it is no problem on Commit. I also tried a working copy on server machine, it is no problem on Commit also.

Did anybody experience this issue? It is not any problem on Checkout from VM SVN server but it shows trouble on local client commit to VM server.

Should anything need to be setup I missed to do it?

11
This question's old but I'll add my 2 cents because I recently had this problem. My issue was the way I checked the repository out. I inadvertently used svn://example.com/Repo instead of svn+ssh://[email protected]/Repo as the source, and the anonymous checkout worked fine, but I was unable to commit. If I'd made sure I'd checked it out the same way as I was doing on other systems I wouldn't have had a problem but I didn't. Might be worth checking if this is your problem: compare the repo source between working and nonworking and see if there is anything obviously amiss.Wug

11 Answers

17
votes

It's the authorization that failed. That means the first step, the authentication was successful.

So: the username/password is correct and was accepted by your server. But then that user wasn't allowed to access the path/resource.

check your path based authorization file (conf/authz) and make sure that user has the rights.

16
votes

For me it was because of server migration. In svnserve.conf I forgot to uncomment:

auth-access = write
password-db = passwd
6
votes

If the server is using svnserve to serve the repository (which means you are using a svn:// URL) then you should check the file conf/svnserve.conf in the repository. The default configuration allows anonymous read, but only authenticated write accesses IIRC.

4
votes

My experience was similar to bluebrother I'd created a new repository correctly but hadn't setup the users properly. It let me Checkout but not Commit

Edit repoLocation/conf/svnserve.conf and uncomment the line

password-db = passwd

Edit repoLocation/conf/passwd and add a username and password to passwd for example

tim = password

4
votes

I had the exact same issue with RapidSVN (or when using svn commit from the CLI). The issue turned out that I was checking out the repo using the Anonymous Subversion Access (the svn:// link):

svn checkout svn://svn.r-forge.r-project.org/svnroot/rsitesearch/

But when using this link for the repo you cannot commit changes. So the solution was to use the svn+ssh:// link allowing Developer Subversion Access via SSH:

svn checkout svn+ssh://[email protected]/svnroot/rsitesearch/

With other SVN services, the correct link for commit could be https://. Actually I have better experience with the https:// checkout, so try that first.

Now svn commit should work as expected.

(This is the same solution as the one suggested by Wug in the comment to the OP.)

3
votes

First of all, can you browse the repository from Tortoise? If you can, then the user account you are accessing the repository with doesn't have write (=commit) rights.

If you can neither browse not commit: It could be that Tortoise has stored the wrong authentication data on your client. I think it should ask for the credentials again in that case, but maybe it doesn't. Try this:

  1. Open your Start menu, go to the TortoiseSVN group

  2. Click "TortoiseSVN settings"

  3. Go to "Saved data"

  4. Click "Clear" in "Authentication data"

Tortoise will then forget all stored passwords, and should ask you again next time you try to access the VM.

3
votes

If you are using svnserve to provide SVN access (i.e. your repository url looks like svn://server/repo), make sure your server is allowing write access. In some installations, the server is started with read-only access by default:

# The -R option enforces read-only access, i.e. write operations to the
# repository (such as commits) will not be allowed.
SVNSERVE_OPTIONS="-d -R -r /srv/svn/repos"
2
votes

Check out your files using http protocol instead of svn protocol. I had the same issue as I was checking out the files using svn:// protocol. Later I changed the protocol to http:// and everything started working normal.

0
votes

Also, double check that the actual repository on the server has the correct file permissions to be written to by the server process (either svnserve or Apache). It's probably okay since you were able to create the repository in other ways, but it's worthwhile to check just in case.

0
votes

note: I use sasl, and I found out the hard way that it's case sensitive, and expects lowercase usernames; i.e. "username123" won't match "USERNAME123" in your authz file, albeit they are spelled the same, so maybe check to make sure your usernames are lowercase (in your authz file)

0
votes

It happened to me too. @Stefan is right. In [repo]/conf/svnserve.conf we can read:

If you don't specify an authz-db, no path-based access control is done.
Uncomment the line below to use the default authorization file.

just over authz-db = authz. So, just uncomment this, bring to an authorization failure.