|
chroot /QOpenSys/ibmichroot_containers/gallmanm /QOpenSys/bin/bsh/QOpenSys/ibmichroot_containers/gallmanm: The file access permissions do not allow the specified action.
Interesting, I am not seeing anything on the OS/400 side of things. But<mailto:aaronbartell@xxxxxxxxx%0b>> >
I'll check again some more after lunch.
Kev
On Fri, Mar 30, 2018 at 11:15 AM, Aaron Bartell <aaronbartell@xxxxxxxxx<mailto:aaronbartell@xxxxxxxxx>>
wrote:
Hi Kevin,on
There's something erroring when it runs the SQL (i.e. "SQLExecute(-1)")
your system. Maybe check QSYSOPR for messages and also check WRKACTJOBfor
issues.xstoolkit/lib/itoolkit')
I run the following example successfully.
var xt =
require('/QOpenSys/QIBM/ProdData/OPS/Node6/os400/
var conn = new xt.iConn("*LOCAL")System
conn.debug(true)
conn.add(xt.iSh("system -i 'DSPSYSSTS'"))
conn.run((str) => {
console.log(str)
})
============
INPUT XML
============
<?xml version='1.0'?><myscript><sh error='fast'>system -i
'DSPSYSSTS'</sh></myscript>
============
OUTPUT XML
============
SQLConnect: conn obj [309d85b0] handler [2]
PrepareAsync().
undefined
SQLPrepare(0): call QXMLSERV.iPLUG512K(?,?,?,?)BindParamAsync().
SQLBindParameter [1] = undefined
SQLBindParameter [2] = undefined
SQLBindParameter [3] = <?xml version='1.0'?><myscript><sh
error='fast'>system -i 'DSPSYSSTS'</sh></myscript>
SQLBindParameter [4] =
ExecuteAsync().
SQLExecute(0):
<?xml version='1.0'?><myscript><sh error='fast'>
System Status Information
Page 1
5770SS1 V7R3M0 160422
KT4001 03/30/18 12:00:54 EDT
% CPU used . . . . . . . . . . . . . . : 7.5
ASP . . . . . . . . . . . . . . : 534.4 GCurrent
Elapsed time . . . . . . . . . . . . . : 00:00:01 %
system ASP used . . . . . . . . . . : 30.3280
Jobs in system . . . . . . . . . . . . : 268 Total
aux stg . . . . . . . . . . . . : 534.4 G
% perm addresses . . . . . . . . . . . : .009
temporary used . . . . . . . . : 8149 MT I
% temp addresses . . . . . . . . . . . : .093 Peak
temporary used . . . . . . . . . : 8468 M
Sys Pool Reserved Max -------DB------- -----Non-DB-----
Act-> Wait-> Act-> Paging
Pool Size M Size M Act Faults Pages Faults Pages
Wait Inel Inel Pool Subsystem Option
1 1122.69 577.32 +++++ .0 .0 .0 .0
52.2 .0 .0 *MACHINE *FIXED
2 4345.49 7.56 102 .0 .0 1.7 1.7
13954.7 .0 .0 *BASE *CALC
3 614.37 .00 154 .0 .0 .0 .0
.0 .0 .0 *INTERACT *CALC
4 61.43 .00 5 .0 .0 .0 .0
.0 .0 .0 *SPOOL *CALC
* * * * * E N D O F L I S
N G * * * * *wrote:
</sh>
</myscript>
SQLDisconnect: conn obj [309d85b0] handler [2]
Aaron Bartell
IBM i hosting, starting at $157/month. litmis.com/spaces<https://protect-us.mimecast.com/s/wJaDCAD9NRhj9v3gCOCvrz?domain=litmis.com>
On Fri, Mar 30, 2018 at 11:02 AM, Kevin Nunn <nunn.kevin@xxxxxxxxx<mailto:nunn.kevin@xxxxxxxxx>>
Hi Aaron,
I changed that and ended up with the exact same error.
[bash]$node cltest.js
CL statement : 'DSPSYSSTS'
============
INPUT XML
============
<?xml version='1.0'?><myscript><sh error='fast'>system -i
'DSPSYSSTS'</sh></myscript>
============
OUTPUT XML
============
SQLConnect: conn obj [309d29f0] handler [2]
PrepareAsync().
SQLPrepare(-1): call QXMLSERV.iPLUG512K(?,?,?,?)
BindParamAsync().
SQLBindParameter [1] = undefined
SQLBindParameter [2] = undefined
SQLBindParameter [3] = <?xml version='1.0'?><myscript><sh
error='fast'>system -i 'DSPSYSSTS'</sh></myscript>
SQLBindParameter [4] =
ExecuteAsync().
SQLExecute(-1):
undefined:0
Error: SQLSTATE=PAERR SQLCODE=-1 SQLDescribeParam() failed.
at Error (native)
On Fri, Mar 30, 2018 at 7:39 AM, Aaron Bartell <aaronbartell@xxxxxxxxx
--show awrote:simplify
Hi Kevin,wrote:
Try the below. Note I added single quotes inside the double quotes.
var cl = "'DSPSYSSTS'";
Aaron Bartell
IBM i hosting, starting at $157/month. litmis.com/spaces<https://protect-us.mimecast.com/s/wJaDCAD9NRhj9v3gCOCvrz?domain=litmis.com>
On Thu, Mar 29, 2018 at 3:40 PM, Kevin Nunn <nunn.kevin@xxxxxxxxx<mailto:nunn.kevin@xxxxxxxxx>>
Here is a simplified version of the CL attempted, along with debugoutput.
xstoolkit/lib/itoolkit');
var xt =
require('/QOpenSys/QIBM/ProdData/OPS/Node6/os400/
wrote:
var DBname = "*LOCAL";
var userId = "user";
var passwd = "pass";
var cl = "DSPSYSSTS";
console.log("CL statement : " + cl);
var conn = new xt.iConn(DBname, userId, passwd);
conn.debug(true);
conn.add(xt.iSh("system -i " + cl));
function cb(rs) {console.log(str);}
conn.run(cb);
------------------------------------------------------
[bash]$node cltest.js
CL statement : DSPSYSSTS
============
INPUT XML
============
<?xml version='1.0'?><myscript><sh error='fast'>system -i
DSPSYSSTS</sh></myscript>
============
OUTPUT XML
============
SQLConnect: conn obj [309d2e50] handler [2]
PrepareAsync().
SQLPrepare(-1): call QXMLSERV.iPLUG512K(?,?,?,?)
BindParamAsync().
SQLBindParameter [1] = undefined
SQLBindParameter [2] = undefined
SQLBindParameter [3] = <?xml version='1.0'?><myscript><sh
error='fast'>system -i DSPSYSSTS</sh></myscript>
SQLBindParameter [4] =
ExecuteAsync().
SQLExecute(-1):
undefined:0
Error: SQLSTATE=PAERR SQLCODE=-1 SQLDescribeParam() failed.
at Error (native)
-----------------------------------------------------------
On Thu, Mar 29, 2018 at 3:23 PM, Kevin Nunn <nunn.kevin@xxxxxxxxx<mailto:nunn.kevin@xxxxxxxxx>>
Well, chop me down with a herring!
I left for a meeting, came back and isolated the sql code to
it
and see if I break it down and figure it out. I was going to
failedwhy!co-worker the SQL problem and boom, it worked, and I have no idea
But
the CL part of it is still giving me the SQLDescribeParam()
areerror.
Aaron, I know you are one of the Open Source gurus around here,
allthere
any HowTo's to v8 on an iSeries, setting the correct paths and
runningthat?
5733OPS
It took me a few days to figure out I had to get all the PTFs for
to actually have all the actual software, and then it kept
changingNode
v0.12, not v6, but I knew it was installed. So I ended up
tellsthe
symbolic links manually. I just found the documentation that
nunn.kevin@xxxxxxxxx<mailto:nunn.kevin@xxxxxxxxx>>you
to
run a script to do that today. :P
Thanks,
Kev
On Thu, Mar 29, 2018 at 3:05 PM, Kevin Nunn <
wouldalthoughwrote:
Thanks for the reply Aaron
It is version 6, the default install of 5733OPS plus PTFs,
Iprobably
did
install v8 rpm and then "yum erase"d it. V8 would not run,
due
to
lib path issues and since I am new to all this, I decided it
thebe
brokebest
to stick with the defaults. But possibly the install/erase of v8
things?
Below is the code. It's a basic copy/paste of what I found on
DBlinklib/
listed in the first email. except for the db credentials, etc.
var http = require('http');
var fs = require('fs');
var url = require('url');
var db = require('/QOpenSys/QIBM/ProdData/OPS/Node6/os400/db2i/
xstoolkit/db2a');
var xt = require('/QOpenSys/QIBM/ProdData/OPS/Node6/os400/
lib/itoolkit');
var DBname = "*LOCAL";
var userId = "user";
var passwd = "pass";
var ip = "IPaddress";
var port = 8000;
var webserver = http.createServer((req,res) => {
var realPath = __dirname + url.parse(req.url).pathname;
fs.exists(realPath, (exists) => {
if(!exists){
var sql = url.parse(req.url, true).query.sql;
var cl = url.parse(req.url, true).query.cl;
if(sql && sql.length > 0) {
console.log("SQL statement : " + sql);
var dbconn = new db.dbconn();
dbconn.conn(DBname, userId, passwd); // Connect to the
butv8.xaaronbartell@xxxxxxxxx<mailto:aaronbartell@xxxxxxxxx>>var stmt = new db.dbstmt(dbconn);
stmt.exec(sql, (rs) => { // Query the statement
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end(JSON.stringify(rs));
console.log(rs);
stmt.close();
dbconn.disconn();
dbconn.close();
});
}
if(cl && cl.length > 0) {
console.log("CL statement : " + cl);
var conn = new xt.iConn(DBname, userId, passwd);
conn.add(xt.iSh("system -i " + cl));
conn.run((rs) => {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end(xt.xmlToJson(rs)[0].data);
});
}
} else {
var file = fs.createReadStream(realPath);
res.writeHead(200, {'Content-Type':'text/html'});
file.on('data', res.write.bind(res));
file.on('close', res.end.bind(res));
file.on('error', (err) => {
res.writeHead(500, {'Content-Type':'text/plain'});
res.end("500 Internal Server Error");
});
}
});
});
webserver.listen(port, ip);
console.log('Server running at http://' + ip + ':' + port);
On Thu, Mar 29, 2018 at 2:34 PM, Aaron Bartell <
talkingwrote:
What version of Node.js?
Can you post your code so we know exactly which example you're
about?
FWIW, if you're using Node.js v6.x then I'd upgrade to Node.js
nunn.kevin@xxxxxxxxx<mailto:nunn.kevin@xxxxxxxxx>>and
https://github.com/nodejs/Rele<https://protect-us.mimecast.com/s/YMYCCBBRNVIvVg91s7g8p1?domain=github.com>work through issues with that version.
ase
Aaron Bartell
IBM i hosting, starting at $157/month. litmis.com/spaces<https://protect-us.mimecast.com/s/wJaDCAD9NRhj9v3gCOCvrz?domain=litmis.com>
On Thu, Mar 29, 2018 at 2:27 PM, Kevin Nunn <
exampleswrote:
I am researching db2i and itoolkit by starting with IBM's
at
https://www.ibm.com/developerworks/ibmi/library/i-native-js-<https://protect-us.mimecast.com/s/g2QsCDkJ1XfXBRK1uncrOZ?domain=ibm.com>app-ibmi-with-
nodejs/
at not having much luck.
The SQL part of the script is connecting to the DB2 server,
putany
query"Select
* From library/db" results in an empty brackets []. If I send
"VALUES
current date", I do get [{"00001":"2018-03-29"}] back. If I
connectingin
bad
credentials, I do get auth errors, so it seems to be
mailman/listinfo/opensourcetothis
iSeries,the
server.
The same queries work fine from STRSQL.
Also the CL part of the example just returns
Error: SQLSTATE=PAERR SQLCODE=-1 SQLDescribeParam() failed.
at Error (native)
I am new to nodejs, the plan was to find examples for the
watch
them work, then see how the work and start from there.
Also wondering if my other issue might have some relation to
listproblem
(see "Broken npm?" thread in OpenSource).
Thanks
Kev
--
*Kevin Nunn <https://about.me/kevinnunn<https://protect-us.mimecast.com/s/lnxNCER68YTBWQJmsKFCx3?domain=about.me>>*
--
This is the IBMi Open Source Roundtable (OpenSource) mailing
To post a message email: OpenSource@xxxxxxxxxxxx<mailto:OpenSource@xxxxxxxxxxxx>
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/<https://protect-us.mimecast.com/s/ZvRyCG6Qv1hwJVpmFB4d-Q?domain=lists.midrange.com>
listor email: OpenSource-request@xxxxxxxxxxxx<mailto:OpenSource-request@xxxxxxxxxxxx>--
Before posting, please take a moment to review the archives
at https://archive.midrange.com/opensource<https://protect-us.mimecast.com/s/0B4hCJ67y4hx87mRu85Cuw?domain=archive.midrange.com>.
This is the IBMi Open Source Roundtable (OpenSource) mailing
----To post a message email: OpenSource@xxxxxxxxxxxx<mailto:OpenSource@xxxxxxxxxxxx>
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/opensource<https://protect-us.mimecast.com/s/_0L5CKr51guLqjvlSXQMAO?domain=lists.midrange.com>
or email: OpenSource-request@xxxxxxxxxxxx<mailto:OpenSource-request@xxxxxxxxxxxx>
Before posting, please take a moment to review the archives
at https://archive.midrange.com/opensource<https://protect-us.mimecast.com/s/0B4hCJ67y4hx87mRu85Cuw?domain=archive.midrange.com>.
--
*Kevin Nunn <https://about.me/kevinnunn<https://protect-us.mimecast.com/s/lnxNCER68YTBWQJmsKFCx3?domain=about.me>>*
--
*Kevin Nunn <https://about.me/kevinnunn<https://protect-us.mimecast.com/s/lnxNCER68YTBWQJmsKFCx3?domain=about.me>>*
--
*Kevin Nunn <https://about.me/kevinnunn<https://protect-us.mimecast.com/s/lnxNCER68YTBWQJmsKFCx3?domain=about.me>>*
--
This is the IBMi Open Source Roundtable (OpenSource) mailing list
To post a message email: OpenSource@xxxxxxxxxxxx<mailto:OpenSource@xxxxxxxxxxxx>
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/opensource<https://protect-us.mimecast.com/s/_0L5CKr51guLqjvlSXQMAO?domain=lists.midrange.com>
or email: OpenSource-request@xxxxxxxxxxxx<mailto:OpenSource-request@xxxxxxxxxxxx>
Before posting, please take a moment to review the archives
at https://archive.midrange.com/opensource<https://protect-us.mimecast.com/s/0B4hCJ67y4hx87mRu85Cuw?domain=archive.midrange.com>.
This is the IBMi Open Source Roundtable (OpenSource) mailing list
To post a message email: OpenSource@xxxxxxxxxxxx<mailto:OpenSource@xxxxxxxxxxxx>
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/opensource<https://protect-us.mimecast.com/s/_0L5CKr51guLqjvlSXQMAO?domain=lists.midrange.com>
or email: OpenSource-request@xxxxxxxxxxxx<mailto:OpenSource-request@xxxxxxxxxxxx>
Before posting, please take a moment to review the archives
at https://archive.midrange.com/opensource<https://protect-us.mimecast.com/s/0B4hCJ67y4hx87mRu85Cuw?domain=archive.midrange.com>.
--
*Kevin Nunn <https://about.me/kevinnunn<https://protect-us.mimecast.com/s/lnxNCER68YTBWQJmsKFCx3?domain=about.me>>*
--
This is the IBMi Open Source Roundtable (OpenSource) mailing list
To post a message email: OpenSource@xxxxxxxxxxxx<mailto:OpenSource@xxxxxxxxxxxx>
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/opensource<https://protect-us.mimecast.com/s/_0L5CKr51guLqjvlSXQMAO?domain=lists.midrange.com>
or email: OpenSource-request@xxxxxxxxxxxx<mailto:OpenSource-request@xxxxxxxxxxxx>
Before posting, please take a moment to review the archives
at https://archive.midrange.com/opensource<https://protect-us.mimecast.com/s/0B4hCJ67y4hx87mRu85Cuw?domain=archive.midrange.com>.
This is the IBMi Open Source Roundtable (OpenSource) mailing list
To post a message email: OpenSource@xxxxxxxxxxxx<mailto:OpenSource@xxxxxxxxxxxx>
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/opensource<https://protect-us.mimecast.com/s/_0L5CKr51guLqjvlSXQMAO?domain=lists.midrange.com>
or email: OpenSource-request@xxxxxxxxxxxx<mailto:OpenSource-request@xxxxxxxxxxxx>
Before posting, please take a moment to review the archives
at https://archive.midrange.com/opensource<https://protect-us.mimecast.com/s/0B4hCJ67y4hx87mRu85Cuw?domain=archive.midrange.com>.
--
*Kevin Nunn <https://about.me/kevinnunn<https://protect-us.mimecast.com/s/lnxNCER68YTBWQJmsKFCx3?domain=about.me>>*
--
This is the IBMi Open Source Roundtable (OpenSource) mailing list
To post a message email: OpenSource@xxxxxxxxxxxx<mailto:OpenSource@xxxxxxxxxxxx>
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/opensource<https://protect-us.mimecast.com/s/_0L5CKr51guLqjvlSXQMAO?domain=lists.midrange.com>
or email: OpenSource-request@xxxxxxxxxxxx<mailto:OpenSource-request@xxxxxxxxxxxx>
Before posting, please take a moment to review the archives
at https://archive.midrange.com/opensource<https://protect-us.mimecast.com/s/0B4hCJ67y4hx87mRu85Cuw?domain=archive.midrange.com>.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.