Windows Error Code 58
- Posts: 21
- Joined: 9 Sep 2011
I am getting this error code:
Error when monitoring directories.
Windows Error Code 58
I am trying to sync my PC and Laptop through middlepoint, that is my NAS.
However, when there is synchronization active on, let's say PC (PC<->NAS), and
Laptop is online and has active RealTimeSync, Laptop RealTimeSync throws error
described above. Laptop is monitoring Laptop<->NAS.
So, i think FreeFileSync has feature to prevent double sync by "sync.ffs_lock"
file, but RealTimeSync does not?
Polo
Error when monitoring directories.
Windows Error Code 58
I am trying to sync my PC and Laptop through middlepoint, that is my NAS.
However, when there is synchronization active on, let's say PC (PC<->NAS), and
Laptop is online and has active RealTimeSync, Laptop RealTimeSync throws error
described above. Laptop is monitoring Laptop<->NAS.
So, i think FreeFileSync has feature to prevent double sync by "sync.ffs_lock"
file, but RealTimeSync does not?
Polo
- Posts: 21
- Joined: 9 Sep 2011
Oh, and both, PC and Laptop are monitoring via RealTimeSync both: its Local
folder and NAS folder.
folder and NAS folder.
- Site Admin
- Posts: 7279
- Joined: 9 Dec 2007
The error code means:
ERROR_BAD_NET_RESP 58 (0x3A): The specified server cannot perform the
requested operation.
It seems the NAS has some trouble satisfying the request for directory
monitoring while it is busy (copying files)
ERROR_BAD_NET_RESP 58 (0x3A): The specified server cannot perform the
requested operation.
It seems the NAS has some trouble satisfying the request for directory
monitoring while it is busy (copying files)
- Posts: 21
- Joined: 9 Sep 2011
I can't believe my NAS is guilty for this. What setting could make such
problems?
I did some testing, please read details:
- I set 3 sets of test: NAS on my network, "simulated-NAS" on my local drive, "simulated-NAS" on notebook connected via network.
After these tests, I figured out, that it is(!) truly problem only with my
NAS, but strange behaviour appeared, please, read more.. :)
I set 2 .ffs_batch files: PC.ffs_batch, Laptop.ffs_batch. Both are launched on
same PC, for simplicity and both has set Size & date comparison, Automatic
mode of sync, No filters, DeletionPolicy to CustomDir.
PC settings:
- <Left>C:\Test\PCNAS</Left>
- <Right>\\MYBOOKWORLD\PoloShock\Zk\</Right>
Laptop settings:
- <Left>C:\Test\LaptopNAS</Left>
- <Right>\\MYBOOKWORLD\PoloShock\Zk\</Right>
Then I launched RTS for both.
Testing:
DELETE file on NAS:
- file deleted
--RTS -> FFS Laptop
- RTS -> FFS PC
- FFS Laptop starting scan & sync (FFS PC waiting, destination is locked)
- FFS Laptop finished, FFS PC scan & sync starting
- FFS PC finished -> RTS Laptop throws error 58
- clicked ok, RTS Laptop window with setting appeared -> clicked "START" button
- FFS Laptop starting scan & sync
- all done, without any other error
ADD file on NAS:
- RTS -> FFS Laptop
- RTS -> FFS PC
- FFS Laptop starting scan & sync (FFS PC waiting, destination is locked)
- FFS Laptop finished, FFS PC scan & sync starting
- FFS PC finished -> RTS Laptop throws error 58
(!new file from NAS is on both, Laptop and PC already copied properly!)
- click ok, RTS Laptop window with setting appear -> clicking "START" button
- FFS Laptop starting scan & sync
- FFS Laptop finished -> RTS PC throws error 58
- click ok, START
- FFS PC starting scan & sync
- FFS PC finished -> RTS Laptop throws error 58
(no, it is not loop)
- click ok, START
- FFS Laptop starting scan & sync
- all done, without any other error
LAPTOP or PC DELETE, ADD file
- FFS Laptop finished -> RTS PC ERROR 58
- FFS PC finished -> RTS Laptop ERROR 58
- FFS Laptop finished
- all done, without any other error
So I have three situations here.. One with 1 error, next with 2 and at last,
with 3 errors.
And for epilogue, during testing, occasionally it throwed (twice) this:
window title "An exception occurred!" and message "basic_string::resize"
clicked ok, nothing happend, no FFS execution.
What do you think?
Polo
problems?
I did some testing, please read details:
- I set 3 sets of test: NAS on my network, "simulated-NAS" on my local drive, "simulated-NAS" on notebook connected via network.
After these tests, I figured out, that it is(!) truly problem only with my
NAS, but strange behaviour appeared, please, read more.. :)
I set 2 .ffs_batch files: PC.ffs_batch, Laptop.ffs_batch. Both are launched on
same PC, for simplicity and both has set Size & date comparison, Automatic
mode of sync, No filters, DeletionPolicy to CustomDir.
PC settings:
- <Left>C:\Test\PCNAS</Left>
- <Right>\\MYBOOKWORLD\PoloShock\Zk\</Right>
Laptop settings:
- <Left>C:\Test\LaptopNAS</Left>
- <Right>\\MYBOOKWORLD\PoloShock\Zk\</Right>
Then I launched RTS for both.
Testing:
DELETE file on NAS:
- file deleted
--RTS -> FFS Laptop
- RTS -> FFS PC
- FFS Laptop starting scan & sync (FFS PC waiting, destination is locked)
- FFS Laptop finished, FFS PC scan & sync starting
- FFS PC finished -> RTS Laptop throws error 58
- clicked ok, RTS Laptop window with setting appeared -> clicked "START" button
- FFS Laptop starting scan & sync
- all done, without any other error
ADD file on NAS:
- RTS -> FFS Laptop
- RTS -> FFS PC
- FFS Laptop starting scan & sync (FFS PC waiting, destination is locked)
- FFS Laptop finished, FFS PC scan & sync starting
- FFS PC finished -> RTS Laptop throws error 58
(!new file from NAS is on both, Laptop and PC already copied properly!)
- click ok, RTS Laptop window with setting appear -> clicking "START" button
- FFS Laptop starting scan & sync
- FFS Laptop finished -> RTS PC throws error 58
- click ok, START
- FFS PC starting scan & sync
- FFS PC finished -> RTS Laptop throws error 58
(no, it is not loop)
- click ok, START
- FFS Laptop starting scan & sync
- all done, without any other error
LAPTOP or PC DELETE, ADD file
- FFS Laptop finished -> RTS PC ERROR 58
- FFS PC finished -> RTS Laptop ERROR 58
- FFS Laptop finished
- all done, without any other error
So I have three situations here.. One with 1 error, next with 2 and at last,
with 3 errors.
And for epilogue, during testing, occasionally it throwed (twice) this:
window title "An exception occurred!" and message "basic_string::resize"
clicked ok, nothing happend, no FFS execution.
What do you think?
Polo
- Site Admin
- Posts: 7279
- Joined: 9 Dec 2007
In the sourcecode there are three places where this error could be thrown. In
order to determine if there is something that can be done about this problem
in general, we first need to find the single origin. Let's try this again with
the following version which will give a more detailed error message:
[404, Invalid URL: http://ifile.it/fgytio0/FreeFileSync_v3.22.0_beta5_setup.exe]
The second problem "basic_string::resize": Did this happen for RealtimeSync or
FreeFileSync? Do you know some conditions that could trigger it? Which version
were you using? Still happening with v3.22 beta? In general I would consider
this a bug, since this dialog is the latest chance to report an error (just
before making the app crash) and should be handled way earlier.
order to determine if there is something that can be done about this problem
in general, we first need to find the single origin. Let's try this again with
the following version which will give a more detailed error message:
[404, Invalid URL: http://ifile.it/fgytio0/FreeFileSync_v3.22.0_beta5_setup.exe]
The second problem "basic_string::resize": Did this happen for RealtimeSync or
FreeFileSync? Do you know some conditions that could trigger it? Which version
were you using? Still happening with v3.22 beta? In general I would consider
this a bug, since this dialog is the latest chance to report an error (just
before making the app crash) and should be handled way earlier.
- Posts: 21
- Joined: 9 Sep 2011
I took "FreeFileSync_v3.22_beta6_setup.exe" from this topic viewtopic.php?t=885 and retested it:
Behavior is now quite same, except the number of errors throwed:
DELETE file(s) on NAS:
Error when monitoring directories. (GetOverlappedResult) - Win code 58
ADD file(s) on NAS:
Error when monitoring directories. (GetOverlappedResult) - Win code 58
LAPTOP or PC DELETE, ADD file(s):
Error when monitoring directories. (GetOverlappedResult) - Win code 58
Error when monitoring directories. (GetOverlappedResult) - Win code 58
OR
GetOverlappedResult
ReadDirectoryChangesW
OR
ReadDirectoryChangesW
GetOverlappedResult
OR
ReadDirectoryChangesW
ReadDirectoryChangesW
I can't reproduce these double-errors for deleting or adding on PC(Laptop) in
exact order, it throws it like random.
By end of my testing, I deleted one more directory with files.. and then, the
mysterios error "basic_string::resize" occured again! Window had title "An
exception occured! - FFS" and it was "FreeFileSync_Win32.exe" process. I have
no idea what could trigger it up. :/
Hope it somehow helped.
Behavior is now quite same, except the number of errors throwed:
DELETE file(s) on NAS:
Error when monitoring directories. (GetOverlappedResult) - Win code 58
ADD file(s) on NAS:
Error when monitoring directories. (GetOverlappedResult) - Win code 58
LAPTOP or PC DELETE, ADD file(s):
Error when monitoring directories. (GetOverlappedResult) - Win code 58
Error when monitoring directories. (GetOverlappedResult) - Win code 58
OR
GetOverlappedResult
ReadDirectoryChangesW
OR
ReadDirectoryChangesW
GetOverlappedResult
OR
ReadDirectoryChangesW
ReadDirectoryChangesW
I can't reproduce these double-errors for deleting or adding on PC(Laptop) in
exact order, it throws it like random.
By end of my testing, I deleted one more directory with files.. and then, the
mysterios error "basic_string::resize" occured again! Window had title "An
exception occured! - FFS" and it was "FreeFileSync_Win32.exe" process. I have
no idea what could trigger it up. :/
Hope it somehow helped.
- Posts: 21
- Joined: 9 Sep 2011
> Which version were you using?
Before FFS v3.22_beta6 I was using v3.21.
> By end of my testing, I deleted one more directory with files
It was at PC's location, not NAS.
Before FFS v3.22_beta6 I was using v3.21.
> By end of my testing, I deleted one more directory with files
It was at PC's location, not NAS.
- Site Admin
- Posts: 7279
- Joined: 9 Dec 2007
I'm still not sure what caused the ERROR_BAD_NET_RESP, but it happens for both
the important API calls ReadDirectoryChangesW and GetOverlappedResult.
The only useful information I found was
http://leontheprogrammer.blogspot.com/2010/04/readdirectorychangesw-returns.html. It suggests some samba issue (samba is
usually by NAS devices internally) and suggests to ignore the error and retry.
But the first comment mentioned that this may be only pampering over a
failure. From the softwares perspective I don't see anything that could be
improved.
> the mysterios error "basic_string::resize"
This happens when a string is resized to such a large size that the operating
system cannot satisfy the request for memory allocation. This is either due to
not enough memory available on your system or some application bug, erronously
trying to allocate some insanely large size.
I created a new version for you. In case this error happens again it will
create a file called "exception.dmp". Please send me this file so that I can
analyze and hopefully find the source of the problem:
[404, Invalid URL: http://ifile.it/h5mld0z/FreeFileSync_v3.220_beta7.rar]
the important API calls ReadDirectoryChangesW and GetOverlappedResult.
The only useful information I found was
http://leontheprogrammer.blogspot.com/2010/04/readdirectorychangesw-returns.html. It suggests some samba issue (samba is
usually by NAS devices internally) and suggests to ignore the error and retry.
But the first comment mentioned that this may be only pampering over a
failure. From the softwares perspective I don't see anything that could be
improved.
> the mysterios error "basic_string::resize"
This happens when a string is resized to such a large size that the operating
system cannot satisfy the request for memory allocation. This is either due to
not enough memory available on your system or some application bug, erronously
trying to allocate some insanely large size.
I created a new version for you. In case this error happens again it will
create a file called "exception.dmp". Please send me this file so that I can
analyze and hopefully find the source of the problem:
[404, Invalid URL: http://ifile.it/h5mld0z/FreeFileSync_v3.220_beta7.rar]
- Site Admin
- Posts: 7279
- Joined: 9 Dec 2007
(Reference for myself: [404, Invalid URL: http://ifile.it/3bwo45g/FFS%20Source%20resize%20bug.rar]
- Posts: 21
- Joined: 9 Sep 2011
Problem with Windows Error Code 58 Solved!
It was really Samba-related. I updated Samba from 3.0.2.5 to 3.5.11, and it
works ok now.
If I will face "basic_string::resize" error again, I will send "exception.dmp"
to you.
Thank you for tip about Samba :)
It was really Samba-related. I updated Samba from 3.0.2.5 to 3.5.11, and it
works ok now.
If I will face "basic_string::resize" error again, I will send "exception.dmp"
to you.
Thank you for tip about Samba :)
- Posts: 1
- Joined: 15 Jun 2010
I get the same problem
try to sync my PC and Laptop with the Nas in the middle and getting the Error
code 58, off course only if both machines are working.
FreeFileSync 4.4
great app btw, looked a long time for a tool like that, thanks
try to sync my PC and Laptop with the Nas in the middle and getting the Error
code 58, off course only if both machines are working.
FreeFileSync 4.4
great app btw, looked a long time for a tool like that, thanks
- Posts: 16
- Joined: 23 Mar 2012
I have just installed FreeFileSync 5.0 on a Windows 7 platform. It is
configured to perform a nightly mirror of data from a Synology NAS to an
external USB drive, using a batch file with RealtimeSync. In the morning,
there is a Windows Error Code 58 on the desktop. If I click "Start" on the
RealtimeSync dialog, it will run without another error. I am hoping the author
will reply to this post. Thanks!
configured to perform a nightly mirror of data from a Synology NAS to an
external USB drive, using a batch file with RealtimeSync. In the morning,
there is a Windows Error Code 58 on the desktop. If I click "Start" on the
RealtimeSync dialog, it will run without another error. I am hoping the author
will reply to this post. Thanks!
- Site Admin
- Posts: 7279
- Joined: 9 Dec 2007
The current error handling of RealtimeSync is problematic. Generally the tool
doesn't write a log file, so it needs another way to communicate errors. But
showing a modal dialog is fatal when running it unsupervised. One solution
could be to show the error dialog, but automatically retry, after say 10
seconds. If the error is recoverable (or temporal in nature), RTS would not
block. I'll take this as a requirement.
doesn't write a log file, so it needs another way to communicate errors. But
showing a modal dialog is fatal when running it unsupervised. One solution
could be to show the error dialog, but automatically retry, after say 10
seconds. If the error is recoverable (or temporal in nature), RTS would not
block. I'll take this as a requirement.
- Site Admin
- Posts: 7279
- Joined: 9 Dec 2007
> It is configured to perform a nightly mirror of data from a Synology NAS to
an external USB drive
Do you really need RTS for this job? RTS is generally used if different data
sources need to be in sync all the time, while recurring syncs should be
handled by taskschd.msc.
an external USB drive
Do you really need RTS for this job? RTS is generally used if different data
sources need to be in sync all the time, while recurring syncs should be
handled by taskschd.msc.
- Posts: 16
- Joined: 23 Mar 2012
Thank you for replying. I think you are correct that I don't need to use RTS
for this function. I used it because it executes the batch file, but I could
simply have taskschd.msc execute that batch file instead. I will try this and
post again.
for this function. I used it because it executes the batch file, but I could
simply have taskschd.msc execute that batch file instead. I will try this and
post again.
- Posts: 16
- Joined: 23 Mar 2012
Using Taskschd.msc works fine. No errors, and the profile ran as intended.
Thanks for your suggestion!
Thanks for your suggestion!
- Posts: 16
- Joined: 23 Mar 2012
Everything worked fine until I upgraded to FreefileSync 5.2. After that, I get
error 33 (the process cannot access the file because another process has
locked a portion of the file). If I click "Retry", it works. I am going to
roll back to version 5.0 and see if this error continues.
error 33 (the process cannot access the file because another process has
locked a portion of the file). If I click "Retry", it works. I am going to
roll back to version 5.0 and see if this error continues.
- Posts: 16
- Joined: 23 Mar 2012
Different errors appear under different versions. There is reference to a
locked pst file, but the file is not locked by another application. A
screenshot of the errors under versions 5.0 and 5.2 ispublished here: [404, Invalid URL: http://mauitradewinds.com//FreeFileSync.jpg]
locked pst file, but the file is not locked by another application. A
screenshot of the errors under versions 5.0 and 5.2 ispublished here: [404, Invalid URL: http://mauitradewinds.com//FreeFileSync.jpg]
- Site Admin
- Posts: 7279
- Joined: 9 Dec 2007
The problem is the file is locked by some outlook-related process. In the v5.0
screenshot you have enabled copying via VSS in globalsettings, but it fails to
init (VSS not supported by Y:\?) , in v5.2 copy via VSS is disabled in
settings.
screenshot you have enabled copying via VSS in globalsettings, but it fails to
init (VSS not supported by Y:\?) , in v5.2 copy via VSS is disabled in
settings.
- Posts: 16
- Joined: 23 Mar 2012
VSS is not supported, because Y: is a shared folder on a NAS. But I suspect
that the Outlook-related process which is locking the pst file is somehow
associated with FreeFileSync. The batch file is executed at a time when the
computer has been idle for at least eight hours, and Outlook is not open. So I
don't think there is a process other than FFS which is accessing the pst
files.
that the Outlook-related process which is locking the pst file is somehow
associated with FreeFileSync. The batch file is executed at a time when the
computer has been idle for at least eight hours, and Outlook is not open. So I
don't think there is a process other than FFS which is accessing the pst
files.
- Site Admin
- Posts: 7279
- Joined: 9 Dec 2007
FFS isn't holding a lock on any of the files it is traversing except for the
short time of file copy. You can try to use a tool like "unlocker" or "lock
hunter" to find out which process is responsible for the lock.
short time of file copy. You can try to use a tool like "unlocker" or "lock
hunter" to find out which process is responsible for the lock.
- Posts: 16
- Joined: 23 Mar 2012
Thank you for the suggestion. I installed LockHunter. Right now, no process is
locking those files. The FreeFileSync batch always seems to run without errors
if I trigger it manually. The errors consistently occur at 5 AM local time
when the batch file runs on schedule, and I'm not at my desk to run
LockHunter.
locking those files. The FreeFileSync batch always seems to run without errors
if I trigger it manually. The errors consistently occur at 5 AM local time
when the batch file runs on schedule, and I'm not at my desk to run
LockHunter.
- Posts: 16
- Joined: 23 Mar 2012
Is there a way to have FreeFileSync "retry" once, automatically, if there is
one of these errors?
one of these errors?
- Site Admin
- Posts: 7279
- Joined: 9 Dec 2007
I sometimes find that Lockhunter et. al. don't reliably find the holder of a
lock. In these cases I manually go into Process Explorer and kill the process
that looks like it may be responsible, usually with success.
> FreeFileSync "retry"
FFS doesn't have this option. However in your case it probably wouldn't help
much. If the lock is still held after the PC had been idle for hours, the
situation won't look different after a retry.
So as a practical advice, since you know the file may be locked and you can't
copy it via VSS, I would exclude it from synchronization via a filter.
lock. In these cases I manually go into Process Explorer and kill the process
that looks like it may be responsible, usually with success.
> FreeFileSync "retry"
FFS doesn't have this option. However in your case it probably wouldn't help
much. If the lock is still held after the PC had been idle for hours, the
situation won't look different after a retry.
So as a practical advice, since you know the file may be locked and you can't
copy it via VSS, I would exclude it from synchronization via a filter.
- Posts: 16
- Joined: 23 Mar 2012
Thank you for your comments. In Task Manager, I don't see a process which
appears to be locking this Outlook pst file. Clicking "retry" manually has
always succeeded. The file in question is one which I need to copy. I'll try
scheduling it at a different time. If that fails, I'll try automating the
"retry" with "Clickoff".
appears to be locking this Outlook pst file. Clicking "retry" manually has
always succeeded. The file in question is one which I need to copy. I'll try
scheduling it at a different time. If that fails, I'll try automating the
"retry" with "Clickoff".
- Site Admin
- Posts: 7279
- Joined: 9 Dec 2007
> I don't see a process which appears to be locking this Outlook pst file
There is one last thing you could try: If it is a local process that is
locking the file, it can be traced by Process Monitor
(http://technet.microsoft.com/de-de/sysinternals/bb896645). If you filter the log for the "pst" file you
should find a process that opens the file at some time. If this process is
FreeFileSync and it's not the failed access during file copy, then this may be
something that needs to be addressed.
There is one last thing you could try: If it is a local process that is
locking the file, it can be traced by Process Monitor
(http://technet.microsoft.com/de-de/sysinternals/bb896645). If you filter the log for the "pst" file you
should find a process that opens the file at some time. If this process is
FreeFileSync and it's not the failed access during file copy, then this may be
something that needs to be addressed.
- Posts: 16
- Joined: 23 Mar 2012
Thank you. I tried Process Monitor, but I am inexperienced at using it. I
created a filter to exclude every process unless the path or architecture
includes .pst. Nothing showed up, even while I used Windows Explorer to make a
copy of a pst file.
created a filter to exclude every process unless the path or architecture
includes .pst. Nothing showed up, even while I used Windows Explorer to make a
copy of a pst file.
- Posts: 16
- Joined: 23 Mar 2012
My mistake. Once I learned how to create the filter properly, the log shows
activity for .pst files. Unless Outlook.exe is open, or FreeFileSync is in the
process of copying pst files, there is no other activity associated with those
files. I'm now running the batch file hourly, to see when the Error 33 occurs.
activity for .pst files. Unless Outlook.exe is open, or FreeFileSync is in the
process of copying pst files, there is no other activity associated with those
files. I'm now running the batch file hourly, to see when the Error 33 occurs.
- Posts: 16
- Joined: 23 Mar 2012
Error 33 appears to be caused by Outlook Instant Search, when it is indexing a
pst file. Although Outlook.exe is closed, the indexing service locks the pst
file while it is being indexed. At that time, there is a temporary file
visible in the Outlook folder, such as ~Outlook.pst.temp. Usually that
temporary file vanishes within a few minutes. To work around the error
interrupting the FreeFileSync batch operation, I configured Clickoff to push
the "Retry" button after a five-minute delay. While this causes FreeFileSync
to resume the batch operation, it does not copy the pst file which was locked
at the time of the original error. Moreover, the FreeFileSync log reports that
the operation completed successfully, and erroneously lists the missing file
as one of the items which was copied.
pst file. Although Outlook.exe is closed, the indexing service locks the pst
file while it is being indexed. At that time, there is a temporary file
visible in the Outlook folder, such as ~Outlook.pst.temp. Usually that
temporary file vanishes within a few minutes. To work around the error
interrupting the FreeFileSync batch operation, I configured Clickoff to push
the "Retry" button after a five-minute delay. While this causes FreeFileSync
to resume the batch operation, it does not copy the pst file which was locked
at the time of the original error. Moreover, the FreeFileSync log reports that
the operation completed successfully, and erroneously lists the missing file
as one of the items which was copied.
- Posts: 16
- Joined: 23 Mar 2012
Changing Global Settings to use Transacational File Copy appears to have
resolved the copy failure mentioned in the post above. The process may require
one or two automated "retry" operations, but it is eventually successful.
resolved the copy failure mentioned in the post above. The process may require
one or two automated "retry" operations, but it is eventually successful.