Could Not Save Page: [Error 2] The system cannot find the file specified.

Reported by T Hill on 2011-07-02
24
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Zim
High
Unassigned

Bug Description

Happens often, requires I delete .bak~ file to continue, but usually happens again if I don't move on to some other page for awhile. It's very intermittent. Usually, I will resort to editing the text file in the Zim folder so that I don't have to keep closing and opening Zim every time the error occurs.

Using Zim 0.50 on Windows 7 64-bit.

Without a way to reproduce it this will be very hard to fix. Do you have a
scenario that triggers the issue ?

I work with zim daily on a windows system and never experience such
problems, so may well due to something special in your setup.

T Hill (hilltj) wrote :

Yeah, unfortunately, it is unpredictable. AFAIK, there is nothing weird about my system setup. I do have my Zim files backup to Dropbox when my computer starts up, but I close Dropbox after it syncs. So it's not running while I'm using Zim.

One thing I have noticed... I THINK that it only happens when I am editing a page somewhere other than the bottom of it. As in, I am adding text at a point before the end of the document. I'm not sure if that could have anything to do with it.

But then again, I am editing all over the place often, and sometimes I will go 20 minutes without the error.

T Hill (hilltj) wrote :

Oh, also, I mentioned the .bak~ files that are created. They have the same name as the page that I'm working on when the error occurs. I think each time the error occurs, it creates another .bak~ that stays there until I delete it... so sometimes there are multiple.

Flagged as incomplete as I can not reproduce it (and thus not debug it) please set back to "new" if you have more info on this.

Changed in zim:
status: New → Incomplete
Launchpad Janitor (janitor) wrote :

[Expired for Zim because there has been no activity for 60 days.]

Changed in zim:
status: Incomplete → Expired
Darin Nelson (darin-nelson) wrote :

I encounter this issue frequently but intermittently. At some times, it occurs with very high frequency (up to once a word), and in others only once or twice an hour. The configuration is Zim 0.56, on Windows 7.

Like the original poster, I suspected my use of syncing software to be involved (Dropbox or SpiderOak), but a folder which was created completely outside the areas being monitored by the sync software still shows the issue, even with the sync software off. I don't have any virus checking software running.

Like the original poster, the error seems associated with occurences of recovery attempts in WindowsFile.open() that end up creating *.baki%~ files, but I don't _always_ get the .bak~ file, and I think that I sometimes get the .bak~ file without the error.

I can continue after the error message by just saving back to the original filename, without deleting the bak~ files as the original poster describes.

I don't think this adds any telling information, unfortunately. Is there a way to capture a log or other diagnostic information to post?

I'm having the same problem as Darin. (Zim 0.56 on W7 32bit). My set up uses a NAS for notebook files, does that make a difference? This problem, which makes ZIM almost unuseable, happens more frequently on one PC than another.

If I close the window warning about can't find the file and then reload (ctrl+r) the page I can trigger a 'you've found a bug' window saying:

This is zim 0.56
Python version is sys.version_info(major=2, minor=7, micro=2, releaselevel='final', serial=0)
Gtk version is (2, 24, 10)
Pygtk version is (2, 24, 0)
Platform is nt
Zim revision is:
  branch: trunk
  revision: 534 <email address hidden>
  date: 2012-04-03 00:07:40 -0400

======= Traceback =======
  File "zim\gui\__init__.pyo", line 826, in _action_handler
  File "zim\gui\__init__.pyo", line 1732, in reload_page
AssertionError: Could not save page

****
Does this add anything helpful to the mystery?

On Fri, Oct 19, 2012 at 2:54 PM, Darryl Collins
<email address hidden> wrote:
> Does this add anything helpful to the mystery?

Not really I'm afraid. Yes the NAS can make a lot of difference, as
it seems related to timing of the underlying filesystem.

I only run zim on a local harddrive under windows myself and never
experience this issue.

Regards,

Jaap

Darin Nelson (darin-nelson) wrote :

By inspection, I tried to find race conditions before my previous post, but nothing jumped out at me.

 Jaap, if you are able to suggest places to put debug traces that might shed light on the problem (perhaps showing that A comes before B, when it shouldn't?), I can try to build a version that incorporates them and see what happens.

-d.

Darin,

I would look at zim/fs.py and than class WindowsFile, methods _on_write and _recover should be first point of attention. Just dump all state there. If we can reconstruct the state of the .new and .bak files when this happens it might become a bit clearer.

Also you might want to put some output on start and end of write_async and writelines_async in the UnixFile class. Although the lock should prevent two async operations happen at the same time, it is worth checking.

Btw. missing detailed error log of what error happens in fs.py. Probably goes to error log in %TMP%/zim.log . If not you might want to check the code that generates the exception and have it print the original exception.

Regards,

Jaap

Changed in zim:
status: Expired → New
Darin Nelson (darin-nelson) wrote :

I haven't forgotten this, but I upgraded to Zim 0.57 before I started to work (portable edition, as it happens), and... the problem went away. I'll keep an eye open for any recurrence.

Darin Nelson (darin-nelson) wrote :

...*sigh*, but naturally almost as soon as I posted the above, the error recurred (during a period of heavy I/O load) so don't close this yet. Sorry.

Put it to confirmed, as there are multiple reports. However as of yet I have no idea how to reproduce or fix :(

Changed in zim:
status: New → Confirmed
importance: Undecided → High
tags: added: filesystem win32
K. Bauer (k.bauer) wrote :

Problem still exists as of zim 0.58.

Platform: Windows 7, Enthough Python Distribution (Python 2.7)
Running from source (but also occurred with precompiled version).

The log file says (including stuff before and after the error occurred):

-------------------------------------------------------------------------------
DEBUG: Dir change detected: (<FilteredDir: E:\zim-notebooks\Notes\Misc\UniqueIdentifiers>, None, None)
DEBUG: Missing icons in icon theme: ['gtk-file']
DEBUG: Missing icons in icon theme: ['gtk-file']
DEBUG: Missing icons in icon theme: ['gtk-file']
DEBUG: Missing icons in icon theme: ['gtk-file']
DEBUG: Saving page (async): <FileStorePage: Misc:UniqueIdentifiers>
DEBUG: Wrote E:\zim-notebooks\Notes\Misc\UniqueIdentifiers.txt
WARNING: Left over file found: E:\zim-notebooks\Notes\Misc\UniqueIdentifiers.txt.zim-orig~
Backed up to: E:\zim-notebooks\Notes\Misc\UniqueIdentifiers.txt.bak~
DEBUG: Saving page (async): <FileStorePage: Misc:UniqueIdentifiers>
DEBUG: Wrote E:\zim-notebooks\Notes\Misc\UniqueIdentifiers.txt
DEBUG: Saving page (async): <FileStorePage: Misc:UniqueIdentifiers>
DEBUG: Wrote E:\zim-notebooks\Notes\Misc\UniqueIdentifiers.txt
DEBUG: Saving page (async): <FileStorePage: Misc:UniqueIdentifiers>
WARNING: Left over file found: E:\zim-notebooks\Notes\Misc\UniqueIdentifiers.txt.zim-orig~
Backed up to: E:\zim-notebooks\Notes\Misc\UniqueIdentifiers.txt.bak~
ERROR: Failed to save page: Misc:UniqueIdentifiers
Traceback (most recent call last):
  File "E:\portable\zim-0.58\zim\async.py", line 106, in wrapper
    self.result = function(*args, **kwargs)
  File "E:\portable\zim-0.58\zim\stores\files.py", line 334, in _store_lines
    self.source.writelines(lines)
  File "E:\portable\zim-0.58\zim\fs.py", line 1611, in writelines
    self._writelines(lines)
  File "E:\portable\zim-0.58\zim\fs.py", line 1646, in _writelines
    file.close()
  File "E:\portable\zim-0.58\zim\fs.py", line 1927, in close
    self.on_close()
  File "E:\portable\zim-0.58\zim\fs.py", line 1824, in _on_write
    self._rename(tmp, self.encodedpath) # Step 3.
  File "E:\portable\zim-0.58\zim\fs.py", line 1841, in _rename
    os.rename(src, dst)
WindowsError: [Error 2] Das System kann die angegebene Datei nicht finden
DEBUG: Running SavePageErrorDialog
ERROR: [Error 2] Das System kann die angegebene Datei nicht finden
DEBUG: Action: reload_page
INFO: Open page: <FileStorePage: Misc:UniqueIdentifiers> (<FileStorePage: Misc:UniqueIdentifiers>)
DEBUG: Wrote E:\zim-notebooks\Notes\.zim\state.conf
DEBUG: Saving page (async): <FileStorePage: Misc:UniqueIdentifiers>
DEBUG: Wrote E:\zim-notebooks\Notes\Misc\UniqueIdentifiers.txt
DEBUG: Saving page (async): <FileStorePage: Misc:UniqueIdentifiers>
-------------------------------------------------------------------------------

User interaction involved:
  * Editing text, until the error message "Couldn't save ..." popped up.
  * Clicked away the error-window.
  * Pressed Ctrl-R to reload page, as this seems to fix the problem.

Gyuri Szing (gyuri-szing) wrote :

I am facing the same problem with 0.59. I started Sysinternals process monitor to see whats going on in the background.

I started ZIM. When the problem appeared, I pressed cancel on the error window. Then started the monitoring app and set up a filter to the file i was editing. Then i pressed file/save in zim. The error window popped up and I pressed cancel again.

I attach the log of the monitoring too. You can download the tool here: http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx

Also when I tried to reload the page (CTRL+R) I got the following assertion:

This is zim 0.59
Python version is sys.version_info(major=2, minor=7, micro=3, releaselevel='final', serial=0)
Gtk version is (2, 24, 10)
Pygtk version is (2, 24, 0)
Platform is nt
Zim revision is:
  branch: pyzim
  revision: 636 <email address hidden>
  date: 2013-01-23 22:07:40 +0100

======= Traceback =======
  File "zim\gui\__init__.pyo", line 799, in _action_handler
  File "zim\gui\__init__.pyo", line 1734, in reload_page
AssertionError: Could not save page

I hope this helps.

Thanks, I will have a look at it.

On Fri, Feb 1, 2013 at 12:21 PM, Gyuri Szing <email address hidden> wrote:
> I am facing the same problem with 0.59. I started Sysinternals process
> monitor to see whats going on in the background.
>
> I started ZIM. When the problem appeared, I pressed cancel on the error
> window. Then started the monitoring app and set up a filter to the file
> i was editing. Then i pressed file/save in zim. The error window popped
> up and I pressed cancel again.
>
> I attach the log of the monitoring too. You can download the tool here:
> http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx
>
> Also when I tried to reload the page (CTRL+R) I got the following
> assertion:
>
> This is zim 0.59
> Python version is sys.version_info(major=2, minor=7, micro=3, releaselevel='final', serial=0)
> Gtk version is (2, 24, 10)
> Pygtk version is (2, 24, 0)
> Platform is nt
> Zim revision is:
> branch: pyzim
> revision: 636 <email address hidden>
> date: 2013-01-23 22:07:40 +0100
>
> ======= Traceback =======
> File "zim\gui\__init__.pyo", line 799, in _action_handler
> File "zim\gui\__init__.pyo", line 1734, in reload_page
> AssertionError: Could not save page
>
> I hope this helps.
>
> ** Attachment added: "ProcessMonitor logfile"
> https://bugs.launchpad.net/zim/+bug/804936/+attachment/3510177/+files/Logfile.PML
>
> --
> You received this bug notification because you are subscribed to Zim.
> https://bugs.launchpad.net/bugs/804936
>
> Title:
> Could Not Save Page: [Error 2] The system cannot find the file
> specified.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/zim/+bug/804936/+subscriptions

Leopooh (fuzzy2) wrote :

Have the same problem as described in original bug description.
I am using Zim 0.59 on Windows 7 64-bit.
I have used Zim for more then week on this PC - about 100 pages, active adding/editing - no problems were detected. But today I have faced with this problem - on one page I am getting these error messages 2-3 times per minute during last 15 minutes (all my editing attempts are blocked :( ).
Will try to go to another pages and hope thet problem will disappear...

I have no idea how to reproduce this problem. Zim database is located inside TrueCrypt container file on SSD drive.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers