[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Unable to hotcopy to a NAS shared directory: E720002

From: Cory Riddell <cory_at_codeware.com>
Date: Wed, 21 Jan 2015 12:12:15 -0600

On 1/21/2015 11:44 AM, Cory Riddell wrote:
> On 1/21/2015 10:41 AM, Philip Martin wrote:
>> Cory Riddell <cory_at_codeware.com> writes:
>>
>>> On 1/20/2015 9:32 AM, Cory Riddell wrote:
>>>> I'm trying to use hotcopy to create a backup of my repositories on a
>>>> network drive. When I run the hotcopy command, most of the repository
>>>> copies, then I get an error:
>>>>
>>>> E:\>svnadmin hotcopy E:\MyRepo \\Diskstation\svn\MyRepo
>>>> svnadmin: E720002: Can't remove file
>>>> '\\diskstation\svn\MyRepo\db\rev-prop-atomics.shm': The system cannot
>>>> find the file specified.
>>> I've been looking at the source code for this and I think I see what'
>>> generating the error:
>>>
>>> In named_atomic.c, around line 515, is this code:
>>>
>>> svn_error_t *
>>> svn_atomic_namespace__cleanup(const char *name,
>>> apr_pool_t *pool)
>>> {
>>> const char *shm_name, *lock_name;
>>>
>>> /* file names used for the specified namespace */
>>> shm_name = apr_pstrcat(pool, name, SHM_NAME_SUFFIX, NULL);
>>> lock_name = apr_pstrcat(pool, name, MUTEX_NAME_SUFFIX, NULL);
>>>
>>> /* remove these files if they exist */
>>> SVN_ERR(svn_io_remove_file2(shm_name, TRUE, pool));
>>> SVN_ERR(svn_io_remove_file2(lock_name, TRUE, pool));
>>>
>>> return SVN_NO_ERROR;
>>> }
>>>
>>> In the line "SVN_ERR(svn_io_remove_file2(shm_name, TRUE, pool));", the
>>> TRUE parameter is supposed to suppress file not found errors yet that's
>>> the error I'm getting, isn't it?
>> Yes, it should. It's failing because it's getting error 720002 and that
>> is not an error the code recognises. I don't recognise it either. What
>> sort of network drive is producing that error?
>>
> 720002 is an APR error that should be caught with APR_STATUS_IS_ENOENT.
> This is defined in apr_errno.h as:
> Snippet
> #define APR_STATUS_IS_ENOENT(s) ((s) == APR_ENOENT \
> || (s) == APR_OS_START_SYSERR + ERROR_FILE_NOT_FOUND \
> || (s) == APR_OS_START_SYSERR + ERROR_PATH_NOT_FOUND \
> || (s) == APR_OS_START_SYSERR + ERROR_OPEN_FAILED \
> || (s) == APR_OS_START_SYSERR + ERROR_NO_MORE_FILES)
>
> and on my machine:
>
> APR_ENOENT = 2
> APR_OS_START_SYSERR = 720000
> ERROR_FILE_NOT_FOUND = 2
> ERROR_PATH_NOT_FOUND = 3
> ERROR_OPEN_FAILED = 110
> ERROR_NO_MORE_FILES = 18
>
> So 720002 is APR_OS_START_SYSERR + APR_ENOENT.

I think a small change to svn_io_remove_file2() (in io.c) would fix the
problem.

Right now, the code looks like:

svn_error_t *
svn_io_remove_file2(const char *path,
                    svn_boolean_t ignore_enoent,
                    apr_pool_t *scratch_pool)
{

[ LOTS OF STUFF REMOVED HERE ]

  if (apr_err)
    return svn_error_wrap_apr(apr_err, _("Can't remove file '%s'"),
                              svn_dirent_local_style(path, scratch_pool));

  return SVN_NO_ERROR;
}

I think the final if block should be:

if (!apr_err
    || (ignore_enoent
        && (APR_STATUS_IS_ENOENT(apr_err))
{
  return SVN_NO_ERROR;
}

return svn_error_wrap_apr(apr_err, _("Can't remove file '%s'"),
                              svn_dirent_local_style(path, scratch_pool));
Received on 2015-01-21 20:07:44 CET

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.