scrod / nv

Notational Velocity: modeless, mouseless Mac OS X note-taking application
http://notational.net
GNU General Public License v3.0
2.07k stars 405 forks source link

Incompatibility with High Sierra? APFS? #365

Open proksch opened 7 years ago

proksch commented 7 years ago

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 commented 7 years ago

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

scrod commented 7 years ago

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

Thanks.

proksch commented 7 years ago

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 commented 7 years ago

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:

scrod commented 7 years ago

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 commented 7 years ago

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

jtbandes commented 7 years ago

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 commented 7 years ago

Hi Jacob,

The easiest approach is probably the one I mentioned. You can feel free to submit a patch if you like; otherwise I'll just do it myself.

Zach

On Sep 3, 2017, at 11:35 PM, Jacob Bandes-Storch notifications@github.com wrote:

t 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?

jtbandes commented 7 years ago

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

jtbandes commented 7 years ago

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

https://github.com/scrod/nv/blob/5b1e4fdd2c1134724d24f06139357e43a8c652f8/FSExchangeObjectsCompat.c#L26

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 commented 7 years ago

Jacob,

Thanks so much for looking into it! This will certainly save me some time.

Zach

On Sep 4, 2017, at 12:52 AM, Jacob Bandes-Storch notifications@github.com wrote:

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).

https://github.com/scrod/nv/blob/5b1e4fdd2c1134724d24f06139357e43a8c652f8/FSExchangeObjectsCompat.c#L26 https://github.com/scrod/nv/blob/5b1e4fdd2c1134724d24f06139357e43a8c652f8/FSExchangeObjectsCompat.c#L26 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 https://developer.apple.com/documentation/foundation/nsurlvolumesupportsswaprenamingkey).

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/scrod/nv/issues/365#issuecomment-326871873, or mute the thread https://github.com/notifications/unsubscribe-auth/AAHjveSR7VnfoHGQzIiIX6QyhMVn69zzks5se5ASgaJpZM4Omhe5.

JesseAldridge commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

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

proksch commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

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

JesseAldridge commented 7 years ago

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

mrp777 commented 6 years ago

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

scrod commented 6 years ago

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

ghost commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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

bmhatfield commented 6 years ago

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 commented 6 years ago

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

Hungor commented 6 years ago

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

whereismyhat commented 6 years ago

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

dayone commented 6 years ago

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

ttscoff commented 6 years ago

@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 commented 6 years ago

The issue has actually been fixed in this repo already back in September: https://github.com/scrod/nv/pull/367 There just hasn't been a new build released.

tiagodts commented 6 years ago

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

Hungor commented 6 years ago

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

xaratustrah commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 5 years ago

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

markdp123 commented 5 years ago

I’ve moved on to AltNV app instead.

j256 commented 5 years ago

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

emxjay commented 5 years ago

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

(macOS Mojave • Version 10.14.2)

seanPhill commented 5 years ago

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 commented 5 years ago

@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 commented 5 years ago

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

oin commented 4 years ago

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 commented 4 years ago

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!