Tortoise SVN attempt to write a readonly database windows - windows

Currently getting an error when trying to commit code via Tortoise SVN.
Transmitting file data ..done
Committing transaction... Committed revision 2827.
Warning: post commit FS processing had error:
sqlite[S8]: attempt to write a readonly database
There are no locks which I can see, Any recommendations to solutions will be great.

The error in your particular case happens on the server side. There is a problem with the post-commit hook script. Contact the server or repository admin.
Check the permissions to the working copy. If the error is produced by a server side hook script, contact the server administrator.
I guess that the complete error message that you receive looks like in this example:
svn: E155004: Commit failed (details follow):
svn: E155004: Failed to lock working copy 'C:\Users\usr\myproject'.
svn: E200031: sqlite[S8]: attempt to write a readonly database
svn: E200042: Additional errors:
svn: E200031: sqlite[S8]: attempt to write a readonly database
This issue should be caused by insufficient permissions to .svn directory and .svn/wc.db file in particular (e.g. C:\Users\usr\myproject\.svn\wc.db). You should double-check that the user account that runs svn commit has permissions to write to C:\Users\usr\myproject\ directory and its contents.
You can also workaround this issue by checking out a fresh working copy to a new location where you have the required permissions.

I got this error when logged in to Linux as the wrong user. Once I did a "sudo su -" to log in as the user profile that had svn permissions, I was able to work away OK.

Related

Git Gui on Windows: couldn't open ".git/PREPARE_COMMIT_MSG": permission denied

Been using Git Gui on Windows on a work computer for over two years now. Last night the repo was working fine, but this morning after a reboot, Git Gui pops up a message about "permission denied".
No idea what changed, although we did get an email saying that a corporate antivirus update had been pushed out which required a reboot. Also, a Windows update for December 2022 was installed on my machine which also required a reboot.
The full error message is:
couldn't open ".git/PREPARE_COMMIT_MSG": permission denied
couldn't open ".git/PREPARE_COMMIT_MSG": permission denied
while executing
"open [gitdir PREPARE_COMMIT_MSG] a"
(procedure "run_prepare_commit_msg_hook" line 8)
invoked from within
"run_prepare_commit_msg_hook"
(procedure "rescan" line 27)
invoked from within
"rescan ui_ready"
(procedure "do_rescan" line 2)
invoked from within
"do_rescan"
("after" script)
Things I have tried:
Based on suggestions in threads with similar "permission denied" errors, I ran the follow from a command prompt:
icacls "path\to\Work.git" /grant MyUserName:(OI)(CI)F /T
The command executed without errors, but no change to the repo.
Ran Git Bash (MINGW64) which runs without any immediate errors but only git status works. git add gives the error fatal: Unable to create '/path/to/Work/.git/index.lock': Permission denied
Tried a separate, personal, repo on the same work computer for a repo hosted on github.com. That worked fine (can commit, pull, etc.).
Any thoughts? My user account is part of the Administrators group, but it looks like the Windows and "corporate anti-virus" updates have modified or blocked something to do with my user account.
UPDATE 1
Rebooted Windows into Safe Mode. Now I can git add and git commit, though git push fails due to a failure to resolve dev.azure.com (something to do with the network not loaded in Safe Mode). Rebooted back into normal Windows and the problem returns: git add and other commands fail immediately and git push finds dev.azure.com but I get a permission denied error.
UPDATE 2
Based on the comments from #LeGEC, I checked the repo .git folder. There is no PREPRE_COMMIT_MESSAGE or index.lock file. The permissions haven't been touched by me, but after explicitly allowing my user "Full Control" over the folder, its still not working - still "permission denied" errors.
A colleague does not use Git for Windows, and was not having issues after the recent update. He suggested I try Visual Studio (which is tied directly into dev.azure.com)...and git works from Visual Studio 2019!
So we think that recent anti-virus or group policy changes has revoked, blocked or broken authentication of my user (presumably) connecting to the corporate network's and/or dev.azure.com. Somehow Visual Studio is able to authenticate me (through the Mcicrosoft Azure account?) which fails when using my Windows account....does that make sense?
Will update this question as and when I find out more details.
If anyone has seen this type of thing before (suddenly one application stops working with git with "permission denied" errors, while another works), your input would be appreciated!

Jenkins git authentication failed with correct credentials on Windows

I'm currently using Jenkins on Windows 10, and using git as version control system.
Although I provided correct repository URL and credential, I cannot use jenkins with error below.
Failed to connect to repository : Command "git.exe ls-remote -h REPOSITORY_URL HEAD" returned status code 128:
stdout:
stderr: git#URL: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Credential and URL doesn't seems wrong, since this build success previously with same credential. The only change after successful build was one line in build script.
git config --global core.sshCommand C:/Windows/System32/OpenSSH/ssh.exe
After I success with this script, git setting keeps failed. Is there any problem with that line? And how can I fix it?
EDIT
Problem solved! For anyone who has same problem, it was problem with the system user! Since ssh key stores in each user space, jenkins cannot detect where the ssh key located. Therefore, go to 'service' in windows, and change user of jenkins service to the user who has correct ssh key. It solved my problem!
Seems there is some problem in Jenkins.
It cannot locate OpenSSH folder in System32, and so that I cannot get log with it.
That would explain why the main Jenkins controller (aka "master" in old terminology) cannot contact the Git repository (assuming an SSH URL here, with technical remote user account "git")
Try and remove that git configuration to see if the error persists: Git should fall back to its own ssh.exe, packaged with Git For Windows.
As noted by the OP, this only works if said Jenkins is run as a user account, not as the system account.
Only then will it be able to access the %USERPROFILE%\.ssh folder.

Read-only permissions for Bit-Bucket server

when trying to push to BitBucket I get the following error message:
fatal: remote error: Insufficient permissions
You cannot push to XX/repository. Pushing requires write access and your
access is read-only.
Our BitBucket server does not run through ssh-keys but rather more with my account credentials and the osxkeychain. Clone and pull works perfectly and I have the error since I installed xcode, however, uninstalling xcode does not help.
I appreciate any idea!

SVN, new file commit failed using VPN

My company just installed a VPN. It works, we can access our intranet SVN server but it is impossible to commit a new file. Here is the error :
> svn commit -m "Sandbox test" .
Adding test.txt
Transmitting file data .svn: E120105: Commit failed (details follow):
svn: E120105: Error running context: The server sent an improper HTTP response
It occurs only when we commit a new file.
These following operations works well:
update
modify a file and commit
delete a file and commit
delete a directory and commit
add a directory and commit
show log
show repo-browser
We tested on several computer or user, connecting from home or from mobile network. Results are the same.
And all works fine without VPN (from company intranet).
We use TortoiseSVN v1.12.2 (i.e. Subversion v1.12.2) on Windows 10 and I just updated to TortoiseSVN v1.14.0 to test (no difference).
On the server side, SVN version is 1.8.19.
I read some post from people who had this kind of problem with SVN client v1.8 and resolve it with SVN client v1.9. Is it possible that the SVN server v1.8 has the same problem and we should upgrade it ?

Xcode Can't Commit Files to Github

I am trying to commit to my local repository but it keeps saying "The working copy “Project” failed to commit files.
warning: unable to access '/Users/me/.config/git/attributes': Permission denied"
I tried this Unable to access 'git/attributes'
It worked for a while but after about an hour of working on my project the error comes back.
I don't know if this is related but some storyboard files are randomly marked for Deletion (with the D beside their file name) when trying to commit.
Sicne that .config folder is supposed to be owned by the user, check, whenever you see again this error:
the new owner of that .config folder (to see of it is root)
the process running at that time (like a local BitBucket server running as root),
or your command history (to see if it involved a command like sudo htop)

Resources