Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatibility with High Sierra? APFS? #365

Open
proksch opened this issue Jul 28, 2017 · 54 comments
Open

Incompatibility with High Sierra? APFS? #365

proksch opened this issue Jul 28, 2017 · 54 comments

Comments

@proksch
Copy link

proksch commented Jul 28, 2017

Hey guys,

I really love this app and I use it multiple times each day. However, I realized that it does no longer work for me in the current beta of macOS High Sierra. :/ Whenever I create a new note, I receive the following error:

Changed notes could not be saved because a parameter was invalid.

The file for the note is being created, but it stays empty. Whenever I restart NV, the contents of the note are gone.

I am using NV 2.0 β5 (8) and have configured it to store unencrypted plain-text files. OS-wise, I am using the Public Beta 3 of High Sierra (build 17A315i) and I have formatted my disk with APFS (if this makes a difference).

Please let me know, if I can provide you with any more details that help you pin-point the problem.

best
Sebastian

@glushchenko
Copy link

Try FSNotes https://github.com/glushchenko/fsnotes, new modern notational velocity alternative written on Swift 3, high sierra compatible.

@scrod
Copy link
Owner

scrod commented Aug 8, 2017

Could you please keep the Console app running while creating one such empty file, and then paste the output here?

Thanks.

@proksch
Copy link
Author

proksch commented Aug 9, 2017

Is there any particular log file you are interested in?

First of all, the selected storage option is not persisted. Regardless that I select "Plain text files" as the storage option, NV defaults back to "single database" on restart. When I start it, configure it to use plain text files, and try to create a node, the system.log file contains the following lines:

Aug 9 13:15:44 MyMachine Notational Velocity[1461]: verified 426 notes in 0.049177 s
Aug 9 13:15:44 MyMachine Notational Velocity[1461]: error exchanging contents of temporary file with destination file Notes & Settings: -50
Aug 9 13:15:51 MyMachine Notational Velocity[1461]: error exchanging contents of temporary file with destination file new node 3.txt: -50
Aug 9 13:15:51 MyMachine Notational Velocity[1461]: Unable to save note file new node 3.txt
Aug 9 13:15:59 MyMachine Notational Velocity[1461]: FILE WAS MODIFIED: new node 3.txt
Aug 9 13:16:11 MyMachine Notational Velocity[1461]: error exchanging contents of temporary file with destination file new node 3.txt: -50
Aug 9 13:16:11 MyMachine Notational Velocity[1461]: Unable to save note file new node 3.txt

Does this help?

@scrod
Copy link
Owner

scrod commented Aug 9, 2017

Thank you, Sebastian--that's quite helpful. It appears that APFS exports atomic "safe saving" ("exchangedata") as a volume capability, but is in fact lying. NV automatically falls back on its own exchangedata implementation for volumes which don't support it (such as UFS), but in this case it was deceived.

There are a few options here:

  • Wait for Apple to finish their exchangedata implementation in APFS or otherwise export the correct volume capabilities (they would presumably do this prior to GM, but I will file a bug with bugreporter.apple.com anyway).
  • Add a manual override for APFS in NV's volume capabilities check
  • Change NV's exchangedata fallback implementation to use APFS-specific atomic saving when APFS is detected
  • Change NV to use higher level file
    system APIs altogether

@scrod
Copy link
Owner

scrod commented Aug 9, 2017

Oh, I see they've deprecated exchangedata at the same time they broke it (which has been typical of Apple lately), so we might as well just check for VOL_CAP_INT_RENAME_SWAP in addition to VOL_CAP_INT_EXCHANGEDATA and use renameatx_np if it's available.

But it's still a bug that APFS exports VOL_CAP_INT_EXCHANGEDATA when it clearly has no intention of supporting it.

@GitBruno
Copy link

Is there a downside to using a higher level file system API?

@jtbandes
Copy link
Contributor

jtbandes commented Sep 4, 2017

It looks like this problem is still happening in the latest High Sierra developer beta. Do you have a desired approach in mind? Would you be interested in a patch to implement this fix? It seems a fresh clone of this repo doesn't build cleanly in Xcode with the latest macOS SDK; is there an updated project somewhere?

@scrod
Copy link
Owner

scrod commented Sep 4, 2017 via email

@jtbandes
Copy link
Contributor

jtbandes commented Sep 4, 2017

Unfortunately I can't build the code (among other problems, OpenSSL no longer ships with the system).

@jtbandes
Copy link
Contributor

jtbandes commented Sep 4, 2017

Actually, I figured out the problem. The volume is correctly reporting that it doesn't support the exchange operation. However, NV is incorrectly checking VOL_CAPABILITIES_FORMAT instead of VOL_CAPABILITIES_INTERFACES (note VOL_CAP_INT_EXCHANGEDATA and VOL_CAP_INT_RENAME_SWAP) so the flag it reads is actually VOL_CAP_FMT_JOURNAL_ACTIVE.

return (vinfo.v_caps.capabilities[VOL_CAPABILITIES_FORMAT]);

If you switch this to VOL_CAPABILITIES_INTERFACES, it should work 🙂

(BTW, in the modern SDK the easiest way to check for the swap capability would be NSURLVolumeSupportsSwapRenamingKey.)

@scrod
Copy link
Owner

scrod commented Sep 4, 2017 via email

@JesseAldridge
Copy link

Sorry to be a +1 guy, but my work laptop just did a forced upgrade to High Sierra, and my workflow is totally dependent on NV. So I'm kind of f'd right now.

@JesseAldridge
Copy link

screen shot 2017-11-07 at 12 44 49 pm

Not much notable output in console.app. Should I take off the "Notational Velocity" search query? Looks like I'm getting ~10 logs per second so the raw logs might not be too useful.

@JesseAldridge
Copy link

Oh, system.log... yeah, looks pretty much the same. I guess I will paste it anyway in case it's helpful.

Nov  7 09:55:25 [username] Notational Velocity[2780]: saw new disk UUID: DiskUUIDEntry(2017-11-07 17:55:25 +0000, [some-uuid]) (other disks are: (
Nov  7 09:55:29 [username] Notational Velocity[2780]: FILE WAS MODIFIED:  default for column cannot be cast automatically to type.txt
Nov  7 09:55:29 [username] Notational Velocity[2780]: FILE WAS MODIFIED:  object has no attribute '__getitem__'.txt
Nov  7 09:55:29 [username] Notational Velocity[2780]: FILE WAS MODIFIED: $ [ a < b ].txt
Nov  7 09:55:29 [username] Notational Velocity[2780]: FILE WAS MODIFIED: $set meteor.txt
Nov  7 09:55:29 [username] Notational Velocity[2780]: FILE WAS MODIFIED: %2Fetc%2Fdefault.1.txt
... gigantic list of notes...
Nov  7 09:55:34 [username] Notational Velocity[2780]: FILE WAS MODIFIED: zopectl output.txt
Nov  7 09:55:34 [username] Notational Velocity[2780]: FILE WAS MODIFIED: zsh move words.txt
Nov  7 09:55:34 [username] Notational Velocity[2780]: FILE WAS MODIFIED: zsh.txt
Nov  7 09:55:34 [username] Notational Velocity[2780]: FILE WAS MODIFIED: ||= ruby.txt
Nov  7 09:55:35 [username] Notational Velocity[2780]: load time: 9.40117, 
Nov  7 10:53:18 [username] Notational Velocity[2780]: error exchanging contents of temporary file with destination file katya nova.txt: -50
Nov  7 10:53:18 [username] Notational Velocity[2780]: Unable to save note file katya nova.txt
Nov  7 10:53:22 [username] Notational Velocity[2780]: error exchanging contents of temporary file with destination file katya nova.txt: -50
Nov  7 10:53:22 [username] Notational Velocity[2780]: Unable to save note file katya nova.txt
Nov  7 10:53:30 [username] Notational Velocity[2780]: FILE WAS MODIFIED: katya nova.txt
Nov  7 10:54:04 [username] Notational Velocity[2780]: error exchanging contents of temporary file with destination file katya nova.txt: -50
Nov  7 10:54:04 [username] Notational Velocity[2780]: Unable to save note file katya nova.txt
Nov  7 11:07:20 [username] Notational Velocity[2780]: verified 8822 notes in 0.283909 s
Nov  7 11:07:20 [username] Notational Velocity[2780]: error exchanging contents of temporary file with destination file Notes & Settings: -50
Nov  7 11:07:20 [username] Notational Velocity[2780]: Could not flush database, so not removing journal
Nov  7 12:22:03 [username] Notational Velocity[15397]: saw new disk UUID: DiskUUIDEntry(2017-11-07 20:22:03 +0000, [some uuid]) (other disks are: (
Nov  7 12:22:03 [username] Notational Velocity[15397]: WALStorageController: open error for file /Users/jesse_aldridge/Dropbox/notational_velocity_notes/Interim Note-Changes: File exists
Nov  7 12:22:03 [username] Notational Velocity[15397]: recoverNextObject can't even read (entire) log record header: File exists
Nov  7 12:22:05 [username] Notational Velocity[15397]: verified 8822 notes in 0.301844 s
Nov  7 12:22:05 [username] Notational Velocity[15397]: error exchanging contents of temporary file with destination file Notes & Settings: -50
Nov  7 12:22:05 [username] Notational Velocity[15397]: Unable to flush recovered notes back to database

@JesseAldridge
Copy link

JesseAldridge commented Nov 7, 2017

nvalt appears to be working if anyone else is in need of an immediate fix

@proksch
Copy link
Author

proksch commented Nov 7, 2017

This has been my solution too. Originally, I only wanted to bridge the time until the fix arrives, but by know I have really fallen in love with the Markdown preview. I just did not mention it here, because I thought it would be unfair to advertise other tools here. :)

@plinamatina
Copy link

Hi!
I also have a problem with Notational Velocity since I upgraded to High Sierra. Or at least I think it should have seomething to do with the upgrade although problems started about a day later. This is the issue: The programm keeps working and I can save notes etc. but all my old notes are gone! NV is completley empty and at first it kept giving me an error message saying it cannot intialise because the volume i wanted to use doesn't exist. The notes and settings file is new and empty and was moved to a "geo service" file. I can't find any file called "notational data" when I search my mac and also I can't find the old notes and settings file where my old notes should be.
What do you think, is there any hope to recover my old notes? That would be so great, seeing they were all gone was a real shock yesterday. As you maybe have noticed, I don't know much about computers and also english is not my mothertounge, but maybe there is still some hope? I'd be happy about every advice!!! :)

@plinamatina
Copy link

oh, problem solved. I just found out, that the original "notational data" file was hidden and once I found it I could link it to the programm again and now, all my notes are back. :D

@N0ury
Copy link

N0ury commented Nov 19, 2017

nvalt was the solution for me too. So removed Notational Velocity.

@JesseAldridge
Copy link

Here's another alternative, which places an emphasis on simplicity: https://github.com/JesseAldridge/tartar ;)

@mrp777
Copy link

mrp777 commented Dec 2, 2017

Will there be a update to NV (Zach seemed to imply there will be), or is the solution to switch over to nVALT?

@scrod
Copy link
Owner

scrod commented Dec 2, 2017

I haven’t gotten around to it yet, but I certainly plan to release an update soon.

@ghost
Copy link

ghost commented Dec 6, 2017

I have High Sierra installed on a non-SSD and NV is working fine. This error message only comes up for High Sierra using APFS.

I wish to stick with Notational Velocity instead of going with nvalt, so I'm looking forward to the upgrade. Thank you @scrod

@markdp123
Copy link

I've been using NV for a while and its fantastic. Designed for simplicity, speed and search-ability, all at once.

NV works fine on my iMac/ HighSierra (fusion drive) but has this same issue on my MacBookPro / High Sierra (SSD). I hope there's a patch soon, I'd like to keep using Notational Velocity on the OSX side.

@ghost
Copy link

ghost commented Jan 5, 2018

@scrod kindly update NV soon for SSD drives using HighSierra - thank you!

@bmhatfield
Copy link

Looks like the merge that fixes this issue has been on Master for a bit. Any chance of an updated build - from @scrod or someone else?

I tried nvalt, but it does not see any of the notes I added between then and now.

@rmf34
Copy link

rmf34 commented Mar 9, 2018

would love if someone could post an upgraded NV build, I can't build it on my system unfortunately.

@Hungor
Copy link

Hungor commented Mar 19, 2018

I had the same issue. I am now using nvALT. It is working.

@whereismyhat
Copy link

whew, just upgraded to high sierra and just lost a nice chunk of notes. is nvalt the only option here? what a bummer.

@dayone
Copy link

dayone commented May 7, 2018

echoing others - anybody able to post an upgraded NV build? Pretty please?

@ttscoff
Copy link
Collaborator

ttscoff commented May 7, 2018

@scrod this line (from nvALT code, sorry) turned out to be the primary bug with NV and APFS.

nvALT has incorporated APFS fixes, feel free to check the other commits from Sept of 2017. I'll do a pull request for you if I have time, but that's been short lately.

@jtbandes
Copy link
Contributor

jtbandes commented May 7, 2018

The issue has actually been fixed in this repo already back in September: #367 There just hasn't been a new build released.

@tiagodts
Copy link

Would anyone be so kind to post an upgraded NV build, for those of us who cannot build on their own? I appreciate

@Hungor
Copy link

Hungor commented May 15, 2018

Use nvALT if it is possible to build a new version.

@xaratustrah
Copy link

Moved to High Sierra. Now I also have the same problem, NV saying: Changed notes could not be saved because a parameter was invalid. :-(

@jonchui
Copy link
Contributor

jonchui commented Aug 2, 2018

FWIW, I've been on nvAlt Version 2.2.8 (128) (aka the fork https://github.com/ttscoff/nv/issues/) and it works fine on High Sierra APFS

Though i DO have it backed via simplenote, and DO notice it syncs/downloads from simplenote a lot

@thinkshank
Copy link

Forced to upgrade to high sierra and this is the first major (among other minor) bug that's annoyed me for the last 2 days.

@treasuretron
Copy link

oh dang, yeah just upgraded from Sierra to Mojave on my 12" Macbook and got the error as mentioned above. Any hope for folks looking to stay with regular NV? Thx.

@aleksip
Copy link

aleksip commented Nov 7, 2018

For a decent NV and nvALT drop-in replacement, at least until they get fixed, I recommend checking out FSNotes: https://github.com/glushchenko/fsnotes

@Hungor
Copy link

Hungor commented Nov 9, 2018

I think fsnotes is heavy and slow. I have purchased and found out that it is not as simple as nv or nvALT. I dropped it quickly and got back to nvALT.

@aleksip
Copy link

aleksip commented Nov 9, 2018

Just a note that a purchase is not necessary to try out FSNotes, it is MIT licensed open source and can be downloaded for free from the GitHub releases page.

I agree that FSNotes feels slightly slower than NV and nvALT, but after upgrading to Mojave and starting to use Dark Mode the UI of FSNotes feels much nicer to me and ultimately I considered that to be more important than raw speed. It is also well maintained and gets regular updates. But different people have different requirements and tastes, so your mileage may vary.

@nikcorg
Copy link

nikcorg commented Jan 6, 2019

Is this (wonderful!) project still alive? This issue has been fixed ages ago but the fix has remained unreleased for over a year.

@markdp123
Copy link

I’ve moved on to AltNV app instead.

@j256
Copy link

j256 commented Jan 7, 2019

Yeah just moved to nvAlt. http://brettterpstra.com/projects/nvalt/ It is a fork of NV with this problem fixed and other features.

@emxjay
Copy link

emxjay commented Jan 18, 2019

@scrod Any news on this? Some of us won't move to nvAlt 😄

(macOS Mojave • Version 10.14.2)

@seanPhill
Copy link

Notational Velocity Version 2.0 β5 (8)
has been working fine for me on High Sierra (including with APFS) all along.
I presume this might have been only a problem with the the β version of High Sierra?

@johshoff
Copy link

@seanPhill I'm seeing this problem on Version 2.0 β5 (8). Are you storing the notes as plain text files? That's required to reproduce the issue.

@seanPhill
Copy link

No, mine is in a Single Database, allow encryption. Never had a problem. I use it every day on High Sierra.

@oin
Copy link
Contributor

oin commented Aug 5, 2020

I compiled a version with a few fixes. Not tested a lot but the basics seem to work.

https://github.com/oin/nv/releases/tag/v2.0b6

@scrod
Copy link
Owner

scrod commented Aug 13, 2020

Hey, look at you! Someone actually compiled it. The dream of open source is still alive. (No offense; I truly appreciate anyone who works to change this project's unfortunately low ratio of contributions to complaints.)

@oin Would you mind submitting a pull request? I haven't had time to look at this project in a very long time, and the dark mode and openssl updates are helpful. Thanks!

@jtbandes
Copy link
Contributor

jtbandes commented Dec 3, 2020

@oin Were you planning to submit a PR with your changes? If not, I might have some time to make fixes on master, but I don't want to duplicate work.

@scrod
Copy link
Owner

scrod commented Dec 3, 2020

@jtbandes latest master branch commit reflects oin’s changes.

@jtbandes
Copy link
Contributor

jtbandes commented Dec 3, 2020

I see! So maybe no more immediate changes are needed :) Is this issue resolved then?

@oin
Copy link
Contributor

oin commented Dec 3, 2020

I'm not sure it's relevant here, but having used my fork intensely for a few weeks I witnessed duplicated and disappearing files. Again, I'm not sure it's related. I made some other changes in my fork (posterior to the commit here), and I was storing note files on an iCloud Drive folder on 10.14. However, it only occurred with NV. Not looking to have my issue fixed but I'm leaving this here for the record in case someone has similar issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests