-
Notifications
You must be signed in to change notification settings - Fork 21
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
pgm-call: result-xml structure corrupt due to randomly added characters (urgent) #123
Comments
Examples for Errors:
|
code for the function |
Meantime tested with transporttype=odbc > no errors! |
Hello @nedi-dev 👋 Interesting that when using I noticed from your code snippet that you have It would nice to have a simplified example of the RPG program being called (without confidential info) so that the issue can be readily reproduced. |
Hi @abmusse |
What version of idb-connector do you have installed?
I'm thinking this could be an issue with dbstmt.fetchAll. Can you add the following to line 92-93 in lib/transports/idbTransport.js
And check if the xml in the results array is already corrupted before its appended to xmlOutput variable. |
|
Thinking you are on the right track: Output from idbTransport:
Same here:
Capital "D" is wrong! idbTransport:
other findings:
|
@abmusse , should we transfer this one over to idb-connector? |
From your output looks like the data retrieved using @ThePrez That would make sense given the issue seems to be caused by |
Any thoughts on what may be causing this issue? |
Seems to be an encoding issue. Need to reproduce it for debugging. |
This is a good point. The error occurs only for employees with names including "ä ö ü Ä Ö Ü" german special-characters. |
Interesting I wonder if this issue is related to #70. |
Or try this #20 |
Read through your references, but didn't got a clue how to proceed. |
At the beginning of your Node.js code, add |
Well, the error with malformed xml-tags disappeared ... |
👋 Hi! This issue has been marked stale due to inactivity. If no further activity occurs, it will automatically be closed. |
From my point of view this issue is not fixed yet. If we are forced to use DB2CCSID='0', we can not use this connector anymore as the special characters are not processed correctly. |
Not sure why the bot closed it - reopening. |
@kadler please reopen as it is not fixed. What could be the next step from your / our side? |
Since this is a conversion issue, can you please provide
|
FYI, I asked for |
Putty/bash: |
I have a hunch that the problem is occurring here: https://github.com/IBM/nodejs-idb-connector/blob/master/src/db2ia/dbstmt.cc#L2477 If the SQLFetch returns an indicator with a valid length (ie. not Since it's not null-termiated and we're not passing in the length, the |
@kadler Maybe we should detect the
|
Alternatively, just always set rlength to the proper value here: https://github.com/IBM/nodejs-idb-connector/blob/master/src/db2ia/dbstmt.cc#L2404-L2414 When it's SQL_NTS we already get the length in to |
I am not sure about the behavior of |
I'm not sure either. AFAICT it doesn't even mention the ability to pass a NULL pointer. |
I guess I would set the length correctly always, then pass it in if the pointer is not NULL, otherwise just pass in the NULL pointer. |
Hello @nedi-dev , idb-connector 1.2.10 has been released. You may upgrade to this version and check if it fix the issue. |
Thank you for the new release of idb-connector. Unfortunately it took some days to get back to the project. After reinstalling the package [email protected] the npm list looks like this:
In the xml you can find:
mind the : datpa Please let me know if I can support you recreating the issue on your system. |
Hello @nedi-dev ,
Your program is a little different. There is a program LGIZEIT/ZEI109 between idb-connector and the backend database. When you get the name of the backend database, you may also collect its column information by the following SQL statement:
|
This has just cropped up for me today. Just another one of those IBM i things. I have a program call using XMLSERVICE/itoolkit and the program returns a long character string (65k). It is using the See below; the I can also see that it is coming back in the XML in the connection.add(programCall);
connection.run((error, xmlOutput) => {
console.log(xmlOutput); //I can see that invaid 'O' here. Also, it can move around and it's not always Another important note is that this only happens when using the |
To reaffirm this issue, I switched the app over to ODBC (node-odbc) and it has resolved the issue. |
👋 Hi! This issue has been marked stale due to inactivity. If no further activity occurs, it will automatically be closed. |
Describe the bug
The node-script requests IBM i DB-Data via a call to rpg-pgm.
As working with daily-data for one month the call to the program is added to a toolkit conn-object for 30/31 times.
Running the con results in a successful execution but gives back a corrupted xml-structure (e. g. ... type=a'4p2' ..., ... <d ...).
We are using different person-ids in the request. With some PER# the error is reproducible others work fine.
Maybe there is a stringbuffer involved?!?
! Running the script multiple times with identic PERS# results always in the same error at the same position in xml-string.
To Reproduce
see above
Expected behavior
Please locate the bug and provide a corrected version of itoolkit or xmlservice
Files
If needed, we can provide our code snippet and some xml-data.
The text was updated successfully, but these errors were encountered: