Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reconnect disconnected server #15

Open
jdsdc opened this issue Jun 14, 2021 · 12 comments
Open

Reconnect disconnected server #15

jdsdc opened this issue Jun 14, 2021 · 12 comments

Comments

@jdsdc
Copy link

jdsdc commented Jun 14, 2021

Environment

DGLux 5, Revision 9012
Niagara 4.9
DgApi 1.06
Windows 10

Recreate error

  1. Stop Niagara station
  2. Restart DGLux Server
  3. Start Niagara station
  4. No reconnection to Niagara station (First error!)
  5. Restart dgApi
  6. Reconnects to Niagara station
  7. Value of type numeric writable is not updated (Second error!)
  8. Restart dgApi
  9. Value of type numeric writable is updated

To conclude, it seems like errors occur when the server is restarted and a Niagara station is offline. Then dgApi
needs to be restarted to reconnect. But some values are note updated. So another restart of dgApi is needed.

** Stability **

If there is an automatic restart of the dgLux service we cannot trust dgApi to reconnect to stations and update values
correctly. Which leads to need of additional monitoring to see if all stations are connected or not.

It would be a huge help to be able to trust that stations are reconnected if server is restarted.

Additional:

Definition of property in station, oBIX format

<obj name="Link" href="local:|foxs:|station:|h:1e7/Link/" is="def/baja:Link def/baja:Relation" display="Indirect: h:1f1.out -&gt; slot:/System/LB01/JD$2dRandom.in10" icon="/ord?module://icons/x16/link.png"> <uri name="sourceOrd" val="h:1f1" href="local:|foxs:|station:|h:1e7/Link/sourceOrd/" displayName="Source Ord" writable="true"/> <str name="sourceSlotName" val="out" href="local:|foxs:|station:|h:1e7/Link/sourceSlotName/" displayName="Source Slot Name" writable="true"/> <str name="targetSlotName" val="in10" href="local:|foxs:|station:|h:1e7/Link/targetSlotName/" displayName="Target Slot Name" writable="true"/> <bool name="enabled" val="true" href="local:|foxs:|station:|h:1e7/Link/enabled/" displayName="Enabled" writable="true"/> </obj>

Added station backup as attachment.
backup_dgluxtest_210617_1340.zip

@rinick , @ilyatsarev

@ilyatsarev
Copy link

@jdsdc please update to the latest DGAPI dslink version 1.0.8 and confirm the issue is still present.
Use update from the repository or download the latest zip on this page for an update from zip.

@jdsdc
Copy link
Author

jdsdc commented Jun 30, 2021

@jdsdc please update to the latest DGAPI dslink version 1.0.8 and confirm the issue is still present.
Use update from the repository or download the latest zip on this page for an update from zip.

@ilyatsarev , i updated dgApi. But I have one problem. It seems like the new version can't read the existing nodes.json

[2021-06-30 23:17:47.799775] Unhandled exception: [2021-06-30 23:17:47.799775] FormatException: Bad UTF-8 encoding 0x92 [2021-06-30 23:17:47.799775] #0 _Utf8Decoder.convert (dart:convert/utf.dart:558) [2021-06-30 23:17:47.799775] #1 Utf8Decoder.convert (dart:convert/utf.dart:349) [2021-06-30 23:17:47.799775] #2 Utf8Codec.decode (dart:convert/utf.dart:66) [2021-06-30 23:17:47.799775] #3 SimpleNode.decryptString (package:dslink/src/responder/simple/simple_node.dart:720:26) [2021-06-30 23:17:47.799775] #4 DgApiNodeProvider.init (file:///C:/dsaserver/dsa/dglux-server/dslinks/dgapi/lib/node_provider.dart:314:31) [2021-06-30 23:17:47.799775] #5 LinkProvider.loadNodesFile (package:dslink/client.dart:616:48) [2021-06-30 23:17:47.799775] #6 LinkProvider.init (package:dslink/client.dart:544:5) [2021-06-30 23:17:47.799775] #7 main.<main_async_body> (file:///C:/dsaserver/dsa/dglux-server/dslinks/dgapi/bin/run.dart:46:8) [2021-06-30 23:17:47.799775] #8 Future.Future.microtask.<anonymous closure> (dart:async/future.dart:144) [2021-06-30 23:17:47.799775] #9 _microtaskLoop (dart:async/schedule_microtask.dart:41) [2021-06-30 23:17:47.799775] #10 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50) [2021-06-30 23:17:47.799775] #11 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:96) [2021-06-30 23:17:47.799775] #12 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:149) [2021-06-30 23:17:47.824774] == Exited with status 255 ==

Any suggestions on how to solve it? without having to reenter servers?

@jdsdc
Copy link
Author

jdsdc commented Jun 30, 2021

@ilyatsarev ,

I think i found the problem in the nodes.json file

Changed from this:

"$$dgapi_password":"\u001bpw:YzMUC4x9x-B-s8gKTmt60w"}

to this

"$$dgapi_password":"pw:YzMUC4x9x-B-s8gKTmt60w"}

dgApi now starts, but it seems like the password has been corrupted.

@jdsdc
Copy link
Author

jdsdc commented Jul 1, 2021

@ilyatsarev, after previous change the password is corrupted so, i could not just remove the escape character 'u001b'

@jdsdc
Copy link
Author

jdsdc commented Jul 1, 2021

@ilyatsarev,

  1. I had to remove the connection and add it again due to problems decrypting password in nodes.json. Could be a problem with an installation with many servers connected.
  2. It seems like dgApi reconnects to a server that i started after after a restart of DGLux, BUT only if I logout and then login again in DGLux. Do you know why that is?

@jdsdc
Copy link
Author

jdsdc commented Jul 1, 2021

@ilyatsarev

Reconnect works as expected (Forget the login/logout problem I described in previous post)


  • The outstanding problem is subscribed values that are not updated, most important.
  • (nodes.json passwords from older installations cannot be decrypted)

Values that are subscribed to are not updated when Niagara station is reconnected. You have to restart dgApi link to get updated values again. We have tried with subscriptions both from ETSDB and a proprietary link.

Added screenshots of value JD-Random that has been added as watch path in ETSDB. But value is not updated either in dgApi or ETSDB. Values with no subscribtions are updated correctly.

etsdb - subscribedValue JD-Random
dgaApi - subscribedValue JD-Random

@jdsdc
Copy link
Author

jdsdc commented Jul 9, 2021

@ilyatsarev, i hope the previous post was understandable. If not, let me know what I need to clarify.

@ilyatsarev
Copy link

@jdsdc thanks, yes I understand the description. I'll open an internal ticket for a developer to take a look at this. Do you have any recommendations on what would be the best way to reproduce this in our lab?

@jdsdc
Copy link
Author

jdsdc commented Jul 16, 2021

Configure Value in Nigara Station

I set up a random generated value that I use DGLux. Value used in example is JD-Random
I used a subscribtion of the value in etsdb as an example. But the error appears if subscribed
from any application. See attachements how the JD-Random value is configured in Niagara

Recreate error

  1. Setup connection to station in DGApi
  2. Set up a watch point in etsdb (To value similar to JD-Random)
  3. Verify that value is updated in ETSDB.
  4. Stop DGLux Server
  5. Stop Niagara Station
  6. Start DGLux Server
  7. Verify no connection to station
  8. Start Niagara station
  9. Verify Reconnect to station in DGLux
  10. Verify error - No update of value
  11. Restart DGApi - Value should be updated again in both DGApi and ETSDB
    station_config
    station_config_property_sheet
    station_config_wiresheet config
    dglux_dgapi_JD-Random
    dglux_etsdb_subscribed_value_JD-Random

@jdsdc
Copy link
Author

jdsdc commented Jul 16, 2021

@ilyatsarev, see previous post for recreation

@jdsdc
Copy link
Author

jdsdc commented Aug 6, 2021

Hi @ilyatsarev, any update on this issue? do you need any more information from me?

@ilyatsarev
Copy link

Hi @jdsdc, there are no updates yet on the ticket I opened. Developer hasn't look into your issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants