svn: Cannot write to 'C:\working_copy\...\.svn\log (Accès refusé)

View: New views
4 Messages — Rating Filter:   Alert me  

svn: Cannot write to 'C:\working_copy\...\.svn\log (Accès refusé)

by rdeman :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

I am using SVNKit to checkout or update a working copy of a folder stucture from an SVN repository, and I sometimes (quite often) get the following error:
     svn: Cannot write to 'C:\working_copy\...\.svn\log (Accès refusé)

Any idea of what could be wrong in the following code, or has anyone encountered the same issue ?

    public static void checkoutOrUpdate(SVNURL svnUrl, File wcFolder,
        String user, String password) throws SVNException {

        DAVRepositoryFactory.setup();
        SVNRepositoryFactoryImpl.setup();
        FSRepositoryFactory.setup();

        SVNRepository repository = SVNRepositoryFactory.create(svnUrl);

        ISVNOptions options = SVNWCUtil.createDefaultOptions(true);
        ISVNAuthenticationManager authenticationManager = SVNWCUtil
            .createDefaultAuthenticationManager(user, password);
        repository.setAuthenticationManager(authenticationManager);
        SVNClientManager clientManager = SVNClientManager.newInstance(options,
            authenticationManager);

        SVNNodeKind nodeKind = repository.checkPath("", -1);
        if (nodeKind == SVNNodeKind.NONE) {
            SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.UNKNOWN,
                "No entry at URL ''{0}''", repository.getRepositoryRoot(false));
            throw new SVNException(err);
        } else if (nodeKind == SVNNodeKind.FILE) {
            SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.UNKNOWN,
                "Entry at URL ''{0}'' is a file while directory was expected",
                repository.getRepositoryRoot(false));
            throw new SVNException(err);
        }

        if (!wcFolder.exists()) {
            // CHECKOUT
            if (!wcFolder.exists()) {
                wcFolder.mkdirs();
            }

            SVNUpdateClient updateClient = clientManager.getUpdateClient();
            updateClient.setIgnoreExternals(false);
            updateClient.doCheckout(svnUrl, wcFolder, SVNRevision.HEAD,
                SVNRevision.HEAD, SVNDepth.INFINITY, true);
        } else {
            // CLEANUP
            SVNWCClient wcClient = clientManager.getWCClient();
            wcClient.setIgnoreExternals(false);
            wcClient.doCleanup(wcFolder);

            // UPDATE
            SVNUpdateClient updateClient = clientManager.getUpdateClient();
            updateClient.setIgnoreExternals(false);

            updateClient.doUpdate(wcFolder, SVNRevision.HEAD, true);
        }
    }

Thank you in advance
Rodolphe

Re: svn: Cannot write to 'C:\working_copy\...\.svn\log (Accès refusé)

by Alexander Sinyushkin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello Rodolphe,

What version of SVNKit do you use? Can you reproduce this problem with
debug logging switched on and send
us the log file. Read here https://wiki.svnkit.com/Troubleshooting on
how to turn on debug logging.

----
Alexander Sinyushkin,
TMate Software,
http://svnkit.com/ - Java [Sub]Versioning Library!
http://sqljet.com/ - Java SQLite Library!



rdeman wrote:

> Hello,
>
> I am using SVNKit to checkout or update a working copy of a folder stucture
> from an SVN repository, and I sometimes (quite often) get the following
> error:
>      svn: Cannot write to 'C:\working_copy\...\.svn\log (Accès refusé)
>
> Any idea of what could be wrong in the following code, or has anyone
> encountered the same issue ?
>
>     public static void checkoutOrUpdate(SVNURL svnUrl, File wcFolder,
>         String user, String password) throws SVNException {
>
>         DAVRepositoryFactory.setup();
>         SVNRepositoryFactoryImpl.setup();
>         FSRepositoryFactory.setup();
>
>         SVNRepository repository = SVNRepositoryFactory.create(svnUrl);
>
>         ISVNOptions options = SVNWCUtil.createDefaultOptions(true);
>         ISVNAuthenticationManager authenticationManager = SVNWCUtil
>             .createDefaultAuthenticationManager(user, password);
>         repository.setAuthenticationManager(authenticationManager);
>         SVNClientManager clientManager =
> SVNClientManager.newInstance(options,
>             authenticationManager);
>
>         SVNNodeKind nodeKind = repository.checkPath("", -1);
>         if (nodeKind == SVNNodeKind.NONE) {
>             SVNErrorMessage err =
> SVNErrorMessage.create(SVNErrorCode.UNKNOWN,
>                 "No entry at URL ''{0}''",
> repository.getRepositoryRoot(false));
>             throw new SVNException(err);
>         } else if (nodeKind == SVNNodeKind.FILE) {
>             SVNErrorMessage err =
> SVNErrorMessage.create(SVNErrorCode.UNKNOWN,
>                 "Entry at URL ''{0}'' is a file while directory was
> expected",
>                 repository.getRepositoryRoot(false));
>             throw new SVNException(err);
>         }
>
>         if (!wcFolder.exists()) {
>             // CHECKOUT
>             if (!wcFolder.exists()) {
>                 wcFolder.mkdirs();
>             }
>
>             SVNUpdateClient updateClient = clientManager.getUpdateClient();
>             updateClient.setIgnoreExternals(false);
>             updateClient.doCheckout(svnUrl, wcFolder, SVNRevision.HEAD,
>                 SVNRevision.HEAD, SVNDepth.INFINITY, true);
>         } else {
>             // CLEANUP
>             SVNWCClient wcClient = clientManager.getWCClient();
>             wcClient.setIgnoreExternals(false);
>             wcClient.doCleanup(wcFolder);
>
>             // UPDATE
>             SVNUpdateClient updateClient = clientManager.getUpdateClient();
>             updateClient.setIgnoreExternals(false);
>
>             updateClient.doUpdate(wcFolder, SVNRevision.HEAD, true);
>         }
>     }
>
> Thank you in advance
> Rodolphe
>
>  

---------------------------------------------------------------------
To unsubscribe, e-mail: svnkit-users-unsubscribe@...
For additional commands, e-mail: svnkit-users-help@...


Re: svn: Cannot write to 'C:\working_copy\...\.svn\log (Accès refusé)

by Alexander Kitaev-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello Rodolphe,

Issues of such kind may happen when some other process interferes with
SVNKit. This other process might be antivirus software or sometimes
Tortoise SVN caching daemon (TSVNCache.exe process in the process
manager), especially those of older versions.

Try disabling any background processes (antivirus, local firewall,
tsvncache) to see if it fixes the problem.

The reason of the problem is that another process opens file for reading
and then it is not possible to delete that file and create new on in
place of the old one, as old one is still "locked" by another process.

Alexander Kitaev,
TMate Software,
http://svnkit.com/ - Java [Sub]Versioning Library!
http://sqljet.com/ - Java SQLite Library!

rdeman wrote:

> Hello,
>
> I am using SVNKit to checkout or update a working copy of a folder stucture
> from an SVN repository, and I sometimes (quite often) get the following
> error:
>      svn: Cannot write to 'C:\working_copy\...\.svn\log (Accès refusé)
>
> Any idea of what could be wrong in the following code, or has anyone
> encountered the same issue ?
>
>     public static void checkoutOrUpdate(SVNURL svnUrl, File wcFolder,
>         String user, String password) throws SVNException {
>
>         DAVRepositoryFactory.setup();
>         SVNRepositoryFactoryImpl.setup();
>         FSRepositoryFactory.setup();
>
>         SVNRepository repository = SVNRepositoryFactory.create(svnUrl);
>
>         ISVNOptions options = SVNWCUtil.createDefaultOptions(true);
>         ISVNAuthenticationManager authenticationManager = SVNWCUtil
>             .createDefaultAuthenticationManager(user, password);
>         repository.setAuthenticationManager(authenticationManager);
>         SVNClientManager clientManager =
> SVNClientManager.newInstance(options,
>             authenticationManager);
>
>         SVNNodeKind nodeKind = repository.checkPath("", -1);
>         if (nodeKind == SVNNodeKind.NONE) {
>             SVNErrorMessage err =
> SVNErrorMessage.create(SVNErrorCode.UNKNOWN,
>                 "No entry at URL ''{0}''",
> repository.getRepositoryRoot(false));
>             throw new SVNException(err);
>         } else if (nodeKind == SVNNodeKind.FILE) {
>             SVNErrorMessage err =
> SVNErrorMessage.create(SVNErrorCode.UNKNOWN,
>                 "Entry at URL ''{0}'' is a file while directory was
> expected",
>                 repository.getRepositoryRoot(false));
>             throw new SVNException(err);
>         }
>
>         if (!wcFolder.exists()) {
>             // CHECKOUT
>             if (!wcFolder.exists()) {
>                 wcFolder.mkdirs();
>             }
>
>             SVNUpdateClient updateClient = clientManager.getUpdateClient();
>             updateClient.setIgnoreExternals(false);
>             updateClient.doCheckout(svnUrl, wcFolder, SVNRevision.HEAD,
>                 SVNRevision.HEAD, SVNDepth.INFINITY, true);
>         } else {
>             // CLEANUP
>             SVNWCClient wcClient = clientManager.getWCClient();
>             wcClient.setIgnoreExternals(false);
>             wcClient.doCleanup(wcFolder);
>
>             // UPDATE
>             SVNUpdateClient updateClient = clientManager.getUpdateClient();
>             updateClient.setIgnoreExternals(false);
>
>             updateClient.doUpdate(wcFolder, SVNRevision.HEAD, true);
>         }
>     }
>
> Thank you in advance
> Rodolphe
>

---------------------------------------------------------------------
To unsubscribe, e-mail: svnkit-users-unsubscribe@...
For additional commands, e-mail: svnkit-users-help@...


Re: svn: Cannot write to 'C:\working_copy\...\.svn\log (Accès refusé)

by rdeman :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

You were right; the issue was due to Tortoise SVN

Thank you for your answers.

Rodolphe