Skip to content

Conversation

@1000TurquoisePogs
Copy link
Member

@1000TurquoisePogs 1000TurquoisePogs commented Aug 8, 2025

This re-uses some code from the prototype #4276 but submits just "zwe validate port bind" and "zwe validate config" for review to keep the PR smaller and easier to test, read, merge.

This PR adds a command, "zwe validate config" which is an alias of "zwe config validate".
It then adds a command "zwe validate port bind" which can either test if a single component can bind to its associated port, or if all enabled components can.

That command is then used every startup, unless opted out via zowe.launchScript.startupChecks.bypassAll: true or zwe.launchScript.startupChecks.ports: false
You can also use "warn" as a value, which will do the check but not prevent startup.
When the check is done and not in warn-mode, it will print how to put into warn-mode, in case a user runs into a problem and needs to bypass the check.

This code is more robust than just the is_port_available code that apiml was using from the zwe codebase.
It attempts to make a tcp server to see if the permissions are correct, not just whether the port is free, and attempts to do so with the right jobname using _BPX_JOBNAME changing.

It is intended as a replacement of is_port_available and if merged, I would like apiml to stop using is_port_available since it is just then duplicate processing.

This PR also includes a manifest schema addition to have components/extensions tell us their likely jobname.
This could be helpful overall, but is used here to try to get the right jobname to check permissions of the bind operation.

…alidate bind on startup

Signed-off-by: 1000TurquoisePogs <[email protected]>
Signed-off-by: 1000TurquoisePogs <[email protected]>
@github-actions
Copy link

github-actions bot commented Aug 8, 2025

build 8418 FAILED.
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/16840006921

@MarkAckert
Copy link
Member

MarkAckert commented Aug 11, 2025

Two errors:

bind-test returned S0C4 when the port was already in use:

_BPX_JOBNAME=WHOSV ./bind-test --host 0.0.0.0 --port 7554
Error: Bind failed (rc=0x45b, rsn=0x744c7247)
Error: Port 7554 was already occupied
CEE3204S The system detected a protection exception (System Completion Code=0C4).
         From compile unit ZZOW11:../../deps/zowe-common-c/c/bpxskt.c/ at entry point socketClose at statement 1674 at compile unit offset +000000001A70C594 at entry offset +000000000000004C at address 000000001A70C594.
SIGSEGV

bind-test could not resolve the hostname for the Marist system:

_BPX_JOBNAME=WHOSV ./bind-test --host <zzowhost> --port 7550
Error: Could not resolve hostname from DNS. Is this a valid hostname for this system?
Error: Invalid address given for --host
ping <zzowhost>
CS 3.1: Pinging host <zzowhost> (<zzowip>)
Ping #1 response took 0.003 seconds. (3.378 milliseconds)

@1000TurquoisePogs
Copy link
Member Author

Great catch - I can't close a socket I didn't open, that must be the 0c4 cause.

@1000TurquoisePogs
Copy link
Member Author

1000TurquoisePogs commented Aug 11, 2025

About hostname not being able to be resolved - I am guessing zss has this same issue but its not seen because the servers are being instructed to try "0.0.0.0" instead of "". Seems like an issue but not one unique to this and therefore should be able to have this checker be no worse than zss.

Signed-off-by: 1000TurquoisePogs <[email protected]>
@github-actions
Copy link

github-actions bot commented Aug 11, 2025

build 8434 SUCCEEDED.
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/16891144549

@github-actions
Copy link

github-actions bot commented Aug 11, 2025

Test workflow 7181 is started.
Running install test: Convenience Pax
The zowe artifact being used by this test workflow: libs-snapshot-local/org/zowe/3.3.0-PR-4447/zowe-3.3.0-pr-4447-8434-20250811202507.pax
Running on machine: zzow10
Result: SUCCESS
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/16891268270

@github-actions
Copy link

github-actions bot commented Aug 11, 2025

build 8435 SUCCEEDED.
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/16891467213

@github-actions
Copy link

github-actions bot commented Aug 11, 2025

build 8436 SUCCEEDED.
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/16891509963

@github-actions
Copy link

github-actions bot commented Aug 11, 2025

Test workflow 7182 is started.
Running install test: Convenience Pax
The zowe artifact being used by this test workflow: libs-snapshot-local/org/zowe/3.3.0-PR-4447/zowe-3.3.0-pr-4447-8435-20250811203959.pax
Running on machine: zzow09
Result: SUCCESS
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/16891589160

@github-actions
Copy link

github-actions bot commented Aug 11, 2025

Test workflow 7183 is started.
Running install test: Convenience Pax
The zowe artifact being used by this test workflow: libs-snapshot-local/org/zowe/3.3.0-PR-4447/zowe-3.3.0-pr-4447-8436-20250811204320.pax
Running on machine: zzow10
Result: SUCCESS
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/16891661511

@github-actions
Copy link

github-actions bot commented Oct 15, 2025

build 8971 SUCCEEDED.
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/18535481601

@github-actions
Copy link

github-actions bot commented Oct 15, 2025

Test workflow 7649 is started.
Running install test: Convenience Pax
The zowe artifact being used by this test workflow: libs-snapshot-local/org/zowe/3.4.0-PR-4447/zowe-3.4.0-pr-4447-8971-20251015162436.pax
Running on machine: zzow10
Result: SUCCESS
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/18535712560


let myJobname = std.getenv('_BPX_JOBNAME');

common.printFormattedInfo(`ZWELS`, `zwe-validate-port-available`, `Checking ports of ${enabledComponents.length} enabled components`);
Copy link
Contributor

@Martin-Zeithaml Martin-Zeithaml Oct 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

zwe validate port bind -c /zowe/zowe.yaml
Bind succeeded (pointer=0x2D601098, rc=0x0, rsn=0x0)
Bind succeeded (pointer=0x2D601098, rc=0x0, rsn=0x0)
Bind succeeded (pointer=0x2D601098, rc=0x0, rsn=0x0)
Bind succeeded (pointer=0x2D601098, rc=0x0, rsn=0x0)
Bind succeeded (pointer=0x2D601098, rc=0x0, rsn=0x0)
Bind succeeded (pointer=0x3D601098, rc=0x0, rsn=0x0)
INFO (zwe-validate-port-available) Checking ports of 9 enabled components
INFO (zwe-validate-port-available) Zowe port bind validation passed.
  1. Should we move the Bind succeeded (pointer=0x...., rc=0x0, rsn=0x0) to trace?
  2. Should we state what was check? For example: components.zaas: Bind succeeded (pointer=0x...., rc=0x0, rsn=0x0)
  3. Checking ports of 9 enabled components will check (for this instance) 6 components, because explorers are skipped (no port). Should we inform about this? For example: components.explorer-jes: Bind skipped due to no port used

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will put the skip message under debug because it's more likely a user says 'why are things skipped?' than 'why is the number wrong?' - people ask about what they think are scary looking messages all the time.

…e about skips. Cleanup log boilerplate

Signed-off-by: 1000TurquoisePogs <[email protected]>
@github-actions
Copy link

github-actions bot commented Oct 16, 2025

build 8974 SUCCEEDED.
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/18559649704

@github-actions
Copy link

github-actions bot commented Oct 16, 2025

Test workflow 7653 is started.
Running install test: Convenience Pax
The zowe artifact being used by this test workflow: libs-snapshot-local/org/zowe/3.4.0-PR-4447/zowe-3.4.0-pr-4447-8974-20251016112959.pax
Running on machine: zzow10
Result: SUCCESS
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/18559809993

… action, dont, and do but only warn

Signed-off-by: 1000TurquoisePogs <[email protected]>
@github-actions
Copy link

github-actions bot commented Oct 22, 2025

build 8995 FAILED.
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/18713675563

Signed-off-by: 1000TurquoisePogs <[email protected]>
@github-actions
Copy link

github-actions bot commented Oct 22, 2025

build 8996 FAILED.
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/18714044828

Signed-off-by: 1000TurquoisePogs <[email protected]>
@github-actions
Copy link

github-actions bot commented Oct 22, 2025

build 8997 FAILED.
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/18714149849

@github-actions
Copy link

github-actions bot commented Oct 30, 2025

build 9043 FAILED.
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/18954440442

@github-actions
Copy link

github-actions bot commented Oct 31, 2025

build 9047 SUCCEEDED.
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/18975412527

@zowe-robot zowe-robot deployed to marist-zzow09 October 31, 2025 14:28 — with GitHub Actions Active
@github-actions
Copy link

github-actions bot commented Oct 31, 2025

Test workflow 7711 is started.
Running install test: Convenience Pax
The zowe artifact being used by this test workflow: libs-snapshot-local/org/zowe/3.4.0-PR-4447/zowe-3.4.0-pr-4447-9047-20251031142747.pax
Running on machine: zzow09
Result: SUCCESS
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/18975609868

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status
Status: No status

Development

Successfully merging this pull request may close these issues.

5 participants