Closed ChrisAtkinson1 closed 5 years ago
With zosmf & cics-deploy and without ssh or cics profiles ( so above host could be ssh or cics )
Command Preparation Failed: Cannot read property 'host' of undefined
With any of the other non cics-deploy profiles missing the error is
Command Preparation Failed: Cannot read property 'host' of undefined
I'm struggling to make sense of this. At the risk of asking a silly question, are you sure that you're running a current build of the code? I don't think there were any interim builds that could fail as experienced, but it's worth ruling that out.
I'm worried that somewhere in the depths of zowe the constructed profiles we programmatically pass in (constructed from our custom command line args) may be being ignored in favour of reloading a 'real' profile from first principles. That wouldn't have mattered in the past, but it does now; we need the Zowe code to use the profile objects that we pass to it. We construct that object and we validate that essential parameters such as the hostname are set, that's leading me to suspect a bug deeper in Zowe. If it ignores what we pass it and attempts to reference the command line parameters directly... then we're broken. I may be completely wrong of course.
Is there anything useful in the log file?
I updated earlier today to @next cics-deploy
I updated to @next cics-deploy and @latest zowe cli.
I don't see anything written to the logs for this - I cleaned the logs - ran again a bundle deploy ( that fails issue 259) - then deleted the zosmf profile - and reran the command. Only the disconnect error seems to be logged ( .zowe/logs/ path )
The log file above seems to be for a different problem, it's reporting an inability to validate the cicshlq value. Looks like a zosMF connection was refused for some reason, no idea why, the server logs might show something.
I think I've got to the bottom of this now, it's a known bug in the Imperative framework ( https://github.com/zowe/imperative/issues/43 ).
The problem involves deleting a default profile (for any type of profile); something internal half-remembers the old profile name such that an uninitialised 'ghost' profile will get used. You can list the profiles and see none installed, but a damaged partial profile actually gets partially loaded (and processing then fails before our Handler even gets driven, hence no diagnostics). If you then go on to make a new profile such that you only have one of the given type, the new one doesn't become the default. You actually have to make the new profile the default by running a separate zowe command, only that will exorcise the memory of the old profile.
This problem exists for all of the profiles, and all of the Zowe commands. It's not unique to us, deleting of default profiles is broken. We might be able to hand edit the relevant YAML file to work around the problem.
How can I hand edit a deleted file ?
From reading this then I assumed we are just hitting the imperative issue.
With a new install and no profiles created. It complains about a missing zosmf profile ( probably the one it first looks for ??)
$ zowe cics-deploy push bundle --n CICSJSON --targetdir /u/atkinc/pushtest --zosmf-host winmvs2c.hursley.ibm.com --zosm f-port 32070 --zosmf-user ATKINC --zosmf-password *--zosmf-reject-unauthorized false --ssh-password ** - -ssh-host winmvs2c.hursley.ibm.com --ssh-port 22 --ssh-user ATKINC --cics-host winmvs2c.hursley.ibm.com --cics-port 2 7728 --cics-user ATKINC --cics-password **** --cics-reject-unauthorized false --cics-protocol https --ow --cicsplex CAPLEX --scope CALMAS1 --csd-group NODELINE --cics-hlq ANTZ.CICS.TS.DEV.INTEGRAT --cpsm-hlq ANTZ.CICS.TS.DEV.INTEGRAT --description HELLOCMDLINE --timeout 1799 --target-state DISABLED Command Error: A failure occurred during CICS bundle pushing. Reason = Internal Error: No profiles of type "zosmf" were loaded for this command.
And after creating it fails on the ssh one.
Command Error: A failure occurred during CICS bundle pushing. Reason = Internal Error: No profiles of type "ssh" were loaded for this command.
Any chance of a .log file for the new issues? They sound more like what I theorised the problem might be at the outset... something deep in the internals of Zowe wanting to reload the profile from first principles. Hopefully the log files will reveal all.
It will have a bit of other stuff. It should be at the start as I reinstalled today.
Think this is the relevant bit
[2019/06/17 10:49:38.494] [DEBUG] [BundleParent.handler.js:55] Arguments received by cics-deploy: {"_":["cics-deploy","push","bundle"],"overwrite":true,"ow":true,"zosmf-reject-unauthorized":false,"zru":false,"zosmfRejectUnauthorized":false,"cics-reject-unauthorized":false,"cru":false,"cicsRejectUnauthorized":false,"n":"CICSJSON","name":"CICSJSON","targetdir":"U:/atkinc/pushtest","target-directory":"U:/atkinc/pushtest","td":"U:/atkinc/pushtest","target-dir":"U:/atkinc/pushtest","targetDir":"U:/atkinc/pushtest","targetDirectory":"U:/atkinc/pushtest","zosmf-host":"winmvs2c.hursley.ibm.com","zh":"winmvs2c.hursley.ibm.com","zosmfHost":"winmvs2c.hursley.ibm.com","zosmf-port":32070,"zp":32070,"zosmfPort":32070,"zosmf-user":"ATKINC","zu":"ATKINC","zosmfUser":"ATKINC","zosmf-password":"REDACTED","zpw":"REDACTED","zosmfPassword":"REDACTED","ssh-password":"REDACTED","spw":"REDACTED","sshPassword":"REDACTED","ssh-host":"winmvs2c.hursley.ibm.com","sh":"winmvs2c.hursley.ibm.com","sshHost":"winmvs2c.hursley.ibm.com","ssh-port":22,"sp":22,"sshPort":22,"ssh-user":"ATKINC","su":"ATKINC","sshUser":"ATKINC","cics-host":"winmvs2c.hursley.ibm.com","ch":"winmvs2c.hursley.ibm.com","cicsHost":"winmvs2c.hursley.ibm.com","cics-port":27728,"cpo":27728,"cicsPort":27728,"cics-user":"ATKINC","cu":"ATKINC","cicsUser":"ATKINC","cics-password":"REDACTED","cpw":"REDACTED","cicsPassword":"REDACTED","cics-protocol":"https","cpr":"https","cicsProtocol":"https","cicsplex":"CAPLEX","cp":"CAPLEX","scope":"CALMAS1","sc":"CALMAS1","csd-group":"NODELINE","cg":"NODELINE","csdgroup":"NODELINE","csdGroup":"NODELINE","cics-hlq":"ANTZ.CICS.TS.DEV.INTEGRAT","cq":"ANTZ.CICS.TS.DEV.INTEGRAT","cicshlq":"ANTZ.CICS.TS.DEV.INTEGRAT","cicsHlq":"ANTZ.CICS.TS.DEV.INTEGRAT","cpsm-hlq":"ANTZ.CICS.TS.DEV.INTEGRAT","cph":"ANTZ.CICS.TS.DEV.INTEGRAT","cpsmhlq":"ANTZ.CICS.TS.DEV.INTEGRAT","cpsmHlq":"ANTZ.CICS.TS.DEV.INTEGRAT","description":"HELLOCMDLINE","desc":"HELLOCMDLINE","timeout":1799,"to":1799,"target-state":"DISABLED","ts":"DISABLED","targetstate":"DISABLED","targetState":"DISABLED","$0":"..\..\..\..\..\..\..\AppData\Roaming\npm\node_modules\@brightside\core\lib\main.js","jobCard":"//DFHDPLOY JOB DFHDPLOY,CLASS=A,MSGCLASS=X,TIME=NOLIMIT","job-card":"//DFHDPLOY JOB DFHDPLOY,CLASS=A,MSGCLASS=X,TIME=NOLIMIT","jc":"//DFHDPLOY JOB DFHDPLOY,CLASS=A,MSGCLASS=X,TIME=NOLIMIT","jobcard":"//DFHDPLOY JOB DFHDPLOY,CLASS=A,MSGCLASS=X,TIME=NOLIMIT","verbose":false,"v":false} [2019/06/17 10:49:38.500] [ERROR] [BundleParent.handler.js:77] A failure occurred during CICS bundle pushing. Reason = Internal Error: No profiles of type "zosmf" were loaded for this command.
Hmm, that's disappointing. I had hoped we'd get some diagnostics from the underlying Imperative framework, perhaps a stack trace. Unfortunately there's nothing to work with.
The limited diagnostics suggests that an Error is thrown before we've done anything very interesting. I've put a change together (#276) to tolerate Errors being thrown from profiles.get() (which seems the most likely candidate to be failing), and also to add a little more logging so that if it happens again we can see how far we got.
Have I picked up your changes ? I did a reinstall and git clone from git@github.com:IBM/zowe-cli-cics-deploy-plugin.git
And doing these commands it appears I am uptodate ?
$ git checkout master error: Your local changes to the following files would be overwritten by checkout: docs/pages/cdp/CLIReadme.md Please commit your changes or stash them before you switch branches. Aborting
AzureAD+CHRISTOPHERAtkinson@LAPTOP-0JDQI4PC ~/Documents/ZoweStuff/ZOWEDEV/PUSH2/zowe-cli-cics-deploy-plugin (dev) $ git checkout dev Already on 'dev' M docs/pages/cdp/CLIReadme.md Your branch is up to date with 'origin/dev'.
From a fresh install - and removal of all profiles.
This now works!
I ran this command successfully before deleting all my default profiles.
Without ( the default cics-deploy profile) this error occurs
zowe cics-deploy push bundle --name CICSJSON --targetdir /u/atkinc/pushtest --zosmf-host winmvs2c.hursley.ibm.com --zosmf-port 32070 --zosmf-user ATKINC --zosmf-password * --zosmf-reject-unauthorized false --ssh-password *** --ssh-host winmvs2c.hursley.ibm.com --ssh-port 22 --ssh-user ATKINC --ssh-private-key C:\Users\CHRISTOPHERAtkinson\Documents\ZoweStuff\ZOWEDEV\PUSH1\mykey --ssh-key-passphrase mysshpwd --ssh-handshake-timeout 1000 --cics-host winmvs2c.hursley.ibm.com --cics-port 27728 --cics-user ATKINC --cics-password --cics-reject-unauthorized false --cics-protocol https --ow --cicsplex CAPLEX --scope CALMAS1 --res-group LIBVERS --cics-hlq ANTZ.CICS.TS.DEV.INTEGRAT --cpsm-hlq ANTZ.CICS.TS.DEV.INTEGRAT --description HELLOCMDLINE --job-card "//DFHDPLOY JOB DFHDPLOY,CLASS=A,MSGCLASS=X,TIME=NOLIMIT,SYSAFF=MV2C" --timeout 1799 --target-state ENABLED Command Preparation Failed: Cannot read property 'cicsplex' of undefined
Without zosmf...(cics-deploy readded) Command Preparation Failed: Cannot read property 'host' of undefined