SVN Commit error: Can't open file txn-current-lock Permission denied - tortoisesvn

I can do checkouts, update and such. But when I try to commit changes, SVN gives me the following error:
Can't open file '/svn/p/pokemonium/code/db/txn-current-lock': Permission denied
I am using Windows 7 x64 SP1 with latest version of TortoiseSVN.
UAC is off, my account has read and write access, etc.
I can commit fine to other svn repositorys.

For me it ended up being a permissions issue on the server. I have my repo on a linux box, and ssh in to use svnadmin. For convenience sake, I had executed my create repository command as root. I was looking to get source I had on my Windows box into the repo, so was using TortoiseSVN to set up trunk/branches/tags. The directory containing the repo on the server was owned by root, and Tortoise was coming in as apache. I chowned the directory on the server to apache:apache, and it all went smoothly.
chown apache:apache -R my_repo_root

This is a server configuration issue. On windows host Visual SVN server runs under NETWORK SERVICE account by default. I solved this problem by granting full access rights to the repository folder to this account. Another option is switching Visual SVN service to the SYSTEM account, but that could pose a potential security risk.

Try this.
Make a back up copy of your working copy (just to be safe).
Make another copy your entire working copy off somewhere else.
Take the copy and delete all of the SVN folders out of it
Delete your working copy and do a fresh checkout
now copy/paste your corrupted working copy over your fresh checkout.
it is critical for this to work that you have completely removed ever _svn or .svn folder from your corrupted working copy before you perform the copy/paste.
This will leave you (hopefully) with a working copy that shows (!) on all the files you had modified since your last commit. And fixes your lock issue.

I had the same problem after I re-installed Windows 7 and just copied the SVN Repository from the old Windows to the new one.
After trying the steps that Mr. Manager proposed, the problem was still not fixed in my case.
After making sure that the permissions was setup correctly for the SVN Repository folder I just deleted the file 'txn-current-lock' in the /db folder of the project. That fixed it for me. From thereon I could commit my project again.

I had faced same issue on Unix box
Restarting the Apache service of the SVN server solved myproblem.
-f httpd.conf -k stop
-f httpd.conf -k start

In my own case, my linux server had been restarted after a power loss. The file system remained mounted as read-only since some journal repairs had been made. Rebooting the machine restored full function.

permissions worked for me too
error
repo/db/txn-current-lock: Permission denied
fix
chown apache:apache -R my_repo_root

Related

Remove a git fork on server

For school we use git to submit things. Every question here seems to be dealing with GitHub and isnt answering my specific question.
In our lab we were attempting to download the files but the prof was having issues on his end. He was asking me to try some commands etc. Anyways we did this:
ssh csci fork csci/Labs csci/$USER/Labs
git clone csci:csci/$USER/Labs
And it worked but the files had issues or something. He said he will get the sys admin to fix it. Then today he told me I need to delete my version on the server and just do it over again. I asked if I can just rm -r the folder but he said I need to delete the one on the git server - he said he doesnt know the command but I should be able to look it up.
I tried
git remote remove csci/Labs
but that did not work. I already deleted the local folder (before he told me about it actually) using rm -r Labs, and saying yes to the delete this git file warnings or whatever. So Im not sure where to go from here to delete it.
A repository is just a directory with working copy (though it is optional) and .git, so deleting the directory deletes the repository. To delete a remote repository you need to have access to the remote filesystem.
Try to run which should work also.
rm -rf .git

How to get Linux VM (on Windows host) to access the git working files on a shared directory

I have a Windows PC and on the same PC I have a Lubuntu VM inside the VMWare player.
I share my Windows folders so I can see them from the Lubunutu VM.
My problem is when I clone a Git repo on Windows (using Tortoise Git) and then try to access it from Lubuntu (using Git from command line) all files appear modified although I have not changed them.
I know that reason for this is that Windows and Linux handle the new lines differently.
My question is how can I configure my Git installations on Windows and on Lubuntu so I do not have this problem?
Update:
As suggested (by Craig Estey) this does not seem to be CRLF problem. I tried cloning a repo in my Linux VM on the shared directory and got following error:
fatal: 'origin' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.`
I have no problem cloning the same repo on the VM's local drive.
Any idea what could be the reason?
Note: The main reason I want to do this is to keep my VM's drive size small and use shared drive as much as possible. My VM's local drive is on SSD drive and shared drive is on much larger HDD.
Suppose you put a repository into a Windows Shared folder.
And mount(Mount shared folder on Ubuntu) that shared folder on Ubuntu, so you can clone that repository. (Talking about you can not clone, it must be another problem. I tested it, good for me.)
When you cd to that repository in that mount, you see all files are modified on Ubuntu, then it should be the EOL problem.
On Windows the autocrlf is true by default(assume you are using Git for Windows).
When you clone a repository on Windows, the files will be checkout with CRLF EOL.
But, On Ubuntu the autocrlf is false by default. Using git in that repository which is mount on Ubuntu, git expects the EOL is LF. But, the EOL is still CRLF. That's why git treats all file as modified on Ubuntu.
To fix this problem, make sure both OS to use the same autocrlf value, or using .gitattributes to control the EOL.
For example, using false value:
On windows,
Delete all files in working tree of that repository.
(Note: if you have local changes, commit them first.)
Run git config core.autocrlf false for that repository only. Or
Right click in that repository, click TortoiseGit -> Setting
In Settings dialog, go Git node, select local and un-check the AutoCrlf
Apply the change
Perform git reset hard to get all files back with correct EOLs.
Open TortoiseGit Log Message dialog
Right click on current branch and perform Reset "<current branch name>" to this
Choose "Hard" option
On Ubuntu, you should not see all files modified.
For using .gitattributes:
* -crlf

File permission issues when developing with Windows / hosting with Unix

I am developing a website on my windows laptop, and I use Git for the version control.
When I add my files to Git, they are added under the mode 644. The problem is, on my Linux server, I need the files to be 775. So what I do is, every time I deploy, I have to run chmod 775 -R . on my linux server and then commit the mode changes.
This is really anoying, time consuming, and result in lot of stranges commits.
My question is, how can I make my IDE (PHPStorm) create the files direcly with mode 775? I know Windows does not use the same file permission system as UNIX, but there must be a way to set the files permissions on windows that translates to 775 in Linux?
I tried to use "chmod" command on windows using Cygwin or similar tools, with no luck, Git always saves the files as 644 when I commit on windows.
See: Updating file permissions only in git
In summary, git update-index --chmod should do what you need.

SVN Error (Can't set file)

Everytime I try to commit files to SVN I got the following error.
Command Commit
Modified D:\Project\src\WebSite\SomePage.aspx.cs
Sending Content D:\Project\AKent\src\WebSite\Test\SomePage.aspx.cs
Commit succeeded, but other errors follow:
Error bumping revisions post-commit (details follow):
Can't set file 'D:\Project\AKent\src\WebSite\Test\SomePage.aspx.cs'
read-write: Access is denied.
After I get this error, SVN doesnt allow me to update or commit anything! And what is really frustrating me is that the project folder is around 2 GB and every night I download it from SVN over and over.
Please help me to fix it! I just wanna know what is wrong with my SVN. I tried reinstalling, didn't fix anything.
I had the same problem but fixed. My solution is:
1. Run Command Prompt as Administrator
2. Navigate to the target working copy
3. svn cleanup
The error
read-write: Access is denied.
indicates that svn can not access the file or can't set all attributes it needs to that file.
Now that either means you have not full access to those files or some other application has the file opened exclusively.
In the first case: make sure that your username has full access to all folders and subfolders of your working copy. Note that on Vista/Win7 it's not enough to be an admin - you have to give yourself full access to such files manually.k
In the second case: disable windows search indexer for your working copy, and exclude the working copy from being scanned by your virus scanner.
If you are sharing a svn versioned folder using samba and running into this issue when acessing it from windows machine, try:
http://tortoisesvn.net/faq.html#samba
Also add to your smb.conf file:
dos filemode = yes
copy the wrong folder (1) to another folder(2)
delete the wrong folder (1)
copy the backup(2) to (1)
Hope this approach works for you too!
I was trying to revert a file but was receiving the error listed in the OP's post. Soony's answer just about worked for me. I cannot comment or edit that answer, so I had to copy their answer and add a small step at the end. S/he deserves all the credit.
Run Command Prompt as Administrator
Navigate to the target working
copy svn cleanup
svn revert [filename]
(the revert did not work in Windows Explorer/TortoiseSVN integrated tools, I had to do it from the cmd line)

Subversion 1.6.6 Error "Could not open the requested SVN filesystem"

I am running ubuntu server with Subversion 1.6.6.
In windows I use the latest Tortoise SVN compiled against Subversion 1.6.6.
I create a new Repository and when I attempt to view the repository or import my files and get the following error:
"Could not open the requested SVN filesystem"
I can view the repositories via the command line (as root) but want to view them in Tortoise. Some repositories however are fine and I can view and comit without any problem via Tortoise.
I am sure its a user / permission thing but not sure where to look?
Any suggestions are greatly accepted.
Thank you
How do you access the repository on your server? If you're using file:///, that won't work since the repository format isn't compatible between OS. You have to use either svn:// or http(s):// to access the repository (and set up the corresponding server app).
If you're already using svn:// or http:// to access the repository, you can check the apache error log or run svnserve in console mode to get more detailed error messages.
your repositories must have full read/write access for the user who runs the server (svnserve or apache).
I ended up perforoming a repository dump then re-installing ubuntu, subversion, then installed USVN (great app). I next restored the repository from the dump. Everything is working great now.

Resources