btrask / stronglink

A searchable, syncable, content-addressable notetaking system
Other
1.04k stars 45 forks source link

Assertion failure during sync #113

Closed clehner closed 8 years ago

clehner commented 8 years ago

starting the server:

stronglink (master)@cel$ stronglink res
2016-06-12T03:32:17Z (pull debug setup failed: Database item not found)
2016-06-12T03:32:17Z StrongLink server running at http://localhost:8000/

syncing:

stronglink (master)@cel$ ./client/node-sln-client/examples/sln-pipe https://bentrask.com main
[...]
~hash://sha256/8f51f1789b5276f1a464343977340b1f8d3b0fff689201959a3afcf911b3d807
~hash://sha256/73c235a4e6f76ab8a8acd1010ca53168456550be6731dc0500f48e2b8f8ec11f
~hash://sha256/1c72377333f679c935923cdd6fc0ad4872ccdc48ee815abe5252e8ff34ef992e
~hash://sha256/642a78c70251b23be43303e92f29eb5054368f559b4581e32b707f1a300e44ea
/usr/local/src/stronglink/client/node-sln-client/examples/sln-pipe:105
                if(err) throw err;
                        ^

Error: read ECONNRESET
    at exports._errnoException (util.js:870:11)
    at TCP.onread (net.js:544:26)

the server has crashed:

stronglink: src/SLNSession.c:142: SLNSessionDBClose: Assertion `session' failed.
Aborted (core dumped)

my ~/.config/stronglink/client.json:

{
        "repos": {
                "main": {
                        "url": "http://localhost:8000/",
                        "session": "zxcizocijzlkadkalds"
                }
        }
}
btrask commented 8 years ago

The session key in your client.json file is incorrect. It looks like you put in a password rather than a session key. You need to log in via a browser (with the username and password) and then get the session key that was set as a cookie.

For example, via the Firefox inspector I see: Cookie: s=1:c06aa5e105daafcb305bfbb4017ff2c0

So my client.json would be:

{
        "repos": {
                "main": {
                        "url": "http://localhost:8000/",
                        "session": "1:c06aa5e105daafcb305bfbb4017ff2c0"
                }
        }
}

The assertion failure is a bug. I will look into it. Thanks for reporting, and sorry for the trouble!

btrask commented 8 years ago

The assertion failure should be fixed in 3e5daadafd222f5bc028847857f852fa733da3e8. Let me know how the session key goes.

clehner commented 8 years ago

Got it, thanks. I wasn't sure what to put in session - I assumed it was a shared secret (I didn't read the readme closely enough). After putting in session from the cookie, sln-pipe looks like it is working.

btrask commented 8 years ago

Great, thanks for trying it out! Curious to hear your thoughts.