cs150bf / ever-notedown

Atom Editor Plugin
MIT License
140 stars 13 forks source link

Sync Error #11

Open ndland opened 9 years ago

ndland commented 9 years ago

I'm getting a weird issue, and I'm not sure why it's happening. I'm able to create a new note, and I'm able to sync it no problem. After the note is synced, I can make a single change in Ever notedown, and I I'm able to sync that change to Evernote. However, after that I get an error that says Evernote is failing to sync the note that I've just created with Ever notedown. Please see the image below:

evernote_sync_issue

So far, the only way to get around this, has been to clear the evnd folder, and start from the beginning again. I've tested this multiple times, and every time yields the same results. Any ideas?

cs150bf commented 9 years ago

Hi @ndland , would it be possible for you to try the following?

  1. Try syncing again
  2. Open "Help-->Activity Log" in Evernote, hopefully you will see some relevant info about the syncing error, most likely something that says "content is illegal"... look for the keyword underlyingError
  3. Copy the relevant part of log (and black out personal/sensitive information) and paste it here (or email me if you prefer)

If it's about illegal content, then my guess is there are some invalid element (links). Here's a snippet of error log that I saw when encountering this sync error myself:

2015/**/** 21:19:16:435 I|* __31-[ENSyncEngine serverSyncState]_block_invoke | sessionCount=0
2015/**/** 21:19:16:516 I|* -[ENSyncEngine _synchronizeAccountsWithIds:processServerChanges:processLocalChanges:] | Synchronizing shared notes
2015/**/** 21:19:16:571 E|*** -[ENAccountContext syncEngineDidFailWithErrors:] | NSConcreteNotification 0x7fbfe60a2760 {name = ENSyncEngineDidFailWithErrorsNotification; object = <ENSyncEngine: 0x**********>; userInfo = {
errors = (
"Error Domain=ENSyncEngineErrorDomain Code=-2000 \"The content is invalid.\" UserInfo=0x********** {underlyingError=EDAMUserException(errorCode:11,parameter:\"Error processing document: Invalid a href attribute:super-random-link\"), NSLocalizedFailureReason=Could not sync note \U2018Copy of Ever Notedown TODO List\U2019., localObjectID=0x21880006b <x-coredata://**********/ENNote/p2146>, NSLocalizedDescription=The content is invalid.}"
);
}}
2015/**/** 21:19:16:571 I|* -[ENAccountContext syncEngineDidStop:] |
2015/**/** 21:19:16:571 I|* -[ENCacheManager startWithBackground:] | self=<ENCacheManager: 0x7fbfdebc3790>
2015/**/** 21:19:16:572 I|* -[ENSyncEngine _syncStoppedWithErrors:

Highlight on the part of {underlyingError=EDAMUserException(errorCode:11,parameter:\"Error processing document: Invalid a href attribute:super-random-link\").

There are a few possible causes that I can think of:

  1. Some special characters in headers or footnotes (and therefore invalid links in generated TOC/footnotes)
  2. Some invalid links (in markdown syntax []())

I tried something to prevent those types of illegal a href elements from happening, but it's far from failure-proof. If we know precisely what's causing problem for you, we can see what we can do... (It shouldn't be too hard to fix).

ndland commented 8 years ago

I noticed that there was an update when I came in this morning. As a result I'm seeing slightly different behavior. I have not yet been able to duplicate the sync error that I was getting before, I've replicated the steps that I had done previously. However, I am still having trouble when it comes to updating the original file in Atom. Here is what I've done

After I've updated the file the second time and tried to sync, I get nothing from the plugin, and the file with the updates has not been synced to EN. I noticed that the icons have changed colors:
screen shot 2015-08-03 at 11 56 54 am
Hopefully that will give some kind of indication as to what is happening.

cs150bf commented 8 years ago

I cannot reproduce this error. Would it be possible for you to check the Atom log when you encounter this problem? (From the menu bar, View -> Developer -> Toggle developer tools, or alt + cmd + i). Hopefully there will be some highlighted error message from EVND.

ndland commented 8 years ago

Ok, This is interesting. I've taken a few screenshots:

screen shot 2015-08-04 at 9 06 45 am screen shot 2015-08-04 at 9 07 12 am

Not that it should matter, but I do have my .atom directory symlinked.

cs150bf commented 8 years ago

The symlinked .atom directory might actually be relevant. I have a hard time figuring out how to interact with file system & incorporate git properly. And I probably failed to resolve the git repo path somehow.

I changed a few minor things in recent commits but I don't really think that would fix anything for you. The extra log message (console.log "@gitRepo.getPath(): #{@gitRepo?.getPath()}") could help me, though.

Or, could you please check your evnd/index.json for me? In particular, I wonder what the enExportedFiles, dir, and path for this particular problematic note are? I expect exExportedFiles to be an array of real, complete paths. If that's not the case, then I have a rough idea what might have gone wrong.

For example, a segment of my index.json looks like this:

    "[Note ID: 99cd073e14285dbd6aad99d3615e5c96]": {
        "creationTime": "2015-05-03 17:18:19",
        "enCreationDate": "20150503T172055",
        "lastSyncDate": "20150703T200228",
        "enModificationDate": "20150703T200228",
        "modificationTime": "2015-07-03 20:02:25",
        "metaDate": null,
        "dir": "20150503/",
        "path": "/Users/myName/Dropbox/evndNotes/20150503",
        "title": "EVND (Ever Notedown) Demo - Help Document (Draft)",
        "noteLink": "evernote:///view/1983******/s68/********************/********************/",
        "tags": [
            "demo",
            "evnd",
            "testing"
        ],
        "notebook": {
            "name": "EVND Demo",
            "type": "synchronized"
        },
        "enExportedFiles": [
            "/Users/myName/Dropbox/evndNotes/20150503/evnd_(ever_notedown)_help_evernote.html/",
            "/Users/myName/Dropbox/evndNotes/20150503/evnd_(ever_notedown)_help_evernote.enex"
        ],
        "format": "Markdown",
        "fnStem": "evnd_(ever_notedown)_help",

(In this case, my .atom directory is not symlinked, but I did have .atom/evnd/ linked to /Users/myName/Dropbox/evndNotes/)

ndland commented 8 years ago

Sorry, I've been pretty busy over the last couple of weeks, I still have had no luck with syncing the note after more than one edit. I saw that there was some updates, but still no avail. Looking at my index.json Looks like the enExportedFiles are displaying the correct path. I'm not sure what the deal is. I haven't tested using an un-symlinked .atom/ but I find it hard to believe that's what causing the issue at this point.