So the issue as I see it was.

Logged in as my username (andyr) on my server then:
tiddlywiki testwiki --init server

generates the error:
Error: Error creating directory 'testwiki'

So I then used sudo to run as root:
sudo tiddlywiki testwiki --init server

This then works as it has the permissions it needs.

Then when I run the listen:
tiddlywiki testwiki --listen

it doesn't have the permission to create tiddler file as testwiki folder is 
owned by root, so it errors with:
Sync error while processing save of '$:/StoryList': Error: ENOENT: no such 
file or directory, open 
'/var/www/html/locationdata.uk/public_html/testwiki/tiddlers/$__StoryList.tid'

So I manually created the tiddlers sub folder (as andyr) and re-ran:
tiddlywiki testwiki --listen

It works fine and save the tiddlers as it goes because tiddlywiki is 
running as andyr.

However, when I run it with *forever *it runs as a different user and so 
doesn't have access to the tiddlers folder as that was set to write only 
for andyr. The errors are getting sent to obscure log file which I didn't 
find until I realised my mistake.

So my personal view is that TW cant legislate for the user and permissions 
structure that has been set up on a particular Linux instance.

However I think two things would help:
* an example in the docs of using nodejs running as a service so that it is 
always available - for example in this thread PM2 has been suggested as a 
better solution than forever
* a sync error visible in the TW client if the server is unable to save. 
This could occur for a variety of reasons - permissions (as in my case), 
lack of server disk space, server disk write error. Knowing that your data 
was unsaved you could then take action to resolve the issue after first 
securing your data 

I fully appreciate that the exact nature of "why" there was an error was my 
fault, but having a little fault tolerance so server disk failures are 
available to the client side.

Andy

PS I'm not running Linux as a desktop environment so I'm not sure that 
I3WMsi relevant or am I missing something?


On Sunday, May 10, 2020 at 12:05:57 AM UTC+1, Mark S. wrote:
>
> If you run without "forever" does it run OK? I just launch from a command 
> line or an I3WM menu. 
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/ddb9865a-3fa2-46d3-894e-af352d7c0989%40googlegroups.com.

Reply via email to