Unpack for type ((67108864,)) not implemented - pymqi

I'm trying to query an MQ server running on IBM i from a python script on a linux box. I'm getting this error back from pymqi and I don't know what it means.
The stacktrace is as follows:
[{"message": "Unpack for type ((67108864,)) not implemented", "traceback":
"Traceback (most recent call last):\n
response = pcf.MQCMD_INQUIRE_CHANNEL(args)
File \"../python3.8/site-packages/pymqi/__init__.py\",
line 2770, in __call__\n
res, mqcfh_response = self.__pcf.unpack(message)
This is the snippet of code that generates the error
cd = pymqi.CD()
cd.ChannelName = pymqi.ensure_bytes(channel)
cd.ConnectionName = pymqi.ensure_bytes("{}({})".format(host, port))
cd.ChannelType = pymqi.CMQC.MQCHT_CLNTCONN
cd.TransportType = pymqi.CMQC.MQXPT_TCP
cd.Version = 9
queue_manager = pymqi.QueueManager(None)
queue_manager.connect_with_options(queue_manager_name, cd)
args = {pymqi.CMQCFC.MQCACH_CHANNEL_NAME: pymqi.ensure_bytes('*')}
pcf = pymqi.PCFExecute(queue_manager, response_wait_interval=5, convert=False)
response = pcf.MQCMD_INQUIRE_CHANNEL(args)
What is type 67108864?
I know there are limitations with this library and connecting to a z/OS, are there similar limitations with IBM i?

Turns out IBM i along with AIX have a different endinaness so one must pass convert=True to the pymqi.PCFExecute commands
queue_manager = pymqi.QueueManager(None)
queue_manager.connect_with_options(queue_manager_name, cd)
args = {pymqi.CMQCFC.MQCACH_CHANNEL_NAME: pymqi.ensure_bytes('*')}
pcf = pymqi.PCFExecute(queue_manager, response_wait_interval=5, convert=True)
response = pcf.MQCMD_INQUIRE_CHANNEL(args)

Related

getting FindFailed issue in sikuli for image on windows server 2019 (ADO VM)

Getting below error when running script on window server 2019 (ADO VM) through pipeline , same script is working fine on windows 10 (having resolution 1920X1080).
I am using screen resolution utility to change the VM resolution to 1920X1080 in pipeline.
I am setup the path Bundle Folder by using below text:
ImagePath.setBundleFolder(new File(System.getProperty("user.dir")+"/SikuliImages"));
using below code
ImagePath.setBundleFolder(new File(System.getProperty("user.dir")+"/SikuliImages"));
System.out.println("Image Bundle Path="+ImagePath.getBundlePath());
Screen screen=new Screen();
String UserName_Image_Path = System.getProperty("user.dir")+"/SikuliImages/UserName_TextBox.png";
String UserPassword_Image_Path = System.getProperty("user.dir")+"/SikuliImages/UserPassword_TextBox.png";
String SignIn_Image_Path = System.getProperty("user.dir")+"/SikuliImages/SignIn_Button.png";
Pattern P_UserName = new Pattern(UserName_Image_Path);
Pattern P_UserPassword = new Pattern(UserPassword_Image_Path);
Pattern P_SignIn = new Pattern(SignIn_Image_Path);
System.out.println("Wait for popup");
screen.wait(P_UserName,30);
Match UserName_Found = screen.exists(UserName_Image_Path);
UserName_Found.highlight(2);
screen.type(P_UserName,UserName);
Match UserPassword_Found = screen.exists(UserPassword_Image_Path);
UserPassword_Found.highlight(2);
screen.type(P_UserPassword,UserPassword);
Match SignIn_Found = screen.exists(SignIn_Image_Path);
SignIn_Found.highlight(2);
screen.click(P_SignIn);
FindFailed : C:\agent\vsts-agent-win-x64-2.200.2_work\1\s\Automation/SikuliImages/UserName_TextBox.png: (378x54) in R[0,0 1920x1080]#S(0)
Line 2226, in file Region.java
Could someone help me please.
This is not valid windows path since it contains both \ and /

how to receive information in kotlin from a server in python (socketserver)

server
I have tried almost everything to receive text from python
I don't know where the problem comes from from the client or from the server
try:
llamadacod = self.request.recv(1024)
llamada = self.decode(llamadacod)
print(f"{color.A}{llamada}")
time.sleep(0.1)
if llamada == "conectado":
msg = "Hello"
msgcod = self.encode(msg)
print(f"{color.G}{msg}")
self.request.send(msgcod)
client
val thread = Thread(Runnable {
try{
val client = Socket("localHost",25565)
client.setReceiveBufferSize(1024)
client.outputStream.write("conectado".toByteArray())
val text = InputStreamReader(client.getInputStream())
recibir = text.toString()
client.outputStream.write("Client_desconect".toByteArray())
client.close()
I already solved it, the solution was very simple, you just had to ensure that both the server and the client would occupy the same way of communicating
client :
val input = DataInputStream(client.getInputStream())
id = input.readUTF()
server:
self.request.send(len(msg).to_bytes(2, byteorder='big'))
self.request.send(msg)

Changes in lua language cause error in ai script

When I run script in game, I got an error message like this:
.\AI\haick.lua:104: bad argument #1 to 'find' (string expected, got nill)
local haick = {}
haick.type = type
haick.tostring = tostring
haick.require = require
haick.error = error
haick.getmetatable = getmetatable
haick.setmetatable = setmetatable
haick.ipairs = ipairs
haick.rawset = rawset
haick.pcall = pcall
haick.len = string.len
haick.sub = string.sub
haick.find = string.find
haick.seed = math.randomseed
haick.max = math.max
haick.abs = math.abs
haick.open = io.open
haick.rename = os.rename
haick.remove = os.remove
haick.date = os.date
haick.exit = os.exit
haick.time = GetTick
haick.actors = GetActors
haick.var = GetV
--> General > Seeding Random:
haick.seed(haick.time())
--> General > Finding Script Location:
local scriptLocation = haick.sub(_REQUIREDNAME, 1, haick.find(_REQUIREDNAME,'/[^\/:*?"<>|]+$'))
Last line (104 in file) causes error and I don`t know how to fix it.
There are links to .lua files below:
https://drive.google.com/file/d/1F90v-h4VjDb0rZUCUETY9684PPGw7IVG/view?usp=sharing
https://drive.google.com/file/d/1fi_wmM3rg7Ov33yM1uo7F_7b-bMPI-Ye/view?usp=sharing
Help, pls!
When you use a function in Lua, you are expected to pass valid arguments for the function.
To use a variable, you must first define it, _REQUIREDNAME in this case is not available, haick.lua file is incomplete. The fault is of the author of the file.
Lua has a very useful reference you can use if you need help, see here

Access REST API via lua script

Is there way to access rest api with pure lua script
GET / POST both way need to access and display response
i already tried
local api = nil
local function iniit()
if api == nil then
-- body
api = require("http://api.com")
.create()
.on_get(function ()
return {name = "Apple",
id = 12345}
end)
end
end
In linux , mac we can easily install luarocks , and then we can install curl package. It's easiest way to unix like os.
-- HTTP Get
local curl = require('curl')
curl.easy{
url = 'api.xyz.net?a=data',
httpheader = {
"X-Test-Header1: Header-Data1",
"X-Test-Header2: Header-Data2",
},
writefunction = io.stderr -- use io.stderr:write()
}
:perform()
:close()
In windows i faced several problems. Cant install luarocks correctly. then luarock install command not work correctl, etc..
In first dwnload lua from official site, and then create structure like (below web site)
http://fuchen.github.io/dev/2013/08/24/install-luarocks-on-windows/
then i download lua luadist
http://luadist.org/
then i got same structure luadist extracted folder and lua folder.
merged luadist folder and lua folder
Finaly we can use http.soket
local http=require("socket.http");
local request_body = [[login=user&password=123]]
local response_body = {}
local res, code, response_headers = http.request{
url = "api.xyz.net?a=data",
method = "GET",
headers =
{
["Content-Type"] = "application/x-www-form-urlencoded";
["Content-Length"] = #request_body;
},
source = ltn12.source.string(request_body),
sink = ltn12.sink.table(response_body),
}
print(res)
print(code)
if type(response_headers) == "table" then
for k, v in pairs(response_headers) do
print(k, v)
end
end
print("Response body:")
if type(response_body) == "table" then
print(table.concat(response_body))
else
print("Not a table:", type(response_body))
end
IF YOU DO THESE STEPS CORRECTLY , THIS WILL BE WORK 1000% SURE

Occasionally get "attempt to apply non-function" error when applying getForm

I'm using getForm to repeatedly pull data from an api. Sometimes the program finishes, and other times after some amount of iterations, I get the following error message:
Error in curlPerform(url = url, curl = curl, .opts = .opts) :
attempt to apply non-function
In addition: There were more than 50 warnings (use warnings() to see the first 50)
> traceback()
5: .Call("R_curl_easy_perform", curl, .opts, isProtected, .encoding,
PACKAGE = "RCurl")
4: curlPerform(url = url, curl = curl, .opts = .opts)
3: getURLContent(uri, .opts = .opts, .encoding = .encoding, binary = binary,
curl = curl)
2: getForm("https://xx", .params = parval)
1: fromJSON(getForm("https://xx",
.params = parval)) at #32
the warnings are:
In RCurlIconv(str, from = "C99", to = encoding) :
UTF-8 not supported iconv entries
Thanks for your help!
It's just a download error, sometimes the download fails. I just put in a provision to try the download again in that case.