ioBroker / ioBroker.node-red

Instantiate the server with node-red
Apache License 2.0
52 stars 27 forks source link

Version 3.3.0 second instance logs every deploy #305

Closed mickym2 closed 2 years ago

mickym2 commented 2 years ago

The multi instance version works fine - and I had now 2 instances node-red.0 and node-red.1. The first instance (node-red.0) works as expected, there are no changes.

The second instance (node-red.1) logs every deploy. In addition with a tail-node it seems that the log-file seems to be blocked somehow. So my request would be to cancel logging of a deploy as it works for the other instance.

Each time you deploy something in node-red.1 creates the following info:

`

node-red.1 | 2022-05-16 15:34:48.896 | info | Save /opt/iobroker/iobroker-data/node-red.1/flows.json -- | -- | -- | --

`

So it would be nice if this can be cancelled.

Apollon77 commented 2 years ago

Are you sure you maybe not increased logging in your other node-red instance? I find nothing on opur side

mickym2 commented 2 years ago

I do not know - where I should have specified this:

image image

Only instance no.1 generates these info messages when I press deploy:

image

Apollon77 commented 2 years ago

maybe in node-red itself?

mickym2 commented 2 years ago

I do not know where - so here are the settings.js of both instances. The logging part is identical. I also deactivates all flows in instance 1. So my main instance does not log deploys - the new instance 1 does. Even the standalone version does not create these messages.

So here are the settings.js files of both instances - I cant see any setting - which is responsible for theses messages: settings_js.zip

Apollon77 commented 2 years ago

This is the issue ... also code wise I do not see a difference ... :-(

mickym2 commented 2 years ago

Does it help to switch to debug for the 2nd instance? (node.red.1) - I also think that normally the output of the node-red system console is redirected to the iobroker log - so is there a possibility to see where the origin of the message is - from adapter or node-red?

Do I only have the problem or can this be reproduced by someone else?

It is not a fundamental issue - but it bothers that the log is filled with unnecessary infos (may be ok as debug level).

image

mickym2 commented 2 years ago

So i changed to debug level log.txt

`2022-05-27 21:44:56.262 - debug: node-red.1 (16354) 27 May 21:44:56 - [info] Geänderte Nodes werden gestoppt

2022-05-27 21:44:56.264 - debug: node-red.1 (16354) 27 May 21:44:56 - [info] Geänderte Nodes sind gestoppt

2022-05-27 21:44:56.279 - debug: node-red.1 (16354) 27 May 21:44:56 - [info] Geänderte Nodes werden gestartet

2022-05-27 21:44:56.280 - debug: node-red.1 (16354) 27 May 21:44:56 - [info] Geänderte Nodes sind gestartet

2022-05-27 21:44:56.833 - info: node-red.1 (16354) Save /opt/iobroker/iobroker-data/node-red.1/flows.json`

The 4 debug messages that Nodes were stop and started - are messages from Node-Red. Those I know also from the standalone version. But the info message must have its origin within the adapter.

I can change level to warn - but I don't understand why the second instance behaves different to the first instance.

Apollon77 commented 2 years ago

Also ja die Save /opt/iobroker/iobroker-data/node-red.1/flows.json` kommt vom Adapter ... aber ist das gleiche bei der normalen instanz. Gibt es das File bei dir?

Der liest das File regelmäßig und speichert es in einem Objekt. Das sind die flows.json und die flows_cred.json die er da nimmt. Das Log würde höchstens nicht kommen wenn es kein flows.json gäbe ... Vergleicht da mal die beiden Instanzen.

mickym2 commented 2 years ago

Klar gibt die Datei - dort werden ja alle Flows gespeichert. Dir flows_cred.json gibts bei mir noch nicht, da ich keine Credentials in der Testinstanz habe. ;)

image

Wie gesagt funktioniert ja auch alles - ich will ja nur diese Meldungen weg haben. ;)

Apollon77 commented 2 years ago

hm ... legst DU die cred bitte testweise mal an? SOllte zwar nichts ändern aber als Versuch .... also von daher verstehe ich eher nicht warum es bei dir bei der ersten Instanz nicht auch kommt

mickym2 commented 2 years ago

Die lege ich nicht selbst an - aber ich kann mal den Zugriff auf den mqtt Broker konfigurieren und dann wird die credential Datei automatisch erstellt.

image

Macht aber keinen Unterschied - die info Meldung kommt immer noch:

Apollon77 commented 2 years ago

Ja wie gedacht ... ich wundere mich das sie bei deiner ersten Instanz nicht kommt

Apollon77 commented 2 years ago

Could it be that you use "warn" as loglevel for your first instance and so just do not see the info logs?

mickym2 commented 2 years ago

Also bei der 1. Instanz ist das noch nie gekommen.

Could it be that you use "warn" as loglevel for your first instance and so just do not see the info logs?

  • No it is also info level.

The difference between the productive instance (node-red.0) is that a project function is used and other directories. Before adapter version 3.3.0 it was not possible to have multiple instances - and I never saw these messages before in any of the adapter versions before - may be as no second instance was possible.

Here are the same screenshots as above of the productive instance node-red.0

image image

mickym2 commented 2 years ago

I also switched on the option "Erstellung von Fremd-Objekten zulassen" - but no difference.

Apollon77 commented 2 years ago

Das ist es ja ... Also am Ende könnte das nur heissen das das "File Change Detection" Feature bei deiner Haupt-Instanz nicht tut und keine Änderung erkennt ... ... ... wäre höchstens die Frage ob sich bei dir das Objekt aktualisiert wenn du neu deployest in node-red ...also "keine Meldung aber das Objekt bekommt trotzdem nen neuen "ts".

Gemeint ist das "node-red.X.flows" Objekt ...

mickym2 commented 2 years ago

image

Nun der Unterschied ist vielleicht auch, da ich die Projektfunktion nutze - wird in der Hauptinstanz ja nicht im node-red Verzeichnis direkt geschrieben, sondern in den Projektverzeichnissen unten drunter. Aber natürlich ändert sich der Zeitstempel nach einem Deploy der flows.json - sonst würden meine Änderungen an einem Flow ja nicht gespeichert. Im Hauptverzeichnis gibt es zwar auch noch eine flows.json - die wird aber nicht mehr angefasst - das ist quasi die, die beim Erstellen des Projektes kopiert wurde.

image

Das will ich nun auch nicht ändern. Mir geht es ja auch eigentlich nicht darum, diese Meldung zu bekommen, sondern ob man die nicht auf debug level drücken kann. Sie bringt doch keinen Mehrwert und jede Änderung Deines Flows im Log zu dokumentieren, halte ich nicht für sinnvoll. Die Projektfunktion nun bei der Testinstanz einzuschalten, will ich aber auch nicht. Da gibts ja auch noch ein offenes Issue von mir. Wenns nicht geht, werde ich halt die 2. Instanz auf warn umschalten.

Apollon77 commented 2 years ago

OPk, das macht sinn, ich ändere auf Debug

Apollon77 commented 2 years ago

3.3.1 soon

mickym2 commented 2 years ago

Thanks - it works!