Losing Multiple Versions On Server Restart - node.js

111 views
Skip to first unread message

Kevin Kleinfelter

unread,
Sep 2, 2019, 4:38:32 PM9/2/19
to TiddlyWiki
I'm running multiple node.js tiddlywikis.  Twice in the last few days I've lost some data.  I need help to improve my operating practices!

The symptom is that I have lost the last 2-3 edits to a tiddler.  I've been mostly editing the same long tiddler.  I've had a need to reboot my Linux server, so I connected to it via ssh and issued 'sudo reboot'.

My Tiddlywikis generally push their updates to the server within a few seconds.  I have no reason to believe that didn't happen on these occasions.

Due to the server restart, I've received the failed-to-sync message for the skinny tiddler list.  I refresh the browser page. That's when I discover that the tiddler I've been editing off and on all day has reverted back 2-3 editions.  Ouch!

Can someone please walk me through the steps (at the elementary lever) to ensure that I don't lose node.js TW data when I restart my server?  Maybe it is something like this?
  1. Check each browser tab with a Tiddlywiki.  Confirm that the save icon is NOT red.
  2. ps -ef | grep node | grep tiddly

  3. sudo reboot

Do I need to specifically shut-down the node processes which are running TiddlyWiki?  (I have other node.js running too.)
Do I need to send a SIGHUP to the node processes?

TIA

Kevin Kleinfelter

unread,
Sep 2, 2019, 5:06:53 PM9/2/19
to TiddlyWiki
It just happened again. 
  • I specifically checked to be sure the save icon went from red to gray.  
  • Then I opened the tiddler and copied it to the clipboard.
  • Then I went to the server and issued 'sudo reboot'.
The wiki came up with a multiple versions old edition of that tiddler.  I opened the tiddler and pasted in my clipboard to restore.

What's happening here?  I really need my wiki not to forget edits!

TonyM

unread,
Sep 2, 2019, 11:07:12 PM9/2/19
to TiddlyWiki
Kevin,

I do not necessarily have the skills to help but are you using vanila node and what platform? presumably a linux flavor.
  • Could you have the same wiki open in more than one window/tab/browser? so latest tiddler save wins?
  • The Bob versions help combat multi-access issues, bob.exe is very easy to use (but may be awaiting 5.1.20)
  • If you have a link to such wikis you may consider using a link that includes the target=wikname so that every time you click on the link it opens in the save window/tab, presumably you have autosave to immediately save changes?
In some single file wikis, I have not looked at on node yet, you could use 5.1.20's local storage plugin to save changes locally, pending the wiki save.

Regards
Tony

Kevin Kleinfelter

unread,
Sep 3, 2019, 8:47:13 AM9/3/19
to tiddl...@googlegroups.com
Thank you for your reply.  Good suggestions.

Yes, plain vanilla node on Ubuntu 18.04.  Definitely editing in exactly one browser tab.  Not using Bob.  $:/config/AutoSave says yes.

I've put the whole wiki into git and set up gitwatch saving on a 60-second interval.  If I can just figure out how to get git to tell me what change happened when, at least I'll have the sequence of events.  Either the changes aren't making it to the server or they're getting overwritten.  If I can tell which, then I can start working to correct it.


Kevin Kleinfelter

unread,
Sep 3, 2019, 9:20:42 AM9/3/19
to tiddl...@googlegroups.com
I just now made a change to a Tiddler.  I copied the tiddler body to the clipboard and saved the Tiddler.
Then I waited 2 minutes, I went to the server and killed the node process.  
The file for the tiddler I just updated has a timestamp of Aug 22 21:32.  Today is September 3.
"git log -- FILENAME_HERE" shows no updates to the file since August 22.

Then I restarted node.
I re-loaded the page in the browser, and it is missing all recent edits.
I edited the tiddler and pasted the contents from the clipboard.
ls -l on the file on the server still shows August 22.
But I reloaded the page in the browser and it has the pasted contents.
I then loaded the page in an incognito browser and it too has the pasted contents, so the changes got saved somewhere.

It looks like my changes are getting cached in node but not written to disk.  That's why I can successfully reload the page before a node restart, but not after.

What can I look at to see why my node process is not persisting changes to disk?  There it is.  Apache error.log:

Sync error while processing 'Boxtop3 Configuration Management 2018':

Error: EACCES: permission denied, open '/data/tiddlywiki-sites/tw-node/pkb/tiddlers/Boxtop3 Configuration Management 2018.md'


Clearly I broke my permissions recently.

Jeremy Ruston

unread,
Sep 3, 2019, 1:20:22 PM9/3/19
to tiddl...@googlegroups.com
Hi Kevin

I’m sorry you’ve run into problems. It’s not obvious what’s going on, but I was going to suggest two tips for debugging:

* In the browser, use the developer console “network” tab to see each individual tiddler being saved. You’ll see any error messages received from the server, and be able to see if an edit such as the one described here is hitting the server
* On the server, use the —verbose command before —listen to switch on logging. You’ll be able to see a log as each individual file is saved/deleted

It’s possible that observing those two logs while performing experiments like the one below might let us narrow things down a bit.

Best wishes

Jeremy


On 3 Sep 2019, at 14:20, Kevin Kleinfelter <kleinfelt...@gmail.com> wrote:

I just now made a change to a Tiddler.  I copied the tiddler body to the clipboard and saved the Tiddler.
Then I waited 2 minutes, I went to the server and killed the node process.  
The file for the tiddler I just updated has a timestamp of Aug 22 21:32.  Today is September 3.
"git log -- FILENAME_HERE" shows no updates to the file since August 22.

Then I restarted node.
I re-loaded the page in the browser, and it is missing all recent edits.
I edited the tiddler and pasted the contents from the clipboard.
ls -l on the file on the server still shows August 22.
But I reloaded the page in the browser and it has the pasted contents.
I then loaded the page in an incognito browser and it too has the pasted contents, so the changes got saved somewhere.

It looks like my changes are getting persisted in one place while node is active, and loaded from another place after a node restart.

--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/d7e76685-bcd9-4d7f-bbac-7e53cd8b8281%40googlegroups.com.

Donald Coates

unread,
Sep 3, 2019, 11:31:39 PM9/3/19
to TiddlyWiki


 

Clearly I broke my permissions recently.

Man I feel like this is the problem 80% of the time but I still always come around to it later rather than sooner. 

Arlen Beiler

unread,
Sep 9, 2019, 1:30:10 PM9/9/19
to TiddlyWiki
A few questions. 

In your wiki, open control panel, then go to the plugins tab. Please tells us which plugins are enabled. Several of us work with the TiddlyWiki core code so we know which plugins should be enabled in this situation and which might cause conflicts.

Enable logging like Jeremy said.

While we're trying to figure this out, make sure that you are not listening on address 0.0.0.0. While you are trying to figure this out, you should specify either localhost (127.0.0.1) or a specific IP address, and then type that specific address into your address bar every time you access the wiki, even if you're doing it on the same computer. If this fixes the problem, it means there is a second NodeJS process running that is somehow listening on certain addresses on the server or receiving some requests that are meant to go somewhere else. 

It seems like you're doing everything as usual, and since the Node process being killed also causes this problem, that should rule out an OS problem.

On Tue, Sep 3, 2019 at 11:31 PM Donald Coates <digit...@gmail.com> wrote:


 

Clearly I broke my permissions recently.

Man I feel like this is the problem 80% of the time but I still always come around to it later rather than sooner. 

--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.

Arlen Beiler

unread,
Sep 9, 2019, 1:32:14 PM9/9/19
to TiddlyWiki
Nothing happens on server shutdown. You should be able to kill it without losing anything as long as the Node process has finished writing to disk, which is normally instantaneous. 
Reply all
Reply to author
Forward
0 new messages