0

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;
                }
Ankush
  • 17
  • 4
  • Is this question specific to SharpSVN? Does the same error occur when you run `svn cleanup` against the same working copy with up-to-date `svn cleanup` version (1.14.x)? Does the same error occur when you check out a new working copy? You need to update your question with more information about your working copy, where its stored, what versions of SVN / SharpSVN are used, etc. Note that you can search the Internet for the error wording `sqlite[S8]: attempt to write a readonly database` for answers. – bahrep Jul 13 '22 at 11:27
  • thanks for reply. yes this is regarding sharpsvn i am using VisualSVN Server Manager Version: 4.3.3 Sharpsvn sharpSvn.1.8-x64 in visual studio 19 everything was working fine but some how i got " Working copy path locked " error for my working directory and dont know why so I could not add/update file using this working directory then i tried clean my working directory using following command svnclient.CleanUp(workingdir) by code then I got ---> SharpSvn.SvnException: sqlite[S8]: attempt to write a readonly database. – Ankush Jul 13 '22 at 11:52
  • - and this not for new working copy, if delete working copy and checkout again then it is does not has issue – Ankush Jul 13 '22 at 11:52

1 Answers1

0

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.

bahrep
  • 29,961
  • 12
  • 103
  • 150
  • I think i am not using AnkhSVN , so I canot move latest version right? - Yes if check out working copy again my problem will solve but I dont want this I need to check working copy lock then clean working copy by the code. - Clean command always fail if working copy locked or unlock. what needs to check in wc.db file ? can we handle this by GUI? No other SVN client works parallel. – Ankush Jul 13 '22 at 12:39
  • @Ankush so what Subversion client are you using in Visual Studio (or on your computer in general)? I don't understand why you use and mention an outdated SharpSVN in the first place. But if you have an outdated client then it would be best to upgrade it. Note that you can check the NTFS permissions using Windows File Explorer (e.g., https://www.ntfs.com/ntfs-permissions-setting.htm). – bahrep Jul 13 '22 at 12:47
  • ok, My task is. 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). SharpSvn.1.8-x64 is not correct or which version I can replace for it? – Ankush Jul 13 '22 at 13:19
  • @Ankush 1. It seems to me that there is a more up-to-date version of the [SharpSVN Nuget package](https://www.nuget.org/packages/SharpSvn). 2. I'm afraid that I cannot help you write your C# code with SharpSVN. 3. Possible causes to the error from your question are given in my answer (assuming that your code is correct). 4. I think that you need to reword your question to say that you are writing C# code using SharpSVN, show your code and describe all the symptoms in one post. – bahrep Jul 13 '22 at 13:48
  • -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 ? – Ankush Jul 14 '22 at 05:42
  • 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; } – Ankush Jul 14 '22 at 05:44
  • 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; } } – Ankush Jul 14 '22 at 05:44
  • @Ankush Don’t use comments to add this information. You need to update your question. – bahrep Jul 14 '22 at 05:52
  • when i did fresh check out then I can do cleanup and add file.and providing access right to wc.db and I can use clean in last case.So everytime i need to do cleanup command before add /update file? or can I used any condition like workinf copy lock or not, if yes which condiiton.? – Ankush Jul 14 '22 at 08:40