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

Manage custom C4iDebugService.env file to store Debug Service configuration #2417

Merged
merged 3 commits into from
Dec 17, 2024

Conversation

sebjulliand
Copy link
Collaborator

Changes

Resolves #2416

Applying Debug Service's PTF resets the /QIBM/ProdData/IBMiDebugService folder, including the DebugService.env holding Code for IBM i debug service config changes.

Since Debug Service 2.0.1, it is possible to use a custom .env file the start script will load when starting the debug service.
To take advantage of this, Code for IBM i will create a copy of the /QIBM/ProdData/IBMiDebugService/bin/DebugService.env into /QIBM/UserData/IBMiDebugService/C4iDebugService.env when connecting to a system, if C4iDebugService.env doesn't exist.
/QIBM/ProdData/IBMiDebugService/bin/DebugService.env won't me changed anymore and only C4iDebugService.env will be updated and used by Code for IBM i.

Starting the Debug Service >= 2.0.1 will set the DEBUG_SERVICE_EXTERNAL_CONFIG_FILE env variable before running the start script.
When starting the Debug Service < 2.0.1, /QIBM/UserData/IBMiDebugService/C4iDebugService.env is copied and overwrites /QIBM/ProdData/IBMiDebugService/bin/DebugService.env (to mimic v 2.0.1 behavior).

How to test this PR

  1. Connect
  2. Check file /QIBM/UserData/IBMiDebugService/C4iDebugService.env has been created and is a copy of /QIBM/ProdData/IBMiDebugService/bin/DebugService.env
  3. Start the Debug Service

Checklist

  • have tested my change

Signed-off-by: Seb Julliand <sebjulliand@gmail.com>
Signed-off-by: Seb Julliand <sebjulliand@gmail.com>
Signed-off-by: Seb Julliand <sebjulliand@gmail.com>
@sebjulliand sebjulliand added enhancement New feature or request debug Debug client issue (IBM) labels Dec 13, 2024
@sebjulliand sebjulliand self-assigned this Dec 13, 2024
Copy link
Contributor

👋 A new build is available for this PR based on 54c159d.

@chrjorgensen
Copy link
Collaborator

chrjorgensen commented Dec 14, 2024

@sebjulliand The code changes worked on my systems running IBM i 7.5 and 7.3 with Debug Service 2.0.1 installed.

When I tested on my IBM i 7.4 system, I got the dreaded "self-signed certificate" error - and am currently struggling to fix this...

Looked good until this happened, though - but would like to have others (@worksofliam ? @Wright4i ?) test as well...

Copy link
Collaborator

@chrjorgensen chrjorgensen left a comment

Choose a reason for hiding this comment

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

@sebjulliand

Bad news - although my testing on IBM i 7.5 yesterday was succesful, the test fails today. I'm no longer able to start the debug service on IBM i... 😢

I tried to reset everything by

  • stop the debug service and debug server on IBM i
  • close VS Code
  • clear directory /QIBM/UserData/IBMIDEBUGSERVICE on IBM i
  • remove the certificate C:\Users\%UserID%\%HOSTNAME%_debug_service.crt on my PC
  • start VS Code
  • connect and reload server settings
  • create the debug certificates on request
  • start the debug server
  • start the debug service

I get the following error:

billede

billede

It did work yeaterday - only change I can see is that the IBM i Debug extension has been updated from v2.0.1 to v2.0.2...

😭

@chrjorgensen chrjorgensen self-requested a review December 17, 2024 11:00
Copy link
Collaborator

@chrjorgensen chrjorgensen left a comment

Choose a reason for hiding this comment

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

@sebjulliand Good news: I found the issue and it was not your code - of course! 😃

I had created the debug certificate on the installed C4i extension version 2.14.5 - not using the master branch of the code! 😢 When I instead used the master branch to create the certificates, it all worked - also on my IBM i 7.4 system! 😃

I did some additional testing, checking the use and copying of /QIBM/UserData/IBMIDEBUGSERVICE/C4iDebugService.env, and everything is fine. So I will approve this PR. 👏

Since there seems to be some incompatibilities with the current prerelease version of C4i and Debug service 2.0.1, I will create a new prerelease incorporating this PR as well.

@chrjorgensen chrjorgensen merged commit c26b07d into master Dec 17, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
debug Debug client issue (IBM) enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move certificate related settings out of DebugService.env
2 participants