The process cannot access the file '[redacted]*.lock' because it is being used by another process.

206 views
Skip to first unread message

Fletcher Kauffman

unread,
Jul 12, 2021, 3:29:01 PM7/12/21
to yWriter

Hey there. I've just been using yW a couple of days, but I got this error today. The [redacted] part is the full and correct path (it's just long, not secret).

The process cannot access the file 'H:\documents\Writing\yWriter Projects\Hailey\Hailey.yw7.lock' because it is being used by another process.

So, the .lock file does not exist at this location. For funsies, I tried creating a zero-byte file at that location, and I got the same error, and it then deleted the file I created.

Unusual things about my setup:
1) I have it installed on Windows and am using it normally.
2) I also have it installed on a Mint 20.2 laptop, running it using Wine (FYI, Mono doesn't run it properly, but Wine seems to).
3) Rather than using a local folder for synchronization (long story), I'm having Mega sync the entire directory structure I use (yWriter, other files, .timeline files) between the two machines.

Now, what might have contributed to the issue:
1) I wrote until about midnight last night, saved all the files, made sure Mega Sync'd, then closed the laptop lid with yWriter still open.
2) This morning, I got onto my desktop PC, launched yWriter, and got the above message.
3) I went back to the laptop, re-saved anything open, then closed yWriter.
4) Made sure that Mega Sync'd again

I realize this is a bit of an edge case, and it appears the backups are solid (I'm not panicked), but I'd like to be able to resume work, and know what not to do in future. Or how to remedy, if I do. This doesn't appear to be  a simple case where a file is locked open in the filesystem.

I'll paste in the log.

11:44:14 Connecting DUMMY Rtf handler in LibSpacejock.clsRTF
11:44:14 Connected RTF_Handler in set_RTF_Handler
11:44:14 Connecting DUMMY Rtf handler in LibSpacejock.clsRTF
11:44:14 Connected RTF_Handler in set_RTF_Handler
11:44:14 Connecting WINDOWS Rtf handler in LibSpacejockWin.clsRTF wrapper.
11:44:14 Connected RTF_Handler in set_RTF_Handler
11:44:18 Could not find file 'C:\Users\fletc\AppData\Roaming\Spacejock Software\yWriter7\POP3.xml'. in clsFile:ReadUnicodeForced
11:44:18 Could not find file 'C:\Users\fletc\AppData\Roaming\Spacejock Software\yWriter7\SMTP.xml'. in clsFile:ReadUnicodeForced
11:44:18 Could not find file 'C:\Users\fletc\AppData\Roaming\Spacejock Software\yWriter7\Accounts.xml'. in clsFile:ReadUnicodeForced
11:44:18
11:44:18
11:44:18
11:44:18
11:44:18 -----------------------------------
11:44:18
11:44:18 Log started: 2021-07-12
11:44:18 Logging to C:\Users\fletc\AppData\Roaming\Spacejock Software\yWriter7\Log.txt
11:44:18
11:44:18
11:44:18 RELEASE compile
11:44:18
11:44:18 Platform: WINDOWS
11:44:18 RELEASE compile
11:44:18 OS Description: Microsoft Windows 10.0.19042
11:44:18 Framework: .NET Framework 4.8.4360.0
11:44:18 OS Architecture: X64
11:44:18 Process Architecture: X86
11:44:18 System version: v4.0.30319
11:44:18
11:44:18 Date format: yyyy-MM-dd
11:44:18 Date separator: -
11:44:18
11:44:18 Directory char: \
11:44:18
11:44:18 System Text Encoding: iso-8859-1
11:44:18 System Codepage: 1252
11:44:18 Single byte system: True
11:44:18 Installed language: English (United States)
11:44:18
11:44:18 True string: TRUE (True = -1)
11:44:18 False string: FALSE (False = 0)
11:44:18 -----------------------------------
11:44:18 yWriter7 7.1.2.4 startup
11:44:18 11:44:18, Physical Memory: 34,305,761,280 Available: 967,983,104
11:44:18, Virtual Memory: 2,147,352,576 Available: 1,793,925,120
11:44:18, App: yWriter7.exe
11:44:18, App Version: 7.1.2.4
11:44:18, Curdir: C:\Program Files (x86)\yWriter7
11:44:18, App.path: C:\Program Files (x86)\yWriter7

11:44:18
11:44:18 Settings file: C:\Users\fletc\AppData\Roaming\Spacejock Software\yWriter7\yWriter7.ini in frmMain:frmMain_Load
11:44:18 Size: 3663 in frmMain:frmMain_Load
11:44:18 Loading settings from C:\Users\fletc\AppData\Roaming\Spacejock Software\yWriter7\yWriter7.ini
11:44:18 Settings loaded
11:44:19 Loaded dictionary 'C:\Users\fletc\AppData\Roaming\Spacejock Software\yWriter7\Dict\2of12.txt' with 41242 words.
11:44:19 Added dictionary C:\Users\fletc\AppData\Roaming\Spacejock Software\yWriter7\Dict\2of12 (Active = True)
11:44:19 Loaded dictionary 'C:\Users\fletc\AppData\Roaming\Spacejock Software\yWriter7\Dict\2of12inf.txt' with 81883 words.
11:44:19 Added dictionary C:\Users\fletc\AppData\Roaming\Spacejock Software\yWriter7\Dict\2of12inf (Active = True)
11:44:20 Loaded dictionary 'C:\Users\fletc\AppData\Roaming\Spacejock Software\yWriter7\Dict\3esl.txt' with 21877 words.
11:44:20 Added dictionary C:\Users\fletc\AppData\Roaming\Spacejock Software\yWriter7\Dict\3esl (Active = True)
11:44:20 Loaded dictionary 'C:\Users\fletc\AppData\Roaming\Spacejock Software\yWriter7\Dict\6of12.txt' with 31169 words.
11:44:20 Added dictionary C:\Users\fletc\AppData\Roaming\Spacejock Software\yWriter7\Dict\6of12 (Active = True)
11:44:20 Could not find C:\Users\fletc\AppData\Roaming\Spacejock Software\yWriter7\Dict\Custom.txt
11:44:20 4 dictionary files initialised from C:\Users\fletc\AppData\Roaming\Spacejock Software\yWriter7\Dict
11:44:20 One or more dictionaries found: spell check enabled in frmMain:LoadSpellingDictionaries
11:44:20 Dictionary folder: C:\Users\fletc\AppData\Roaming\Spacejock Software\yWriter7\Dict
11:44:20 Name and/or Serial empty
11:44:20 Name and/or Serial empty
11:44:20 Name and/or Serial empty
11:44:25 Update Frequency value: 3 (UpdateCheckV2Frequency)
11:44:25 Last checked for update: 2021-07-10 (UpdateCheckV2Last)
11:44:25 Update frequency = Weekly
11:44:25 Not checking for update: 2021-07-10 is not <= 2021-07-05
11:44:35 Locked project H:\documents\Writing\yWriter Projects\Hailey\Hailey.yw7
11:44:35 Extracting project from xml
11:44:35 Version 7 project
11:44:35 Project extracted
11:44:36 The process cannot access the file 'H:\documents\Writing\yWriter Projects\Hailey\Hailey.yw7.lock' because it is being used by another process. in clsFile:EraseFile
11:44:36 Unable to delete H:\documents\Writing\yWriter Projects\Hailey\Hailey.yw7.lock
11:44:36 The process cannot access the file 'H:\documents\Writing\yWriter Projects\Hailey\Hailey.yw7.lock' because it is being used by another process. in clsFile:EraseFile
11:44:36 The process cannot access the file 'H:\documents\Writing\yWriter Projects\Hailey\Hailey.yw7.lock' because it is being used by another process. in frmMain:LoadProject
11:47:58 Saving settings
11:47:58 Attempting save to C:\Users\fletc\AppData\Roaming\Spacejock Software\yWriter7\yWriter7.ini
11:47:58 Settings saved to C:\Users\fletc\AppData\Roaming\Spacejock Software\yWriter7\yWriter7.ini
11:47:58 Saved to C:\Users\fletc\AppData\Roaming\Spacejock Software\yWriter7\yWriter7.ini
11:47:58 Closed down yWriter7

Fletcher Kauffman

unread,
Jul 13, 2021, 12:20:40 AM7/13/21
to yWriter
Adding a data point or two:

I tried some additional stuff to see if I could work out the issue.
  1. I have renamed the .ini file, and removed/hidden the pron file. No effect. Oddly, however, even with the .ini file renamed, I still got the same color scheme I was using.
  2. I have uninstalled/reinstalled yWriter. No change.
  3. I tried opening my file from the backups. Same problem.
  4. I moved the directory of my project, in case a path was borked for some reason. No effect.
  5. Then, I thought I'd go whole hog and create an entirely new, different project.. and it STILL says it can't open the .lock file (the .lock file for the new project's .yw7 file), because it's being used by another process. This is especially odd, given that the file doesn't exist-- and ProcessExplorer doesn't find anything like it.
  6. I am unable to use the Backups stuff in the application itself, for some reason. It's greyed out when I open the app, or even partially open a project file.
As I think I said before, I tried creating this .lock file just to see its response-- it had the exact same complaint, but then it deleted the .lock file, which seems to indicate that it isn't having trouble getting permissions for it. And, somehow the problem seems to be a part of the project files (even in a different project?) because my Linux laptop now exhibits the same behavior, and only the project files are sync'd.

Simon Haynes

unread,
Jul 13, 2021, 1:53:24 AM7/13/21
to ywr...@googlegroups.com
The lock file is created by yWriter when you open a project. It's held in an open state until you close that project.  It's designed to prevent users opening the same project twice on the same PC, or from another PC if the folder is shared.

The reason yWriter holds the file open is because if the program crashes, or windows reboots, and the stray Lock file is left behind, yWriter knows that a lock file which is not held open is not actually doing anything.

If the file cannot be deleted, it generally means you have the project open in a second copy of ywriter. Either that, or the file is on the cloud and is being synced, and is thus locked until the sync is completed.

Just curious, but do you have that Onedrive feature enabled where your user documents are actually stored on the cloud?


--
You received this message because you are subscribed to the Google Groups "yWriter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ywriter+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ywriter/e3f8215c-79d1-47da-a10a-8721b13f5725n%40googlegroups.com.


--

--
Visit Spacejock Software, the home of yWriter, FCharts and more
Visit spacejock.com.au for my articles on writing and publishing novels.

Fletcher Kauffman

unread,
Jul 13, 2021, 12:53:09 PM7/13/21
to yWriter
No, Simon, not using OneDrive. I'm using Mega, which is not so quick on the trigger, generally, to start copying things up and down.

To be clear, the .lock file does not exist. I get this error message even with a brand new project, without Mega running. And, if I manually create a .lock file, I get the exact same message, but then yWriter deletes my created .lock file without issue.

The attached is a picture of the message I'm getting with a brand new project, and where no .lock file exists in that directory.

I'm going to look at installing the beta, per your other message, re: the recoloring of column headers. Maybe that will move the needle.

Thanks for the speedy response!
Clipboarder.2021.07.13.png

Fletcher Kauffman

unread,
Jul 13, 2021, 12:58:34 PM7/13/21
to yWriter

Just FYI, the beta had no impact on this issue, in case that information is of any use.

Simon Haynes

unread,
Jul 13, 2021, 1:05:29 PM7/13/21
to ywr...@googlegroups.com
Can you check permissions on that folder?

The process cannot access the file 'H:\documents\Writing\yWriter Projects\Hailey\Hailey.yw7.lock' because it is being used by another process. in clsFile:EraseFile

It's failing to erase the file, rather than not finding it. Creating won't help, but I'm wondering if it simply doesn't have access at all.



Fletcher Kauffman

unread,
Jul 14, 2021, 8:53:31 AM7/14/21
to yWriter
[tldr; it's not permissions, but apparently yW hates network drives. Explanation, and possible separate bug below.]

*Snap of fingers!* You may be on to something, Boy Wonder.

I thought of that before, but I ignored the thought, because why would the permissions on Linux AND on Windows be the same?

...

Well, it's not that, but in testing it, I did discover something... and maybe I missed this somewhere, especially since it was working. It appears that yWriter hates network drives.. ? My My Documents folder is mapped to a network drive (it's a NAS that's local). I was able to set up and work with the project, but for whatever reason, this issue developed-- and it appeared to be once I set the project up on Mega, opened it on my laptop, saved it, left the project open, then opened it on the desktop and got this error. (It had been saved on the laptop, and once I realized it was still open, I closed it).

So, now, if I create a new project, and locate it on any of the network volumes on my NAS, I get this error. If I create a new project on a local disk, I do not. Similarly/oddly, I have a local folder that ALSO has a mapped drive letter via the loopback interface. I can create and re-open a project in there, using either method.

I ssh'd onto the NAS to check the permissions, and everything was the same as ever (fully open everything for my user account), and I checked on Windows, out of curiosity, and nothing weird there.

But, in case you missed it, if I create that .lock file it can't open, and then I close the aborted-opening project, it will erase the .lock file. So, it erases it, well enough. Also, I can write a new project to the same location.

Ultimately, my solution is a mess:

Copy my Writing folder to a local folder.
Sync local folder with Mega.
Backup/rename Writing file on network.
Create standard shortcut on network to point to local folder (in case of any existing links, etc.)

NOW, yWriter opens the file without any question, and even with all my monkeying around trying to fix the issue, it looks like it's all intact, so well-done-you!

I did just discover something, though-- I opened my project, the last scene I was working on is visible there in the Scenes/Content tab. But if I close the project, that scene remains there. Expected behavior? In this state, yWriter does not believe a project is open, as there is no Close Project option available.

Fletcher Kauffman

unread,
Jul 14, 2021, 8:54:32 AM7/14/21
to yWriter
Wouldn't let me inline this image for some reason.
Clipboarder.2021.07.14-003.png

Simon Haynes

unread,
Jul 14, 2021, 9:36:45 AM7/14/21
to ywr...@googlegroups.com
Do you have the NAS set up to map oplocks?  I have a Dlink 4-bay NAS and I have to map the windows permissions to the EXT4 drives for them to work.

--
You received this message because you are subscribed to the Google Groups "yWriter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ywriter+u...@googlegroups.com.

Fletcher Kauffman

unread,
Jul 14, 2021, 10:14:07 AM7/14/21
to ywr...@googlegroups.com
I hadn't thought to check that (because I didn't know about it) but OppLocking is turned on-- and has been turned on.

It's funny that this problem happened the way it did, because I think it ultimately had nothing to do with Mega or having the file open in two places-- it just works the first time the project is opened, but you can't reopen it.

You received this message because you are subscribed to a topic in the Google Groups "yWriter" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ywriter/k9FxYwJibiA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ywriter+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ywriter/CAN0R%3DkQEzryyVXXiwUA2b0jCXMN_7f0JOcpP1owhSGpWvqN_nw%40mail.gmail.com.

Simon Haynes

unread,
Jul 14, 2021, 10:55:22 AM7/14/21
to ywr...@googlegroups.com
The other issue is case - if one part of the program is looking for LCK and another is lck, Linux would return no match.


Fletcher Kauffman

unread,
Jul 14, 2021, 11:30:40 PM7/14/21
to ywr...@googlegroups.com
Ahh... except I believe the NAS is setup to handle that for an MS-DOS share, so case isn't an issue.

Running under Wine on Linux, it also seems to work just fine.

Hopefully this posts in the right place-- I couldn't do it through the Groups page.

You received this message because you are subscribed to a topic in the Google Groups "yWriter" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ywriter/k9FxYwJibiA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ywriter+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ywriter/68713362-9512-4980-acac-99a4edc3a1ean%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages