Zim

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

Bug #804936 reported by T Hill on 2011-07-02
30
This bug affects 5 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.

l1zard (propstmatthias-6) wrote :

I found a Workaround that is wokring at leastfor me. If you have a look at the file preferences.conf in

%AppData%\Roaming\zim\config\zim

setting the variable autosave_timeout=600

helpde. The problem seems to be rather with the design and implementation in Windows than with zim itself. As far as i have investigated it seems to have something to do with Windows write Caching mechanism but i am not quiete sure.

As i don't need autosave every 10 seconds this workaround is working for me.

Mike R (keyrick9) wrote :

I would like to use the 2014-07-18 (lizard) workaround, but I don't have an AppData folder on my Windows 7 disk. That is, I don't have the folder named by %APPDATA% system variable -- which indicates \Users\Mike\AppData\Roaming. The manual says there's supposed to be an XDG-something variable, but that one isn't here either (which is under Config Files in the Help system). The manual says not to try to find or alter preferences.conf when Zim is running, but rather after Zim closes down, since it writes the file at that time.

This might be an installation issue, namely, to create that AppData folder if non-existent. It also might be a deficiency in the preferences dialog, which does not seem to have the autosave_timeout parameter. I can manually create the folder and assume that will resolve this, so I just wanted to add this comment as a little bit of new info.

Of course, this does not get to the root of the problem, but just to the workaround. Some Windows problem as suggested above might be the root cause.

Mike R (keyrick9) wrote :

update: the AppData folder was hidden, so I edited the preferences manually using Cygwin bash shell. It's unclear why or by whom the AppData folder became hidden -- is not that way on my other windows boxes. Anyway, the workaround is good so far, and I withdraw the comments on potential installation problem. Sorry about the false alarm.

Negirno (negirno) wrote :
Download full text (8.4 KiB)

Hello.

I have similar issues. Don't know if it's the same error, but I post nonetheless.

For me, Zim (version 0.62 on Win7SP2) gives an error dialog with three options: Cancel, discard changes or save to seperate files. If I cancel, the error dialog appears again with the next save attempt.

Note: the error dialog says that the file in question is changed outside Zim. However, I've never had that file tampered by programs. The occurrence of the error is sometimes sporadical, sometimes occurs with every two or three saves. The dialog is also annoying because I have to wait a couple of seconds to be able to push any buttons on it.

Here is the zim_daemon.log contents after a session with this error:

INFO: Server starting 3840 at \\.\pipe\zim-Szab-server
DEBUG: Wrote <WindowsFile: D:\doksik\szab\JapaneseLearning\.zim\tmp>
INFO: Remove file: <WindowsFile: D:\doksik\szab\JapaneseLearning\.zim\tmp>
DEBUG: Loading config from: <WindowsFile: D:\doksik\szab\JapaneseLearning\notebook.zim>
DEBUG: Cache dir: <Dir: D:\doksik\szab\JapaneseLearning\.zim>
DEBUG: Index database file: <WindowsFile: D:\doksik\szab\JapaneseLearning\.zim\index.db>
DEBUG: Opening notebook: <zim.notebook.Notebook object at 0x01F14C90>
DEBUG: Loading config from: <ConfigFile: C:\Users\Szab\AppData\Roaming\zim\config\zim\preferences.conf>
DEBUG: Loading plugin: calendar
DEBUG: Loading plugin: insertsymbol
DEBUG: Loading plugin: linesorter
DEBUG: Loading plugin: printtobrowser
DEBUG: Loading plugin: tableofcontents
DEBUG: Loading plugin: tags
DEBUG: Loading plugin: tasklist
DEBUG: Gtk version is (2, 24, 10)
DEBUG: Pygtk version is (2, 24, 0)
DEBUG: Loading config from: <ConfigFile: C:\Users\Szab\AppData\Roaming\zim\config\zim\style.conf>
DEBUG: Loading config from: <WindowsFile: D:\doksik\szab\JapaneseLearning\.zim\state.conf>
INFO: Starting async index update
DEBUG: Child process started 5732 for <RemoteObject: zim.gui.GtkInterface(file:///D:/doksik/szab/JapaneseLearning)>
DEBUG: Accelmap: C:\Users\Szab\AppData\Roaming\zim\config\zim\accelmap
INFO: Accelerator changed for <Actions>/MainWindowExtensionDialog/go_page_today
INFO: Accelerator changed for <Actions>/MainWindowExtension/print_to_browser
DEBUG: Action: set_pathbar_path
DEBUG: Action: set_toolbar_icons_only
DEBUG: Wrote <WindowsFile: C:\Users\Szab\AppData\Roaming\zim\config\zim\preferences.conf>
DEBUG: Wrote <WindowsFile: C:\Users\Szab\AppData\Roaming\zim\config\zim\preferences.conf>
DEBUG: Action: set_toolbar_icons_small
DEBUG: Wrote <WindowsFile: C:\Users\Szab\AppData\Roaming\zim\config\zim\preferences.conf>
DEBUG: Wrote <WindowsFile: C:\Users\Szab\AppData\Roaming\zim\config\zim\preferences.conf>
INFO: Open page: <FileStorePage: kanjitanulas:2015:kanji-1502-A> (<HistoryPath: kanjitanulas:2015:kanji-1502-A>)
INFO: Accelerator changed for <Actions>/MainWindowExtension/sort_selected_lines
INFO: Accelerator changed for <Actions>/MainWindowExtensionDialog/show_calendar
INFO: Accelerator changed for <Actions>/MainWindowExtension/show_task_list
INFO: Accelerator changed for <Actions>/MainWindowExtension/insert_symbol
INFO: Index update done
WARNING: Left over file found: D:\doksik\szab\JapaneseLearning\kanjitanulas\2015\kanji-...

Read more...

3ruce (3ruce) wrote :

I've experienced something similar, Zim 0.62 on Xubuntu 12.04... my current working hypothesis is that the 'could not save' errors emerged when I was working on a note and then ran an rsync process that included the note I was working on. This created the error when the note was in an unsaved state...

Not running the rsync process when I've got unsaved notes seems to sort this... so far so good but I'm going to keep an eye on this...

djib (z-me-p) wrote :

I'm having the same issue with a portable edition of Zim 0.62 on Windows 7 (32 bits).

It is indeed quite random. I usually don't run into the error when editing files in quick succession, but when typing in the same file for more than ten minutes, I usually keep on running in that error untill I leave the note and come back to it again.

djib (z-me-p) wrote :

Hello.

Is this bug getting some attention? I would gladly give away some of my time to provide further information if you let me know what you need. I would also gladly make a small contribution (20$?) if that can help in any way.

Thanks.

Hi Z-me-P,

Yes and no. No: don't see this behavior at all on my own windows 7 install
- so can't chase this bug down. The workaround to change the autosave timer
seems a reasonable containment.

Yes, at some point the auto-save logic will change and I will make the
timing more flexible and more fault tolerant.

Regards,

Jaap

On Tue, Feb 24, 2015 at 12:05 PM, Z-me-p <email address hidden> wrote:

> Hello.
>
> Is this bug getting some attention? I would gladly give away some of my
> time to provide further information if you let me know what you need. I
> would also gladly make a small contribution (20$?) if that can help in
> any way.
>
> Thanks.
>
> --
> 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
>

tags: added: autosave pageview
removed: filesystem
djib (z-me-p) wrote :

Great. Thanks for the reply.

There are two things I would love to see in the meantime:
* No more timeout on the error window (currently there is a 5s timeout)
* Opening the file browser in directory in on the file being editing when selecting "save a copy" from the dialog box

djib (z-me-p) wrote :

Hello.

Just something that might be of interest for people having this issue.

I am running a corporate computer without admin rights (hence the need for a portable app). I used to have my apps on a SD card. I moved them to the computer's hard drive recently and the issue reported here just stopped.

I am not sure why, but moving the app to the internal drive might be something to consider for those of you who have that issue.

Hiisukun (hiisukun) wrote :

G'day,
I'm not sure if I should post exactly in this thread - but I couldn't find a different "failed saving in windows" bug thread and from reading, this sounded quite close. My partner used Zim recently on my recommendation. (I run linux and have had no trouble.)

She is running Zim 0.63 on Windows 7, from an SSD in a laptop. She had numerous errors intermittently popping up while making notes of a meeting. A picture of the error is attached, but the text is:
    Could not save page: Home:Meeting 2
    File changed on Disk: C:\Users\Mei\Notebooks\SA TESOL Conference\Home\Meeting_2.txt
    To continue you can [blablabla] ...
    Cancel / Discard Changes / Save Copy

Some other things that might help:
 * The notebook isn't in a Dropbox folder, but dropbox is running on her system
 * She hits Ctrl+S quite regularly (a habit from writing a lot in Word/etc.)
 * The error didn't occur during the first ~30 minutes of note taking
 * Once the error did occur, it would keep popping up until she closed/re-opened Zim
 * After restarting, she had around 5 minutes of clear use before it would pop up again

If it is something to do with caching / SSDs / Windows / otherwise, I'm not sure how much I can help.
If you want me to collect any logs that might be present on her laptop - I can give that a go.

Cheers.

3ruce (3ruce) wrote :

I'm on linux and I found that if any other app touched/edited a zim note .txt. file, I'd get this problem. In my case it was running an rsync over the zim notebook directory which was easily solved... I don't know about WIndows though...

greg4b (rapide-aston-martin) wrote :

I'm facing the same error message :-( very frequently.

My setup is:
* ZimDesktopWikiPortable.exe --standalone (to avoid other error on startup)
* Win7 X64
* McAffee Virus Scanner running - not able to pause...
* Files located on local hdd
* inside dropbox folder - but dropbox process killed...

It seems to happens frequently in Journal pages but also in default pages.

Please let me know if further informations are required to address this annoying error of this great wiki software!

Thanks,

greg4b (rapide-aston-martin) wrote :

In addition to my comment #30, I'd like to add that I followed the instructions of l1zard (propstmatthias-6) wrote on 2014-07-18 setting

setting the variable autosave_timeout=600

This reducded to error occurence dramaticallay - from countless per day to one per day.
I'm running the new settings since two working days.

I'd love to see the error fixed - thank you.

Greg

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

Other bug subscribers