Skip to content
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

configmgr sometimes gives bad error code for nonexistent yaml #716

Open
nosrednayduj opened this issue Jun 14, 2024 · 2 comments
Open

configmgr sometimes gives bad error code for nonexistent yaml #716

nosrednayduj opened this issue Jun 14, 2024 · 2 comments
Labels
bug Something isn't working new not yet triaged

Comments

@nosrednayduj
Copy link

Describe the bug
Config manager has some error checking, but it fails when a missing file is the last one in the configuration that it is manipulating.

configmgr.c overloadConfiguration function is a recursive function but it appears not to check errors in its final call (pathTail == NULL). It gives a message saying it couldn't read the file, but the return code from config manager is zero.

Putting an existing file after the nonexistent file gives a second error message and return code 7.

Steps to Reproduce

$ ./configmgr -s /some/valid/schema -p "FILE(/existing/file):FILE(/nonexistant/file)" env /output/file.env

Expected behavior
Error message and nonzero return code. We get an error message, but return code is helpful for scripting.

Screenshots (if needed)
Showing problem:

$ ./configmgr -s /some/valid/schema -p "FILE(/existing/file):FILE(/nonexistant/file)" env /output/file.env
ZWEL0318E - failed to read '/nonexistant/file.yaml' - EDC5129I No such file or directory.
$ echo $?
0

With existing file last, showing error code:

$ ./configmgr -s /some/valid/schema -p "FILE(/nonexistant/file):FILE(/existing/file)" env /output/file.env
ZWEL0318E - failed to read '/nonexistant/file.yaml' - EDC5129I No such file or directory.
ZWEL0319E - Failed to load configuration, element may be bad, or less likely a bad merge.
$ echo $?
7

Logs

Describe your environment

  • Zowe version number (Check the Desktop login screen, or manifest.json in the Zowe install folder): 2.15 (any 2.x probably)
  • Install method (pax, smpe, kubernetes, github clone): pax
  • Operating system (z/OS, kubernetes, etc) and OS version: z/OS 3.1
  • Node.js version number (Shown in logs, or via node --version): N/A
  • Java version number (Shown in logs, or via java -version): N/A
  • z/OSMF version: N/A
  • What is the output of log message ZWES1014I: N/A
  • Environment variables in use: N/A I think.

Additional context
Side note: the 319 error message does not appear when you are calling it from rexx, but you do get the return code 7 if you put the existing file last. The 318 error message does appear calling from rexx in both cases; gets return code 0 if the nonexistent file is last. So I think probably fixing this will fix rexx.

@nosrednayduj nosrednayduj added bug Something isn't working new not yet triaged labels Jun 14, 2024
@JoeNemo
Copy link
Contributor

JoeNemo commented Jun 19, 2024

It looks like somehow the logic that generates ZWEL0318E message does not flow into a place that changes the config manager return status from:

return ZCFG_SUCCESS;

However it does change it when flowing through the code that generates the ZWEL0319E.

@Gautham-coder I hope you investigate.

@Gautham-coder
Copy link
Contributor

Sure Joe, I will look into it. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working new not yet triaged
Projects
None yet
Development

No branches or pull requests

3 participants