Eclispe Milo handle missing Sever Nonce in ActivateSessionRequest - session

I use Eclipse Milo (0.2.3) in my prject for OPC UA communication. The OPC UA participants are a client (written using Eclipse Milo) and a server, which is running on a remote machine, and is not implemented using Milo).
I can connect the client to the server normally and if the remote server is shut down, I am able to reconnect the client automatically, as soon as the server is accessible again.
However, after updating the server software, the client can't reconnect any more and it floods the server with the following messages:
Create Session Request
The server is able to create a session
Activate Session Request
The server sends an Activate Session Response, in which the ServerNonce is missing and the service result is "bad"
This causes the client to send a new Create Session Request. This all happens multiple times within a second, which makes it impossible for the server to execute any other tasks then trying to create this session.
Are there any settings in Milo to specify the reconnection delay? Or is there any setting for sepcifying what should happen when receiving an empty ServerNonce?
The server's responses are as follows:
If the session can be activated:
OpcUa Binary Protocol
Message Type: MSG
Chunk Type: F
Message Size: 96
SecureChannelId: 1599759116
Security Token Id: 1
Security Sequence Number: 53
Security RequestId: 3
OpcUa Service : Encodeable Object
TypeId : ExpandedNodeId
NodeId EncodingMask: Four byte encoded Numeric (0x01)
NodeId Namespace Index: 0
NodeId Identifier Numeric: ActivateSessionResponse (470)
ActivateSessionResponse
ResponseHeader: ResponseHeader
Timestamp: Nov 16, 2018 14:05:47.974000000
RequestHandle: 1
ServiceResult: 0x00000000 [Good]
ServiceDiagnostics: DiagnosticInfo
EncodingMask: 0x00
.... ...0 = has symbolic id: False
.... ..0. = has namespace: False
.... .0.. = has localizedtext: False
.... 0... = has locale: False
...0 .... = has additional info: False
..0. .... = has inner statuscode: False
.0.. .... = has inner diagnostic info: False
StringTable: Array of String
ArraySize: 0
AdditionalHeader: ExtensionObject
TypeId: ExpandedNodeId
EncodingMask: 0x00
ServerNonce: ab...
Results: Array of StatusCode
ArraySize: 0
DiagnosticInfos: Array of DiagnosticInfo
ArraySize: 0
If the session can't be activated (after updating the server's software):
OpcUa Binary Protocol
Message Type: MSG
Chunk Type: F
Message Size: 64
SecureChannelId: 1599759041
Security Token Id: 1
Security Sequence Number: 61
Security RequestId: 11
OpcUa Service : Encodeable Object
TypeId : ExpandedNodeId
ActivateSessionResponse
ResponseHeader: ResponseHeader
Timestamp: Nov 16, 2018 12:49:08.235000000
RequestHandle: 222
ServiceResult: 0x80000000 [Bad]
ServiceDiagnostics: DiagnosticInfo
EncodingMask: 0x00
.... ...0 = has symbolic id: False
.... ..0. = has namespace: False
.... .0.. = has localizedtext: False
.... 0... = has locale: False
...0 .... = has additional info: False
..0. .... = has inner statuscode: False
.0.. .... = has inner diagnostic info: False
StringTable: Array of String
ArraySize: 0
AdditionalHeader: ExtensionObject
TypeId: ExpandedNodeId
EncodingMask: 0x00
ServerNonce: <MISSING>[OpcUa Null ByteString]
Results: Array of StatusCode
ArraySize: 0
DiagnosticInfos: Array of DiagnosticInfo
ArraySize: 0
Thank you in advance for your help.

This corner case you described where there's no delay between a failed re-activation and the subsequent re-creation is addressed on the dev/0.3 branch in this commit.
I might be able to back port it to 0.2.x next week if I have some spare time.
I don't think there are any workarounds you can use.

Related

Kong error using deck sync - service that already exists

I'm using deck in a CI pipeline to sync configurations to Kong from a declarative yaml file, like this:
_format_version: "1.1"
_info:
defaults: {}
select_tags:
- ms-data-export
services:
- connect_timeout: 60000
enabled: true
host: <the-host-name>
name: data-export-api
path: /api/download
port: <the-port>
protocol: http
read_timeout: 60000
retries: 5
routes:
- name: data-export
https_redirect_status_code: 426
path_handling: v0
preserve_host: false
regex_priority: 0
request_buffering: true
response_buffering: true
strip_path: true
paths:
- /api/download
protocols:
- http
plugins:
- config:
bearer_only: "yes"
client_id: kong
...
...
The error I'm getting occurs while running deck sync --kong-addr <kong-gateway> -s <the-above-yaml-file>, and when there are no actual changes to sync from the file (because the particular service already exists), and it says:
creating service data-export-api
Summary:
Created: 0
Updated: 0
Deleted: 0
Error: 1 errors occurred:
while processing event: {Create} service data-export-api failed: HTTP status 409 (message: "UNIQUE violation detected on '{name=\"data-export-api\"}'")
data-export-api is the name of the service that already exists in kong and deck tries to create.
Is there a way to avoid this error?

SNMPGET works from program but not from CLI

I am working on an fax grabber, for a fax in our building only Samsung provides the software "Samsung Easy Printer Manager" the program sends an SNMPGET to the Printer as I saw in Wireshark
Frame 133: 89 bytes on wire (712 bits), 89 bytes captured (712 bits) on interface bridge102, id 5
Ethernet II, Src: Parallel_53:1e:29 (Mac), Dst: SamsungE_69:6f:fe (Mac)
Internet Protocol Version 4, Src: 192.168.178.125, Dst: 192.168.178.38
User Datagram Protocol, Src Port: 55160, Dst Port: 161
Simple Network Management Protocol
version: version-1 (0)
community: Test
data: get-request (0)
get-request
request-id: 10944
error-status: noError (0)
error-index: 0
variable-bindings: 1 item
1.3.6.1.4.1.236.11.5.11.81.12.16.1.2.1: Value (Null)
Object Name: 1.3.6.1.4.1.236.11.5.11.81.12.16.1.2.1 (iso.3.6.1.4.1.236.11.5.11.81.12.16.1.2.1)
Value (Null)
[Response To: 134]
[Time: 0.000019000 seconds]
Answer:
Frame 135: 93 bytes on wire (744 bits), 93 bytes captured (744 bits) on interface vmenet2, id 2
Ethernet II, Src: SamsungE_69:6f:fe (Mac), Dst: Parallel_53:1e:29 (Mac)
Internet Protocol Version 4, Src: 192.168.178.38, Dst: 192.168.178.125
User Datagram Protocol, Src Port: 161, Dst Port: 55160
Simple Network Management Protocol
version: version-1 (0)
community: Test
data: get-response (2)
get-response
request-id: 10944
error-status: noError (0)
error-index: 0
variable-bindings: 1 item
1.3.6.1.4.1.236.11.5.11.81.12.16.1.2.1: 01000000
Object Name: 1.3.6.1.4.1.236.11.5.11.81.12.16.1.2.1 (iso.3.6.1.4.1.236.11.5.11.81.12.16.1.2.1)
Value (OctetString): 01000000
[Response To: 134]
[Time: 0.012747000 seconds]
But if im sending the get Request from my Laptop I get:
SNMPv2-SMI::enterprises.236.11.5.11.81.12.16.1.2.1 = No Such Instance currently exists at this OID
and after i googled the OID there was no result.
Any Ideas

GNU Radio ZMQ Blocks REP - REQ

I am trying to connect GNU Radio to a python script using the GR ZMQ REP / REQ blocks. GR is running on a Raspberry Pi 4 on router address 192.168.1.25. The python script is on a separate computer, from which I can successfully ping 192.168.1.25. I am setting up the REQ-REP pairs on separate ports, 55555 and 55556.
Flow graph:
import pmt
import zmq
# create a REQ socket
req_address = 'tcp://192.168.1.25:55555'
req_context = zmq.Context()
req_sock = req_context.socket (zmq.REQ)
rc = req_sock.connect (req_address)
# create a REP socket
rep_address = 'tcp://192.168.1.25:55556'
rep_context = zmq.Context()
rep_sock = rep_context.socket (zmq.REP)
rc = rep_sock.connect (rep_address)
while True:
data = req_sock.recv()
print(data)
rep_sock.send (b'1')
Running this code leads to the following error:
ZMQError: Operation cannot be accomplished in current state
The error is flagged at this line:
data = req_sock.recv()
Can you comment on the cause of the error? I know there is a strict REQ-REP, REQ-REP.. relationship, but I cannot find my error.
Your current code has two problems:
You call req_socket.recv(), but then you call rep_sock.send(): that's not how a REQ/REP pair works. You only need to create one socket (the REQ socket); it connects to a remote REP socket.
When you create a REQ socket, you need to send a REQuest before you receive a REPly.
Additionally, you should only create a single ZMQ context, even if you have multiple sockets.
A functional version of your code might look like this:
import zmq
# create a REQ socket
ctx = zmq.Context()
req_sock = ctx.socket (zmq.REQ)
# connect to a remote REP sink
rep_address = 'tcp://192.168.1.25:55555'
rc = req_sock.connect(rep_address)
while True:
req_sock.send (b'1')
data = req_sock.recv()
print(data)
I tested the above code against the following GNU Radio config:
options:
parameters:
author: ''
catch_exceptions: 'True'
category: '[GRC Hier Blocks]'
cmake_opt: ''
comment: ''
copyright: ''
description: ''
gen_cmake: 'On'
gen_linking: dynamic
generate_options: qt_gui
hier_block_src_path: '.:'
id: example
max_nouts: '0'
output_language: python
placement: (0,0)
qt_qss_theme: ''
realtime_scheduling: ''
run: 'True'
run_command: '{python} -u {filename}'
run_options: prompt
sizing_mode: fixed
thread_safe_setters: ''
title: Example
window_size: (1000,1000)
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [8, 8]
rotation: 0
state: enabled
blocks:
- name: samp_rate
id: variable
parameters:
comment: ''
value: '32000'
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [184, 12]
rotation: 0
state: enabled
- name: analog_sig_source_x_0
id: analog_sig_source_x
parameters:
affinity: ''
alias: ''
amp: '1'
comment: ''
freq: '1000'
maxoutbuf: '0'
minoutbuf: '0'
offset: '0'
phase: '0'
samp_rate: samp_rate
type: complex
waveform: analog.GR_COS_WAVE
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [184, 292.0]
rotation: 0
state: true
- name: blocks_throttle_0
id: blocks_throttle
parameters:
affinity: ''
alias: ''
comment: ''
ignoretag: 'True'
maxoutbuf: '0'
minoutbuf: '0'
samples_per_second: samp_rate
type: complex
vlen: '1'
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [344, 140.0]
rotation: 0
state: true
- name: zeromq_rep_sink_0
id: zeromq_rep_sink
parameters:
address: tcp://0.0.0.0:55555
affinity: ''
alias: ''
comment: ''
hwm: '-1'
pass_tags: 'False'
timeout: '100'
type: complex
vlen: '1'
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [504, 216.0]
rotation: 0
state: true
connections:
- [analog_sig_source_x_0, '0', blocks_throttle_0, '0']
- [blocks_throttle_0, '0', zeromq_rep_sink_0, '0']
metadata:
file_format: 1

CouchDB 3-node cluster (Windows) - multiple erlang errors

Im receiving multiple erlang errors in my CouchDB 2.1.1 cluster (3 nodes/Windows), see errors and node configuration below:
3 nodes (10.0.7.4 - 10.0.7.6), Azure application gateway is used as load balancer.
Why do these errors appear? system resources of the nodes are far from overload.
I would be thankful for any help - thanks in advance.
Errors:
rexi_server: from: couchdb#10.0.7.4(<0.14976.568>) mfa: fabric_rpc:changes/3 exit:timeout [{rexi,init_stream,1,[{file,"src/rexi.erl"},{line,256}]},{rexi,stream_last,2,[{file,"src/rexi.erl"},{line,224}]},{fabric_rpc,changes,4,[{file,"src/fabric_rpc.erl"},{line,86}]},{rexi_server,init_p,3,[{file,"src/rexi_server.erl"},{line,139}]}]
rexi_server: from: couchdb#10.0.7.6(<13540.24597.655>) mfa: fabric_rpc:all_docs/3 exit:timeout [{rexi,init_stream,1,[{file,"src/rexi.erl"},{line,256}]},{rexi,stream2,3,[{file,"src/rexi.erl"},{line,204}]},{fabric_rpc,view_cb,2,[{file,"src/fabric_rpc.erl"},{line,308}]},{couch_mrview,finish_fold,2,[{file,"src/couch_mrview.erl"},{line,642}]},{rexi_server,init_p,3,[{file,"src/rexi_server.erl"},{line,139}]}]
rexi_server: from: couchdb#10.0.7.6(<13540.5991.623>) mfa: fabric_rpc:all_docs/3 exit:timeout [{rexi,init_stream,1,[{file,"src/rexi.erl"},{line,256}]},{rexi,stream2,3,[{file,"src/rexi.erl"},{line,204}]},{fabric_rpc,view_cb,2,[{file,"src/fabric_rpc.erl"},{line,308}]},{couch_mrview,map_fold,3,[{file,"src/couch_mrview.erl"},{line,511}]},{couch_btree,stream_kv_node2,8,[{file,"src/couch_btree.erl"},{line,848}]},{couch_btree,fold,4,[{file,"src/couch_btree.erl"},{line,222}]},{couch_db,enum_docs,5,[{file,"src/couch_db.erl"},{line,1450}]},{couch_mrview,all_docs_fold,4,[{file,"src/couch_mrview.erl"},{line,425}]}]
req_err(3206982071) unknown_error : normal [<<"mochiweb_request:recv/3 L180">>,<<"mochiweb_request:stream_unchunked_body/4 L540">>,<<"mochiweb_request:recv_body/2 L214">>,<<"chttpd:body/1 L636">>,<<"chttpd:json_body/1 L649">>,<<"chttpd:json_body_obj/1 L657">>,<<"chttpd_db:db_req/2 L386">>,<<"chttpd:process_request/1 L295">>]
System running to use fully qualified hostnames ** ** Hostname localhost is illegal
COMPACTION-ERRORS
Supervisor couch_secondary_services had child compaction_daemon started with couch_compaction_daemon:start_link() at <0.18509.478> exit with reason {compaction_loop_died,{timeout,{gen_server,call,[couch_server,get_server]}}} in context child_terminated
CRASH REPORT Process couch_compaction_daemon (<0.18509.478>) with 0 neighbors exited with reason: {compaction_loop_died,{timeout,{gen_server,call,[couch_server,get_server]}}} at gen_server:terminate/7(line:826) <= proc_lib:init_p_do_apply/3(line:240); initial_call: {couch_compaction_daemon,init,['Argument__1']}, ancestors: [couch_secondary_services,couch_sup,<0.200.0>], messages: [], links: [<0.12665.492>], dictionary: [], trap_exit: true, status: running, heap_size: 987, stack_size: 27, reductions: 3173
gen_server couch_compaction_daemon terminated with reason: {compaction_loop_died,{timeout,{gen_server,call,[couch_server,get_server]}}} last msg: {'EXIT',<0.23195.476>,{timeout,{gen_server,call,[couch_server,get_server]}}} state: {state,<0.23195.476>,[]}
Error in process <0.16890.22> on node 'couchdb#10.0.7.4' with exit value: {{rexi_DOWN,{'couchdb#10.0.7.5',noproc}},[{mem3_rpc,rexi_call,2,[{file,"src/mem3_rpc.erl"},{line,269}]},{mem3_rep,calculate_start_seq,1,[{file,"src/mem3_rep.erl"},{line,194}]},{mem3_rep,repl,2,[{file,"src/mem3_rep.erl"},{line,175}]},{mem3_rep,go,1,[{file,"src/mem3_rep.erl"},{line,81}]},{mem3_sync,'-start_push_replication/1-fun-0-',2,[{file,"src/mem3_sync.erl"},{line,208}]}]}
#vm.args
-name couchdb#10.0.7.4
-setcookie monster
-kernel error_logger silent
-sasl sasl_error_logger false
+K true
+A 16
+Bd -noinput
+Q 134217727`
local.ini
[fabric]
request_timeout = infinity
[couchdb]
max_dbs_open = 10000
os_process_timeout = 20000
uuid =
[chttpd]
port = 5984
bind_address = 0.0.0.0
[httpd]
socket_options = [{recbuf, 262144}, {sndbuf, 262144}, {nodelay, true}]
enable_cors = true
[couch_httpd_auth]
secret =
[daemons]
compaction_daemon={couch_compaction_daemon, start_link, []}
[compactions]
_default = [{db_fragmentation, "50%"}, {view_fragmentation, "50%"}, {from, "23:00"}, {to, "04:00"}]
[compaction_daemon]
check_interval = 300
min_file_size = 100000
[vendor]
name = COUCHCLUSTERNODE0X
[admins]
adminuser =
[cors]
methods = GET, PUT, POST, HEAD, DELETE
headers = accept, authorization, content-type, origin, referer
origins = *
credentials = true
[query_server_config]
os_process_limit = 2000
os_process_soft_limit = 1000

Howto determine the Oracle client version number using VBA?

Does anyone know how to get the currently used Oracle client version number using VBA?
(And the info "32bit" or "64bit" Client.)
If so, could you please post example code?
Thanks much in advance.
1) the connection to Oracle is OK
2) connection via ADO and the MS Driver
3) the connection object properties are showing a lot of information abaout the driver, the connection and the database. But no info about the oracle client:
Asynchable Abort: FALSE
Asynchable Commit: FALSE
Pass By Ref Accessors: TRUE
Catalog Location: 2
Catalog Term: Datenbankverknüpfung
Catalog Usage: 1
Column Definition: 1
NULL Concatenation Behavior: 2
Connection Statu:s 1
Data Source Name: BASE
Read-Only Data Source: FALSE
DBMS Name: Oracle
DBMS Version: 09.02.0000 Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production
Data Source Object Threading Model: 1
GROUP BY Support: 4
Heterogeneous Table Support: 1
Identifier Case Sensitivity: 1
Maximum Index Size: 0
Maximum Open Chapters: 0
Maximum Row Size: 0
Maximum Row Size Includes BLOB: TRUE
Maximum Tables in SELECT: 0
Multiple Parameter Sets: TRUE
Multiple Results: 0
Multiple Storage Objects: FALSE
Multi-Table Update: FALSE
NULL Collation Order: 2
OLE Object Support: 1
ORDER BY Columns in Select List: FALSE
Output Parameter Availability: 2
Persistent ID Type: 4
Prepare Abort Behavior: 2
Prepare Commit Behavior: 2
Procedure Term: PL/SQL - Gespeicherte Prozedur
Provider Friendly Name: Microsoft OLE DB Provider für Oracle
Provider Name: MSDAORA.DLL
OLE DB Version: 2
Provider Version: 02.81.1132.0
Quoted Identifier Sensitivity: 4
Rowset Conversions on Command: TRUE
Schema Term: Besitzer
Schema Usage: 15
SQL Support: 267
Structured Storage: 1
Subquery Support: 31
Transaction DDL: 2
Isolation Levels: 1052672
Isolation Retention: 0
Table Term: Tabelle
User Name: REPORT
Table Statistics Support: 3
Open Rowset Support: 8
Password: b_rep
User ID: report
Data Source: BASE
Window Handle:
Locale Identifier: 1031
OLE DB Services: -7
Prompt: 4
Extended Properties:
Autocommit Isolation Levels: 4096
I don't know if it is possible in VBA but in VB.NET you can do it like this:
Dim con As System.Data.OleDb.OleDbConnection
Dim architecture As String
architecture = System.Reflection.AssemblyName.GetAssemblyName(con.GetType.Assembly.Location).ProcessorArchitecture.ToString
Console.WriteLine("Architecture: " & architecture)
Console.WriteLine("Assembly: " & con.GetType.Assembly.FullName)

Resources