ioBroker.javascript icon indicating copy to clipboard operation
ioBroker.javascript copied to clipboard

filesync only in one direction

Open MeisterTR opened this issue 5 years ago • 6 comments

if i cange a file in frontend, the change is directly in vs, if i change a file in vs No changes are accepted.

if its important mounted a nfs storage for the scripts

2020-08-16_09h05_34

MeisterTR avatar Aug 16 '20 07:08 MeisterTR

Please provide debug log from js adapter for the relevant change. And please use most current version of js from latest because we had many fixes in the last versions.

Apollon77 avatar Aug 16 '20 08:08 Apollon77

when i save the file form VS nothing is shown in the log, when i save in gui this is shown:

2020-08-16 20:43:08.731 - debug: javascript.0 (19352) sendTo "loadTypings" to system.adapter.admin.0 from system.adapter.javascript.0

2020-08-16 20:43:24.226 - debug: javascript.0 (19352) Update /var/scripts/Licht/Auto_garten.js on disk 2020-08-16 20:43:24.233 - info: javascript.0 (19352) Stop script script.js.Licht.Auto_garten 2020-08-16 20:43:24.234 - debug: javascript.0 (19352) File /var/scripts/Licht/Auto_garten.js change 2020-08-16 20:43:24.245 - info: javascript.0 (19352) Start javascript script.js.Licht.Auto_garten 2020-08-16 20:43:24.250 - debug: javascript.0 (19352) sendTo "send" to system.adapter.telegram.0 from system.adapter.javascript.0 2020-08-16 20:43:24.252 - info: javascript.0 (19352) script.js.Licht.Auto_garten: registered 2 subscriptions and 0 schedules

i'm on the latest. FS is Ubuntu20.xx

MeisterTR avatar Aug 16 '20 18:08 MeisterTR

How the nfs mount is looking exactly? best show output of "mount" command.

The adapter uses fs.wtch from nodejs.

The Log from above shows that it works in general because this comes from the fs change listener:

2020-08-16 20:43:24.234 - debug: javascript.0 (19352) File /var/scripts/Licht/Auto_garten.js change

Apollon77 avatar Aug 16 '20 21:08 Apollon77

From nodejs docs: If the underlying functionality is not available for some reason, then fs.watch() will not be able to function and may thrown an exception. For example, watching files or directories can be unreliable, and in some cases impossible, on network file systems (NFS, SMB, etc) or host file systems when using virtualization software such as Vagrant or Docker. :-(

Apollon77 avatar Aug 16 '20 21:08 Apollon77

I think it is simply not supported by NFS to forwards file changes as inotofy chnages :-(

Apollon77 avatar Aug 16 '20 21:08 Apollon77

Of course we can implement poll, e.g every 10 seconds... But will it work?

GermanBluefox avatar Sep 21 '20 05:09 GermanBluefox