How to deal with a BIP7059 error "Failed to find message element" on a publication node - ibm-integration-bus

I'm getting 'Failed to find message element' when I output a well formed message to a publication node on IIB.
I've tried changing the XML message tree but the error still remains same. Anyone ever had this problem?

Put a Trace Node after the Node where you build the message and and write the contents into a file.
In the Trace Node use ${Root} so you can see everything.
It produces the output below, which is from a sample that I had to hand.
Note the three parsers which have the form [{ParserName} : {ParserInstance}] that have been attached to the element tree. Namely SOAPRoot, MQPROPERTYPARSER, and SOAP.
In your case you are looking for the XMLNSC Parser, by preference, although you may see XMLNS or even the really old XML parser attached.
Trace showing the content of the message
( ['SOAPRoot' : 0x1b633e9ff60]
(0x01000000:Name ):Properties = ( ['MQPROPERTYPARSER' : 0x1b406434d80]
(0x03000000:NameValue):MessageSet = NULL
(0x03000000:NameValue):MessageType = NULL
(0x03000000:NameValue):MessageFormat = NULL
(0x03000000:NameValue):Encoding = NULL
(0x03000000:NameValue):CodedCharSetId = NULL
(0x03000000:NameValue):Transactional = NULL
(0x03000000:NameValue):Persistence = NULL
(0x03000000:NameValue):CreationTime = NULL
(0x03000000:NameValue):ExpirationTime = NULL
(0x03000000:NameValue):Priority = NULL
(0x03000000:NameValue):ReplyIdentifier = NULL
(0x03000000:NameValue):ReplyProtocol = 'SOAP-AXIS2' (CHARACTER)
(0x03000000:NameValue):Topic = NULL
(0x03000000:NameValue):ContentType = NULL
(0x03000000:NameValue):IdentitySourceType = NULL
(0x03000000:NameValue):IdentitySourceToken = NULL
(0x03000000:NameValue):IdentitySourcePassword = NULL
(0x03000000:NameValue):IdentitySourceIssuedBy = NULL
(0x03000000:NameValue):IdentityMappedType = NULL
(0x03000000:NameValue):IdentityMappedToken = NULL
(0x03000000:NameValue):IdentityMappedPassword = NULL
(0x03000000:NameValue):IdentityMappedIssuedBy = NULL
)
(0x01000000:Folder):SOAP = ( ['SOAP' : 0x1b62a218430]
(0x01000000:Folder):Context = (
(0x01000000:Folder):Namespace = (
(0x03000102:NamespaceDecl)xmlns:soap = 'http://schemas.xmlsoap.org/soap/envelope/' (CHARACTER)
(0x03000102:NamespaceDecl)xmlns:acc = 'http://acc' (CHARACTER)
)
)
(0x01000000:Folder):Body = (
(0x01000000:Folder)http://acc:Response = (
(0x03000000:PCDataField)http://acc:ReqID = 'ID102' (CHARACTER)
(0x03000000:PCDataField)http://acc:CompanyName = 'Universal Happiness' (CHARACTER)
(0x01000000:Folder )http://acc:Employee = (
(0x03000000:PCDataField)http://acc:id = 'E100' (CHARACTER)
(0x03000000:PCDataField)http://acc:name = 'John' (CHARACTER)
)
)
)
)
)
If you are validating against a schema then you can use the Trace Node output to check your message against that schema paying attention to the presence or absence of mandatory aggregates and fields, also their order.
The following text is from the web page containing the description of the error message.
BIP7059
Failed to navigate to message element <insert_1>.
Severity
30 : Severe error
Explanation
While attempting to explore the contents of a message an error
occurred because the element <insert_1> was missing or unreachable.
Response
This is an internal error and you should contact your IBM support center.
Have a look at your logs and see if the name in insert_1 provides a clue.
NOTE: The text tells you it's an internal error and you may indeed need to contact IBM Support.

Related

How to detect the end_interaction signal using the dialogflow_cx python library?

I am using the DialogFlow CX python library for an agent integration. Once I send a request through detect_intent, I want to be able to check in the response for a flag that determines if the interaction with the agent has ended.
For this, I found a property within the ResponseMessage data type response called end_interaction. I tested this with one of my agents, and effectively once the interaction ends, I can see the end_interaction within the array of response messages:
# inspecting query_result.response_messages
[
text {
text: "Goodbye."
},
end_interaction {
}
]
Now, the problem is that I want to trigger some actions whenever we receive the signal, but since the end_interaction field is being sent empty whenever I try to check it returns me False:
# Both response messages from the example above return False under a bool
bool(query_result.response_messages[0].end_interaction) == False # text message response
bool(query_result.response_messages[1].end_interaction) == False # end_interaction signal
I have tried many things, such as checking with isinstance and hasattr, but they return True for all scenarios since the ResponseMessage data type always has an end_interaction attr.
Any help for finding how to detect and check for this signal is highly appreciated! Thanks!
To detect and check for the end_interaction field, you can use the following in your detect_intent:
any("end_interaction" in d for d in response.query_result.response_messages)
Please note that this will return True if the end_interaction field is found in the response_messages list and False if not. You can use this to determine if the interaction with the agent has ended.
Here is a python sample code of the detect_intent with the end_interaction field for your reference:
def detect_intent_texts(agent, session_id, texts, language_code):
session_path = f'{agent}/sessions/{session_id}'
print(f"Session path: {session_path}\n")
client_options = None
agent_components = AgentsClient.parse_agent_path(agent)
location_id = agent_components["location"]
if location_id != "global":
api_endpoint = f"{location_id}-dialogflow.googleapis.com:443"
print(f"API Endpoint: {api_endpoint}\n")
client_options = {"api_endpoint": api_endpoint}
session_client = SessionsClient(client_options=client_options)
for text in texts:
text_input = session.TextInput(text=text)
query_input = session.QueryInput(text=text_input, language_code=language_code)
request = session.DetectIntentRequest(
session=session_path, query_input=query_input
)
response = session_client.detect_intent(request=request)
print("=" * 20)
print(f"Query text: {response.query_result.text}")
response_messages = [
" ".join(msg.text.text) for msg in response.query_result.response_messages
]
print(f"Response Messages:\n {response.query_result.response_messages}")
print(f'End of interaction: {any("end_interaction" in d for d in response.query_result.response_messages)}')
Here is the result:

How to access a single field of the logstash metadata event?

I am using logastash 7.6 with the output-jdbc plugin, but I get an error and I understand that it is because in the event it sends me all the fields to be indexed that are part of #metadata.
Probe just putting the event name without # and it works for me.
How can I get a single field within a #metada set?
ERROR:
ERROR logstash.outputs.jdbc - JDBC - Exception. Not retrying {:exception=>#, :statement=>"UPDATE table SET estate = 'P' WHERE codigo = ? ", :event=>"{\"properties\":{\"rangoAltura1\":null,\"rangoAltura2\":null,\"codigo\":\"DB_001\",\"rangoAltura3\":null,\"descrip\":\"CARLOS PEREZ\",\"codigo\":\"106\",\"rangoAltura5\":null,\"active\":true},\"id\":\"DB_001_555\"}"}
My .conf:
statement => ["UPDATE table SET estate = 'A' WHERE entidad = ? ","%{[#metadata][miEntidad]}"]
{[#metadata][miEntidad]} -----> map['entidad_temp'] = event.get('entidad')
According to the output jdbc plugin README you have it set correctly/
Maybe try the following as a work-around:
statement => ["UPDATE table SET estate = 'A' WHERE entidad = ? ","[#metadata][miEntidad]"]

Linq to entities giving error when generic repository is used with List<T> object

In my ASP.NET Web API project, I am trying to use the generic repositories with the List objects under one of the methods. But it is throwing exception
Exception thrown: 'System.Data.SqlClient.SqlException' in System.Data.dll
System.Data.Entity.Core.EntityCommandExecutionException: Calling 'Read' when the data reader is closed is not a valid operation. --->
System.Data.SqlClient.SqlException: Execution Timeout Expired. The
timeout period elapsed prior to completion of the operation or the
server is not responding. ---> System.ComponentModel.Win32Exception:
The wait operation timed out
lstFinalResult object contains few rows. partnerRepo is a generic repo and will have data at the later stage, i suppose.
Please advise, where am i making the mistake. Can we mix the List with generic repository objects in the linq query ?
Here is the linq code :-
List<UserDocumentResult> lstFinalResult = new List<UserDocumentResult>();
foreach (DocumentMapping dm in lstMappings)
{
lstFinalResult.Add(new UserDocumentResult { PID = dm.PartnerID,
DocMappingID = dm.DocumentMappingID,
EntityType = "",
Name = ""
});
}
var partnerRepo = _docRepository.PtGenericRepo.Get();
var entityCodesRepo = _docRepository.EntityCodeGenericRepo.Get();
---While debugging, I am getting error in the below code only.
var qualifiedPartnerSet = (from tmp in lstFinalResult
join px in partnerRepo on tmp.PID equals px.PartnerID
join ecx in entityCodesRepo on px.EntityCodeID equals ecx.EntityCodeID
select new UserDocumentResult
{
PID = px.PartnerID,
MappingID = tmp.MappingID,
EntityType = ecx.DisLabel.Trim(),
Name = px.NameLine1.Trim() + px.NameLine2.Trim(),
}).ToList();

Building MQMD header in compute node of IBM message broker

I'm having trouble trying to add MQMD header in compute node.
Tried something like that:
SET OutputRoot.Properties = InputRoot.Properties;
CREATE LASTCHILD OF OutputRoot DOMAIN('MQMD') NAME 'MQMD';
SET OutputRoot.MQMD.Format = MQFMT_NONE;
SET OutputRoot.MQMD.CodedCharSetId = 1208;
SET OutputRoot.MQMD.Encoding = 546;
But it always ends up with this exception:
Text:CHARACTER:Caught exception and rethrowing
Insert
Type:INTEGER:14
Text:CHARACTER:test.MyAdp.AddHeader
RecoverableException
File:CHARACTER:F:\build\slot1\S900_P\src\CommonServices\ImbValue.cpp
Line:INTEGER:989
Function:CHARACTER:ImbValue::stateError
Type:CHARACTER:
Name:CHARACTER:
Label:CHARACTER:
Catalog:CHARACTER:BIPmsgs
Severity:INTEGER:3
Number:INTEGER:2329
Text:CHARACTER:Value not valid
For sure, without adding MQMD header everything works perfectly well.
I tried to use other formats as MQFMT_STRING, MQFMT_RF_HEADER_2 (with MQRFH2 header added next) but with the same result.
Can anyone give me any clue?
Is it possible to get some more meaningful diagnostics from broker somehow?
UPD
Here is trace out before entering Compute node which tries to add MQMD header. The trace node after Compute is never reached.
( ['GENERICROOT' : 0xac05710]
(0x01000000:Name):Properties = ( ['GENERICPROPERTYPARSER' : 0xaf5ccc0]
(0x03000000:NameValue):MessageSet = '' (CHARACTER)
(0x03000000:NameValue):MessageType = '' (CHARACTER)
(0x03000000:NameValue):MessageFormat = '' (CHARACTER)
(0x03000000:NameValue):Encoding = 546 (INTEGER)
(0x03000000:NameValue):CodedCharSetId = 0 (INTEGER)
(0x03000000:NameValue):Transactional = TRUE (BOOLEAN)
(0x03000000:NameValue):Persistence = FALSE (BOOLEAN)
(0x03000000:NameValue):CreationTime = NULL
(0x03000000:NameValue):ExpirationTime = -1 (INTEGER)
(0x03000000:NameValue):Priority = 0 (INTEGER)
(0x03000000:NameValue):ReplyIdentifier = X'000000000000000000000000000000000000000000000000' (BLOB)
(0x03000000:NameValue):ReplyProtocol = 'UNKNOWN' (CHARACTER)
(0x03000000:NameValue):Topic = NULL
(0x03000000:NameValue):ContentType = '' (CHARACTER)
(0x03000000:NameValue):IdentitySourceType = '' (CHARACTER)
(0x03000000:NameValue):IdentitySourceToken = '' (CHARACTER)
(0x03000000:NameValue):IdentitySourcePassword = '' (CHARACTER)
(0x03000000:NameValue):IdentitySourceIssuedBy = '' (CHARACTER)
(0x03000000:NameValue):IdentityMappedType = '' (CHARACTER)
(0x03000000:NameValue):IdentityMappedToken = '' (CHARACTER)
(0x03000000:NameValue):IdentityMappedPassword = '' (CHARACTER)
(0x03000000:NameValue):IdentityMappedIssuedBy = '' (CHARACTER)
)
(0x01000000:Name):BLOB = ( ['none' : 0xb30d460]
(0x03000000:NameValue):BLOB = X'314........d0a' (BLOB)
)
)
UPD2 Here is fragment of user trace, message appears in try-catch node right after returning from compute node that creates MQMD.
2015-09-14 13:20:06.936871 1200 UserTrace BIP2539I: Node '': Evaluating expression ''InputRoot.BLOB.BLOB || CAST(header AS BLOB CCSID 1208)'' at ('test.MyAdp_AddHeader.Main', '31.51'). This resolved to ''X'314....3d0d'''.
2015-09-14 13:20:06.937023 1200 UserTrace BIP2566I: Node 'test.MyAdp.AddHeader': Assigning value ''X'314...6d0'... (data of len 3915 truncated)'' to field / variable ''OutputRoot.BLOB.BLOB''.
2015-09-14 13:20:06.937043 1200 UserTrace BIP2537I: Node 'test.MyAdp.AddHeader': Executing statement ''RETURN TRUE;'' at ('test.MyAdp_AddHeader.Main', '33.4').
2015-09-14 13:20:06.937718 1200 UserTrace BIP4081I: Message propagated to catch terminal from try-catch node 'test.MyAdp.ErrorHandler.Timer.Try Catch'.
The try-catch node 'test.MyAdp.ErrorHandler.Timer.Try Catch' has caught an exception which occurred in a node connected to its try terminal. The message has been augmented with an exception list and is propagating it to any nodes connected to its catch terminal for further processing. See the following messages for details of the exception list.
No user action required.
Some attributes in your Properties folder could be unexpectedly null.
The issue occurs when they are copied to the MQMD folder.
A user or sys trace will show you which one.
Is your issue related to the Timeout Notification node?
I had the issue with Properties.CreationTime = null
I saw others having the issue with Properties.Topic = null
I coded it to bypass the issue.
There is not enough detail given to tell what is happening. What version of MB/IIB are you using?
You might be hitting the problem described here.
With that in mind, try changing your ESQL to:
SET OutputRoot.Properties.CodedCharSetId = 1208 ;
SET OutputRoot.Properties.Encoding = 546 ;
SET OutputRoot.MQMD.Format = MQMFT_NONE ;
SET OutputRoot.MQMD.CodedCharSetId = 1208 ;
SET OutputRoot.MQMD.Encoding = 546 ;
...
Did you try changing
CREATE LASTCHILD OF OutputRoot DOMAIN('MQMD') NAME 'MQMD';
with
CREATE LASTCHILD OF OutputRoot DOMAIN('MQMD');
There is no need to specify name
Have you tried setting the format as a character value? According to the documentation this is what is expected:
http://www-01.ibm.com/support/knowledgecenter/SSMKHH_10.0.0/com.ibm.etools.mft.doc/ad09700_.htm
ie/
SET OutputRoot.MQMD.Format = 'MQFMT_NONE';

NullPointerException using DOMParser and selectSingleNode

String url = "http://www.amazon.com/Classic-Starts-Great-Expectations/dp/1402766459/ref=sr_1_1?s=books&ie=UTF8&qid=1294405505&sr=1-1";
DOMParser parser = new DOMParser();
parser.parse(url);
Document document = parser.getDocument();
DOMReader reader = new DOMReader();
org.dom4j.Document nhddoc = reader.read(document);
//book price
Node price = nhddoc.selectSingleNode("/HTML/BODY/DIV[2]/FORM/TABLE[3]/TBODY/TR/TD/DIV/TABLE/TBODY/TR/TD[2]/B");
System.out.println(price.getText().toString().trim());
the error i get is :
Exception in thread "main" java.lang.NullPointerException
at nekodom4j.Main.main(Main.java:44)
does the null pointer exception means no node was selected ?
I have no particular idea what the cause of the problem might be, but the first thing I would do to debug it would be to walk the path one level at a time and see where it fails to return what you expect.
Node html = nhddoc.selectSingleNode("/HTML");
/* maybe print out some information about the Node just acquired */
Node body = html.selectSingleNode("/BODY");
etc...

Resources