Zim

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

Bug #804936 reported by T Hill
88
This bug affects 16 people
Affects Status Importance Assigned to Milestone
Zim
Incomplete
High
Jaap Karssenberg

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.

Revision history for this message
Jaap Karssenberg (jaap.karssenberg) wrote : Re: [Bug 804936] [NEW] Could Not Save Page: [Error 2] The system cannot find the file specified.

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.

Revision history for this message
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.

Revision history for this message
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.

Revision history for this message
Jaap Karssenberg (jaap.karssenberg) wrote :

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
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in zim:
status: Incomplete → Expired
Revision history for this message
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?

Revision history for this message
Darryl Collins (support-launchpad) wrote :

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?

Revision history for this message
Jaap Karssenberg (jaap.karssenberg) wrote : Re: [Bug 804936] Re: Could Not Save Page: [Error 2] The system cannot find the file specified.

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

Revision history for this message
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.

Revision history for this message
Jaap Karssenberg (jaap.karssenberg) wrote :

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
Revision history for this message
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.

Revision history for this message
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.

Revision history for this message
Jaap Karssenberg (jaap.karssenberg) wrote :

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
Revision history for this message
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.

Revision history for this message
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.

Revision history for this message
Jaap Karssenberg (jaap.karssenberg) wrote :

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

Revision history for this message
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.

Revision history for this message
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.

Revision history for this message
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.

Revision history for this message
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.

Revision history for this message
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...

Revision history for this message
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...

Revision history for this message
djib (djibux) 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.

Revision history for this message
djib (djibux) 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.

Revision history for this message
Jaap Karssenberg (jaap.karssenberg) wrote :

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
Revision history for this message
djib (djibux) 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

Revision history for this message
djib (djibux) 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.

Revision history for this message
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.

Revision history for this message
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...

Revision history for this message
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,

Revision history for this message
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

Revision history for this message
greg4b (rapide-aston-martin) wrote :

Even with workaround from post #31 I've received today repeadetly error messages - and below a debug message:

This is zim 0.63
Platform: nt
Locale: de_AT cp1252
FS encoding: mbcs
Python: (2, 7, 10, 'final', 0)
Gtk: (2, 24, 10)
Pygtk: (2, 24, 0)
Zim revision is:
  branch: trunk
  revision: 766 <email address hidden>
  date: 2015-06-14 11:19:01 +0200

======= Traceback =======
  File "zim\gui\pageview.pyo", line 5377, in do_link_clicked
  File "zim\gui\__init__.pyo", line 1244, in open_page
AssertionError: Could not close page

Hope this helps for fixing.

Thanks,

Greg

Revision history for this message
Beth (beth-arronaz) wrote :

I have the same problem =(

Zim is unable to save. Oddly, I have ZIm installed and working in 3 machines, but I've noticed something interesting about them:

Machine A: Zim 0.63 - Windows 7 Professional - Save bug!
Machine B: Zim 0.62 - Linux - Zorin 0S 10 - Works fine.
Machine C: Zim 0.63 - Windows 7 Professional - Works fine.

Machine A: This is the problematic computer. I use Tresorit (similar to Dropbox, Spideroak), and I'm syncing Zim's notebook folder. However, even if I disable Tresorit, the save bug continues to occur. Usually after some minutes, and it becomes impossible to work.

Machine B: The same setup as above, including syncing Zim's notebook with Tresorit, however I never get the problem. I believe it works because it is a Linux box.

Machine C: Here, I'm syncing only part of Zim's notebook, that is, the notebook on the other machines is just a subnotebook of the main notebook I work in this machine. So, Tresorit never gets to touch the main index.db and state.conf files, which may be related to the problem.

Thanks for any assistance.

Revision history for this message
Jaap Karssenberg (jaap.karssenberg) wrote :

I have attached a zip file with a plugin called "folder_patch". It replaces the code that generates the error and will log what is happening to a separate log file.

Unfortunately I have not tested it on windows yet, but reasonable sure that the code will run. If it gives errors, I can test on windows myself on monday.

To use the plugin you should have the latest version of zim. Then you go to the folder "%APPDATA%/zim/data/zim/plugins/". Probably you need to create this folder first. If you are not familiar with "%APPDATA%", this is a special folder name, try typing it into the windows explorer location bar.

In this folder unzip the attached zip file.

Restart zim and open the preferences dialog. In the plugins list there should be "folder patch" plugin listed. Enabling should not show anything visually. That is good.

When using zim with this plugin a file will be created in you home dir called "zim-folder-patch-log.txt". Each read and write of a file will be logged there. If an error occurs again like the one before, please include the end of this log file. That will help greatly to diagnose what is happening.

Hope this helps to diagnose the issue ..

Revision history for this message
greg4b (rapide-aston-martin) wrote :
Download full text (4.1 KiB)

Hello Jaap,

thx for working on this!

I've installed and logged, but the patch seems to influence the behaviour:
when i click on the calender to add a new journal entry i receicve
following error message:
[image: Inline-Bild 1]

I'm on zim 0.65, Win7 , the folder patch is enabled and the log says:

Read C:\Temp\privat\wiki\Journal\2016\01\27.txt, etag (1455022654.4847162,
'02dc713f9e946cdbfef22a699f77da65')
Read C:\Temp\privat\wiki\Journal\2016\02\11.txt, etag (1455178091.393237,
'1b8992bd5220cece94159d49616bf52c')
Read C:\Temp\privat\wiki\Journal\2016\02\10.txt, etag (1455200926.28164,
'194a7557d707a40219c666117697d48f')
Read C:\Temp\privat\wiki\Journal\2016\02\12.txt, etag (1455269392.8110738,
'bae5459b44d0972156a997196da02e27')
Wrote C:\Temp\privat\wiki\Journal\2016\02\12.txt, etag (1455519503.4410586,
'fdfff7fb4c591c20da6e43c0785ad89c')
Read C:\Temp\privat\wiki\Journal\2016\02\11.txt, etag (1455178091.393237,
'1b8992bd5220cece94159d49616bf52c')
Read C:\Temp\privat\wiki\Journal\2016\02\09.txt, etag (1455175013.9427388,
'23faa188ccacfe4eddbba30a0e35c01d')
Read C:\Temp\privat\wiki\Journal\2016\02\08.txt, etag (1454935019.9586406,
'7f18f493b456a6dc6703efb627f3ce58')
Read C:\Temp\privat\wiki\Journal\2016\02\12.txt, etag (1455519503.4410586,
'fdfff7fb4c591c20da6e43c0785ad89c')
Wrote C:\Temp\privat\wiki\Journal\2016\02\12.txt, etag (1455519523.6190763,
'3ed93b76d9187f00f65d8d34c21381e8')
Wrote C:\Temp\privat\wiki\Journal\2016\02\12.txt, etag (1455519580.769791,
'3ed93b76d9187f00f65d8d34c21381e8')
Wrote C:\Temp\privat\wiki\Journal\2016\02\15\Montag_15_Feb_2016.txt, etag
(1455519604.8762012, '6ff7123eb9b8144ae02a1d4e9cb14cc3')
Read C:\Temp\privat\wiki\Journal\2016\02\Montag_15_Feb_2016.txt, etag
(1455519604.8762012, '6ff7123eb9b8144ae02a1d4e9cb14cc3')
Wrote C:\Temp\privat\wiki\Journal\2016\02\Montag_15_Feb_201

Maybe you can improve the patch so that a somewhat normal usage is possible
to give the right logs to the error.

Thanks & Viele Grüße from Austria,

Gregor

2016-02-12 19:27 GMT+01:00 Jaap Karssenberg <email address hidden>:

> I have attached a zip file with a plugin called "folder_patch". It
> replaces the code that generates the error and will log what is
> happening to a separate log file.
>
> Unfortunately I have not tested it on windows yet, but reasonable sure
> that the code will run. If it gives errors, I can test on windows myself
> on monday.
>
> To use the plugin you should have the latest version of zim. Then you go
> to the folder "%APPDATA%/zim/data/zim/plugins/". Probably you need to
> create this folder first. If you are not familiar with "%APPDATA%", this
> is a special folder name, try typing it into the windows explorer
> location bar.
>
> In this folder unzip the attached zip file.
>
> Restart zim and open the preferences dialog. In the plugins list there
> should be "folder patch" plugin listed. Enabling should not show
> anything visually. That is good.
>
> When using zim with this plugin a file will be created in you home dir
> called "zim-folder-patch-log.txt". Each read and write of a file will be
> logged there. If an error occurs again like the one before, please
> include the end of this log file. That ...

Read more...

Revision history for this message
Jaap Karssenberg (jaap.karssenberg) wrote :

Updated the hot patch to allow non-existing pages to work as well.

Now tested myself on windows, seems to work for basic usage.

Revision history for this message
greg4b (rapide-aston-martin) wrote :
Download full text (12.9 KiB)

Hi,

seems to work.

I've got an error message - don't know if it's this specific error,or
another...

LOG:

Read C:\Temp\privat\wiki\Journal\2015\08\21.txt, etag (1440140417.985819,
'fd6941aa04d110f75d303ab61420ff43')
Read C:\Temp\privat\wiki\Journal\2015\08\22.txt, etag (1440340947.0,
'268e6e7490040b424a68b057bedbf90c')
Read C:\Temp\privat\wiki\Journal\2015\08\24.txt, etag (1440488612.5757108,
'bf9e23a0616d0ed616f365b2613ed712')
Read C:\Temp\privat\wiki\Journal\2015\08\25.txt, etag (1440501180.1767278,
'059c45ebcc7c1865fb8f2720c11541f3')
Read C:\Temp\privat\wiki\Journal\2015\08\27.txt, etag (1440679596.2470064,
'dcdbd9cf39bb3e3d0e7f5c990db60253')
Read C:\Temp\privat\wiki\Journal\2015\08\28.txt, etag (1440769818.7869897,
'041381cd401699b32d12d0f70b66faf6')
Read C:\Temp\privat\wiki\Journal\2015\08\31.txt, etag (1441028040.3394482,
'2f67203abf987e76337c2052dbcc2787')
Read C:\Temp\privat\wiki\Journal\2015\09\02.txt, etag (1441275373.3057656,
'52432a077cf85ce8de8994e0feba13c3')
Read C:\Temp\privat\wiki\Journal\2015\09\03.txt, etag (1443521687.0099862,
'760ceda4a24dc693ccfd81575b3d4868')
Read C:\Temp\privat\wiki\Journal\2015\09\04.txt, etag (1441371639.9045408,
'f4156204dc424313c74947d997b587e4')
Read C:\Temp\privat\wiki\Journal\2015\09\05.txt, etag (1441443096.0,
'83cf90e02ce4016fe5a0036971ca215b')
Read C:\Temp\privat\wiki\Journal\2015\09\07.txt, etag (1441626518.2077725,
'4d214260481a997aa1021dc8863a515e')
Read C:\Temp\privat\wiki\Journal\2015\09\08.txt, etag (1441779705.6985939,
'3c20435e7a849d6a30bdf033cd95a3c8')
Read C:\Temp\privat\wiki\Journal\2015\09\09.txt, etag (1441804853.3837168,
'57adb6fdcb9cba1c30bebfa8d53ce343')
Read C:\Temp\privat\wiki\Journal\2015\09\10.txt, etag (1441957926.8223035,
'574cfdc9df2dcf92a52a15fab7febbbd')
Read C:\Temp\privat\wiki\Journal\2015\09\11.txt, etag (1443521660.185304,
'897e982eeac96fb2bf1ff2b0c09dacc9')
Read C:\Temp\privat\wiki\Journal\2015\09\13.txt, etag (1442173033.0,
'579f5409d7a035c138a331bcb139fb9d')
Read C:\Temp\privat\wiki\Journal\2015\09\14.txt, etag (1442234064.03311,
'901a8bfcb9a6c645ca7d127d3a31e92d')
Read C:\Temp\privat\wiki\Journal\2015\09\15.txt, etag (1442324793.6098003,
'5b2bc1beba79f372d3d1c9f205fc77fc')
Read C:\Temp\privat\wiki\Journal\2015\09\16.txt, etag (1442406156.5514364,
'f2bcf029c3b28b180c8fc65cbc24c8d0')
Read C:\Temp\privat\wiki\Journal\2015\09\17.txt, etag (1449744837.8339415,
'deb4f0dcb457019969ca5b81485a5a17')
Read C:\Temp\privat\wiki\Journal\2015\09\20.txt, etag (1442774434.0,
'dec6c8065a05074243b7ae37fb734de5')
Read C:\Temp\privat\wiki\Journal\2015\09\21.txt, etag (1442815907.0832927,
'0ac46da5c0aedfe4896d696bd542d795')
Read C:\Temp\privat\wiki\Journal\2015\09\22.txt, etag (1443521646.0078864,
'35def13f97cffc3b13137b7ed042a796')
Read C:\Temp\privat\wiki\Journal\2015\09\23.txt, etag (1443418826.2450778,
'bdf23f184c177428510f3bcfd6af2394')
Read C:\Temp\privat\wiki\Journal\2015\09\24.txt, etag (1443162368.5807238,
'0fc4fd497ae69ad6487954c348f1a4a7')
Read C:\Temp\privat\wiki\Journal\2015\09\25.txt, etag (1452501454.7905788,
'e92e72e410c6ae3de59f92129199b7c3')
Read C:\Temp\privat\wiki\Journal\2015\09\28.txt, etag (1443521604.8887749,
'13c80b47281c3b83b02030046279365f')
Read C:\Tem...

Revision history for this message
Jaap Karssenberg (jaap.karssenberg) wrote :

@greg: error you report is not related to this bug, see bug #1336228 instead

Revision history for this message
Jaap Karssenberg (jaap.karssenberg) wrote :

Updated the patch to solve couple of bugs specific for renaming and resolving attachment folders

Revision history for this message
greg4b (rapide-aston-martin) wrote :

Hello Jaap,

thx for updating the hot patch - but it seems not to work properly

Creating new journal entry with clicking onto the calendar:

[image: Inline-Bild 1]

Also when I create a new page:
[image: Inline-Bild 7]

I think for root cause analysis, the patch should work in the daily
use-case... hence I will disable the patch.

Could you please provide an update to the patch!?

Viele Grüße,

Gregor

2016-02-22 20:48 GMT+01:00 Jaap Karssenberg <email address hidden>:

> Updated the patch to solve couple of bugs specific for renaming and
> resolving attachment folders
>
> ** Attachment added: "Hotpatch update 2"
>
> https://bugs.launchpad.net/zim/+bug/804936/+attachment/4578338/+files/folder_patch.zip
>
> ** Attachment removed: "Hot patch - update 1"
>
> https://bugs.launchpad.net/zim/+bug/804936/+attachment/4572165/+files/folder_patch.zip
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/804936
>
> Title:
> Could Not Save Page: [Error 2] The system cannot find the file
> specified.
>
> Status in Zim:
> Confirmed
>
> 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.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/zim/+bug/804936/+subscriptions
>

Revision history for this message
Jaap Karssenberg (jaap.karssenberg) wrote :

Hi Gregor,

Tested on my own system, but both functions seem to work for me.

What is your exact configuration? Zim version, source or compiles, windows version, ...

Regards,

Jaap

Revision history for this message
Jaap Karssenberg (jaap.karssenberg) wrote :

Sorry - my bad, I was running with 0.64 not 0.65 ... will fix patch and test it with 0.65 this time ..

Revision history for this message
Jaap Karssenberg (jaap.karssenberg) wrote :

OK this should be the right version of the patch, sorry for messing up the previous version.

Tested on 0.65 win 7
- opening new page works
- opening new journal page works
- rename works
- attachment browser works

Changed in zim:
assignee: nobody → Jaap Karssenberg (jaap.karssenberg)
status: Confirmed → In Progress
Revision history for this message
Beth (beth-arronaz) wrote :

I would like to add that the Folder Patch requires that the uncompressed folder "folder_patch" be placed at the plugins directory. I had the files directly in the plugins directory and it didn't work.

So you need:
.../plugins/folder_patch/*plugin files

and not:
.../plugins/*plugin files

Let's see what errors we can collect.

Revision history for this message
galactic star (studiostarstuff) wrote :

hello, just filed a similar bug report, this bug needs to be squashed! i'm here to help as well with the error collection

Revision history for this message
Beth (beth-arronaz) wrote :

Here is my error file. I've noticed that they reduced since I installed the patch, but I was still able to capture at least one. In the file attached, the error seems to occur at lines 39, 43 and 53. It seems the read process was interrupted by another read, and resumed out of order.

I sanitized some sensitive names, but I hope it is still helpful.

Revision history for this message
Jaap Karssenberg (jaap.karssenberg) wrote :

Beth, looks like the file really changed on disk in between the writes. The hex number in the log gives the checksum of the file and that changed. So writing the file and reading again gave different results.

Do you remember what you were doing at the time the error happened? Anything that could explain a file change?

Revision history for this message
Beth (beth-arronaz) wrote :

Simply updating and reordering text and topics on that page. I then saved the page manually, because I've set Zim to autosave every 10 minutes, following the instructions on this page, even though it didn't solve the problem.

I always have Syncthing running on the background, which is the tool I'm using for synchronization now, and it is set to check the files every five minutes. Perhaps the verification coincided with the moment I tried to save? When I use other synchronization programs (like Tresorit) the problem happens more frequently, because they tend to check the file as soon as it is changed. I'm certain having the notebook synchronized, encrypted or otherwise monitored is the culprit.

I don't think the problem is caused by anything in particular in the contents of that page, because I've seen it happen everywhere.

Revision history for this message
Beth (beth-arronaz) wrote :

I forgot to add that the notebook is synchronized between two computers, but they are rarely, if ever, used at the same time, because I'm usually on both ends. One computer always presents the problem, the other never does. Here is what I can tell of the specs of each computer:

Problematic computer:
--------------------------
Windows 7 Professional x64
HP notebook (2012)
Intel i3 CPU
4gb RAM
320gb Samsung HDD
Avast free antivirus

Computer that never displayed the problem:
--------------------------------------------------
Windows 7 Professional x64
Lenovo notebook (2007)
Intel Core 2 Duo CPU
2gb RAM
80gb Hitachi HDD
Panda free antivirus

Now this last computer is running Linux, so I can't try to break it any longer. I have another Windows 7 machine, though, and when I used Zim on it, it also didn't present the problem, even though it was also synchronized. Perhaps Avast is the problem? Both of my machines that worked used Panda.

Revision history for this message
Pavel Sedach (psedach) wrote :

Just solved this problem by checking every single executable in the Zim folder and adding "run as administrator" to compatibility.

This solves it completely!

Revision history for this message
Marcus (op132) wrote :

I've just set up Zim on a new computer and am experiencing this error, repeatedly, for the first time.

Previous computers (never this error):
Zim 0.65 on Linux Mint 17.3
Zim 0.?? on Windows 7 (I believe two different computers)
Zim 0.60 on Windows XP

Current computer:
Zim 0.65 on Windows 7 SP1

There's no Dropbox or synchronization program installed on this computer. I am also one of those who compulsively presses Ctrl-S.

After reading this thread I changed autosave timeout to 60. If the error happens again, I'm inclined to try Pavel's suggestion -- but do I have to apply that change to all 29 exe files separately? (If I select two or more and open Properties, there's no Compatibility tab.)

After that, if necessary, I'll try the patch.

Revision history for this message
David Gasaway (b-dave) wrote :

Here is my experience with this issue and Zim 0.65 on Windows. I have a few notebooks on network shares and Dropbox. I never have a problem in Linux (NFS or Dropbox), or on Windows 10 with a notebook in Dropbox. I only get this error in Windows with a network drive (mapped to a Samba share). This hasn't always happened, so I believe a Zim update kicked it off. Here is an example error:
>>>
[Error 2] The system cannot find the file specified: u'P:\\Notebooks\\Notes\\00_Notes_TODO.txt.zim-orig~'

To continue you can save a copy of this page or discard
any changes. If you save a copy changes will be also
discarded, but you can restore the copy later.
>>>
This only happens if I issue a save command (Ctrl+S). If I wait for auto-save, it works fine. If I hit Cancel on the error dialog and wait for auto-save, it gets saved.

Here is the other interesting twist. If I launch Zim and open the notebook above on the share, it will start out read-only with the Notebook Editable option disabled, as in I cannot toggle the option. Now, I open another notebook on Dropbox, then re-open the original notebook (same instance of Zim the entire time). The notebook will still be read-only, yet now I can toggle the Notebook Editable option. If I click the button, I can now edit the notebook, but Ctrl+S causes the error above.

Let me know if you'd like another bug report for this other odd behavior, but it seems somehow related to [Error 2] in my case.

Revision history for this message
Sven K (sjmk89) wrote :

The (quite annoying) bug appears quite often on my Windows 7 laptop on work (no dropbox or similar software installed, McAfee Agent running, problem exists for Portable and Installer version). I tried setting admin rights for all executables (did not help) and changing the Ctrl+S Shortcut to another Keybinding (did not help, problem also appears with autosafe for me). What helped me however was switching back from zim 0.65 to zim 0.62. The problem didn't occur here so far. If it reapears in this version as well, I will update my comment here.

Revision history for this message
Sven K (sjmk89) wrote :

Update: The bug appears in the old version as well but much more rarely. I could not find a perferences config file in this version, but maybe the used autosave_timeout is different in this version?

Revision history for this message
Sven K (sjmk89) wrote :

Update 2: My current bugfix is the following: I've (kind of) disabled the autosave functionality: I've set autosafe_timeout in perferences.conf to a very high value (autosafe_timeout = 999999). Now it seems that I can safe my pages with Ctrl+S at any time without problems. As far as I've seen, the *.bak*~ files are not created anymore which might have caused the problem (I had multiple backup files there for one page, e.g. .bak1~ up to -.bak9~).
When I close the zim application window or switch to another page in the notebook, zim will save the last page by itself, so disabling autosave is working very well for me. Maybe it would be good if there was a general UI option to switch it off?

Revision history for this message
Fabian Tröster (fabian-troester) wrote :

Seems a bit far fetched (and possibly dumb, please beware): this issue arises with my installation, too, but very rarely so. My Zim-notebook is stored on a file share over the network. The server serving this file share is of course up 24/7. Sometimes I have to keep my workstation up 24/7, too. It seems to me that the issue arises if my workstation has been up for a week or more. Would it be a possibility that we're looking at an issue at operating system level? Could the clocks of the computers involved be out of sync and could this cause the problem?
On February 23rd I applied the folder patch proposed by Jaap and haven't had the issue since. Admittedly I also manually re-synced the internal clock and have over this time restarted the computer a couple of times.

I'm running Zim 0.65 on Windows 7 x64. As far as I know Windows will only re-sync the clock with an NTP server at startup and then once every week (except if manually triggered). So, if the clock drifts during this time it could explain the issue.

If my remark was a bit dumb, please disregard it.

Revision history for this message
Jaap Karssenberg (jaap.karssenberg) wrote :

Release 0.66 has several changes that should make file system interaction more robust. Not sure whether it fixes these issues or not, but hope it improves.

Specifically:
- We are now using windows api to do the atomic replace of files on write
- We not only check the timestamp but als checksum of content to detect real changes vs false positives

Changed in zim:
status: In Progress → Incomplete
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.