standardnotes / syncing-server

[Deprecated: Use our new Node server: https://github.com/standardnotes/syncing-server-js]
https://standardnotes.org
GNU Affero General Public License v3.0
209 stars 48 forks source link

Unable to sync notes #162

Closed SuppenGeist closed 3 years ago

SuppenGeist commented 3 years ago

Hey, I use the command docker run --net=host -d --env-file=.env standardnotes/syncing-server:stable to start my sever and my .env file looks like this

RAILS_ENV=production
PORT=3500
# Database Settings
DB_PORT=3306
DB_HOST=127.0.0.1
DB_DATABASE=standardnotes
DB_USERNAME=standardnotes
DB_PASSWORD=...

SECRET_KEY_BASE=...
DISABLE_USER_REGISTRATION=true

In the web app (app.standardnotes) I can login, but after that nothing happens. It says "loading notes..." but nothing happens. In the development console, I get the error

Error: No associated key found for item encrypted with latest protocol version.
    at ar.keyToUseForDecryptionOfPayload (app-b3a740d01f8b71353a54f8ac4c9fd312e359784f4a4918e8c9b08bc2f29de6fc.js:3)
    at ar.payloadByDecryptingPayload (app-b3a740d01f8b71353a54f8ac4c9fd312e359784f4a4918e8c9b08bc2f29de6fc.js:3)
    at Nr.handleSuccessServerResponse (app-b3a740d01f8b71353a54f8ac4c9fd312e359784f4a4918e8c9b08bc2f29de6fc.js:3)
    at async xr.receiver (app-b3a740d01f8b71353a54f8ac4c9fd312e359784f4a4918e8c9b08bc2f29de6fc.js:3)
    at async xr.run (app-b3a740d01f8b71353a54f8ac4c9fd312e359784f4a4918e8c9b08bc2f29de6fc.js:3)
    at async Nr.sync (app-b3a740d01f8b71353a54f8ac4c9fd312e359784f4a4918e8c9b08bc2f29de6fc.js:3)
    at async Nr.downloadFirstSync (app-b3a740d01f8b71353a54f8ac4c9fd312e359784f4a4918e8c9b08bc2f29de6fc.js:3)

I recently updated my account to the new enctyption version.

jelkose commented 3 years ago

Hey @SuppenGeist, I think You're experiencing the same issue I've had in #160, also after updating the encryption version. I've resolved this by restarting the app (I'm using the desktop app, but it should work for the web app also) and reimporting my backup to my account which was empty after restart.

Regards, Jelko

SuppenGeist commented 3 years ago

Unfortunately, this does not work for me.

moughxyz commented 3 years ago

When did you first configure your server, and when's the last time you pulled in the latest version?

SuppenGeist commented 3 years ago

The server was last updated(and first configured) around 16th Sep'2020. But I used the web app to connect to it and perform the account upgrade. Whats strange to me is that the web app suggested this account upgrade even though i would assume that the server did not provide such, since I did not update it for a long time.

But as a fix I will set up a completly new database. I suppose the current database was corrupted in some way. Because I can login and it is also displayed how many notes I have. But loading the notes and add-ons fails.

bengladwell commented 3 years ago

I also had this issue. Unfortunately I was not able to restore from backups. The apps and syncing-server would talk happily to each other and sync notes. But when I imported the backup, the syncing process could not complete. I wasn't able to find a helpful error on the server side. On the client side, the syncing spinner would spin indefinitely.

My syncing-server was running master branch from a couple of years ago, so no one to blame but myself. :) I have since upgraded and am running off of a tagged version branch.

I had to solve my problem by re-adding my notes one by one. I have around 15 notes, so it was frustrating, but doable. I yanked the text of the individual backups (encrypted) like so:

cat Standard\ Notes\ Backup\ and\ Import\ File\ txt.txt | jq '.items[8].content.text' | perl -p -e 's/^"(.+)"$/$1/' | perl -p -e 's/\\n/\n/g' | perl -p -e 's/\\t/\t/g | perl -p -e 's/\\"/\"/g'

That pulls the text of a single note. Change the index on .items[8] to get a different note.

karolsojko commented 3 years ago

Hi guys,

we've announce this on our community Slack some time ago:

for all of you self-hosting using Docker we switched the tags a bit for a smoother experience. If you’re using the standardnotes/syncing-server:stable image please switch to standardnotes/syncing-server or standardnotes/syncing-server:latest (same thing). Although the stable tag will still be available, it will no longer be populated with newer releases.

Please switch to a respective tag