SharpSvn.SvnException: sqlite[S8]: attempt to write a readonly database

206 Views Asked by At

I got following error when I do `

svnclient.CleanUp(WorkDirPath);`


SharpSvn.SvnException: sqlite[S8]: attempt to write a readonly database
 ---> SharpSvn.SvnException: Additional errors:
 ---> SharpSvn.SvnException: sqlite[S8]: attempt to write a readonly database

Update

I have visual studio application and from this application i need upload/download any file to SVN server and this feature can access by end user. so for this i installed VisualSVN Server Manager Version: 4.3.3 on windows server. in my application i imported nuget for this SharpSvn.1.8-x64 to atchive this task (I am new in subversion and client).

Updated : I updated sharpSVN to 1.14001.156 thanks for it. but still my problem is not solved. i still get following error when try to add file "Failed to lock working copy" and then I tried Clean Up Command got "sqlite[S8]: attempt to write a readonly database" error. Is Visual SVN Server Version: 4.3.3 ok with SharpSVN 1.14 ? following is my code written in C#

     svnclient.Authentication.DefaultCredentials = new NetworkCredential(_svnuser, _svnpwd);

     CleanCommand(svnclient,_userworkdir);
    
        public bool AddFile(string path, SvnClient svnclient)
                {
                    try
                    {
                        return svnclient.Add(path);
                    }
                    catch (Exception ex)
                    {
                        Log.Error(String.Format(String.Format("Exception in function AddFile := {0} FilePath :- {1}", ex.Message.ToString(), path)));
                        return false;
                    }
                }
        public bool CleanCommand(SvnClient svnclient, String workingdir)
                {
                    bool res = false;
                    try
                    {
                        res = svnclient.CleanUp(workingdir);
                    }
                    catch (Exception ex)
                    {
                        Log.Error(String.Format(String.Format("Exception in function CleanCommand := {0}, workingdir :- {1}", ex.Message.ToString(), workingdir)));
                        res = false;
                    }
                    return res;
                }
1

There are 1 best solutions below

9
bahrep On

Note that SharpSVN 1.8 is outdated. If you use Subversion client based on SharpSVN (AnkhSVN?), it makes sense to update it or to switch to an up-to-date native Subversion 1.14.x client.

As an immediate solution, you can check out a new working copy and continue you work with it. If you have uncommitted changes in the working copy, you can copy them over into a new working copy (don't copy hidden .svn directory though).

I think that something prevents you from opening or writing the contents of the .svn metadata directory. This could be due to insufficient permissions or another program that locks your working copy:

  • Check NTFS permissions to the .svn directory in the root of your working copy and the .svn/wc.db file in particular (e.g., C:\Users\MyUser\MyVsProject\.svn\wc.db). You should double-check that your user account has permissions to write to C:\Users\MyUser\MyVsProject\ directory and all its contents.

  • Check if other SVN clients or programs work concurrently with your client and lock the working copy.