You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kie.apache.org by "baldimir (via GitHub)" <gi...@apache.org> on 2025/11/05 13:55:08 UTC
[PR] [kogito-runtimes#4118] Do not share exception information directly in the logs. [incubator-kie-kogito-runtimes]
baldimir opened a new pull request, #4119:
URL: https://github.com/apache/incubator-kie-kogito-runtimes/pull/4119
Resolves https://github.com/apache/incubator-kie-kogito-runtimes/issues/4118
Removes the direct Exception messages from the user response.
<details>
<summary>
How to replicate CI configuration locally?
</summary>
Build Chain tool does "simple" maven build(s), the builds are just Maven commands, but because the repositories relates and depends on each other and any change in API or class method could affect several of those repositories there is a need to use [build-chain tool](https://github.com/kiegroup/github-action-build-chain) to handle cross repository builds and be sure that we always use latest version of the code for each repository.
[build-chain tool](https://github.com/kiegroup/github-action-build-chain) is a build tool which can be used on command line locally or in Github Actions workflow(s), in case you need to change multiple repositories and send multiple dependent pull requests related with a change you can easily reproduce the same build by executing it on Github hosted environment or locally in your development environment. See [local execution](https://github.com/kiegroup/github-action-build-chain#local-execution) details to get more information about it.
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] [kogito-runtimes#4118] Do not share exception information directly in the logs. [incubator-kie-kogito-runtimes]
Posted by "kie-ci3 (via GitHub)" <gi...@apache.org>.
kie-ci3 commented on PR #4119:
URL: https://github.com/apache/incubator-kie-kogito-runtimes/pull/4119#issuecomment-3496687751
**PR job** `#2` was: **UNSTABLE**
Possible explanation: This should be test failures
<details>
<summary><b>Reproducer</b></summary>
build-chain build full_downstream -f 'https://raw.githubusercontent.com/${AUTHOR:apache}/incubator-kie-kogito-pipelines/${BRANCH:main}/.ci/buildchain-config-pr-cdb.yaml' -o 'bc' -p apache/incubator-kie-kogito-runtimes -u https://github.com/apache/incubator-kie-kogito-runtimes/pull/4119 --skipParallelCheckout
NOTE: To install the build-chain tool, please refer to https://github.com/kiegroup/github-action-build-chain#local-execution
</details>
Please look here: https://ci-builds.apache.org/job/KIE/job/kogito/job/main/job/pullrequest_jobs/job/kogito-runtimes-pr/job/PR-4119/2/display/redirect
**Test results:**
- PASSED: 3682
- FAILED: 1
Those are the test failures:
<details>
<summary><a href="https://ci-builds.apache.org/job/KIE/job/kogito/job/main/job/pullrequest_jobs/job/kogito-runtimes-pr/job/PR-4119/2/testReport/org.kie.kogito.addons.quarkus.kubernetes/ConfigValueExpanderIT/test/">org.kie.kogito.addons.quarkus.kubernetes.ConfigValueExpanderIT.test</a></summary>
java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors<br/> [error]: Build step io.quarkus.devservices.keycloak.KeycloakDevServicesProcessor#startKeycloakContainer threw an exception: java.lang.RuntimeException: org.testcontainers.containers.ContainerLaunchException: Container startup failed for image quay.io/keycloak/keycloak:26.1.3<br/> at io.quarkus.devservices.keycloak.KeycloakDevServicesProcessor.startKeycloakContainer(KeycloakDevServicesProcessor.java:250)<br/> at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:732)<br/> at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:856)<br/> at io.quarkus.builder.BuildContext.run(BuildContext.java:255)<br/> at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)<br/> at org.jboss.threads.EnhancedQueueExecutor$Task.doRunWith(EnhancedQueueExecutor.java:2675)<br/> at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQu
eueExecutor.java:2654)<br/> at org.jboss.threads.EnhancedQueueExecutor.runThreadBody(EnhancedQueueExecutor.java:1627)<br/> at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1594)<br/> at java.base/java.lang.Thread.run(Thread.java:840)<br/> at org.jboss.threads.JBossThread.run(JBossThread.java:499)<br/>Caused by: org.testcontainers.containers.ContainerLaunchException: Container startup failed for image quay.io/keycloak/keycloak:26.1.3<br/> at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:346)<br/> at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:317)<br/> at io.quarkus.devservices.keycloak.KeycloakDevServicesProcessor.lambda$startContainer$4(KeycloakDevServicesProcessor.java:421)<br/> at java.base/java.util.Optional.orElseGet(Optional.java:364)<br/> at io.quarkus.devservices.keycloak.KeycloakDevServicesProcessor.startContainer(KeycloakDevServicesProcessor.java:447)<br/> at io.quarkus.devser
vices.keycloak.KeycloakDevServicesProcessor.startKeycloakContainer(KeycloakDevServicesProcessor.java:200)<br/> ... 10 more<br/>Caused by: org.rnorth.ducttape.RetryCountExceededException: Retry limit hit with exception<br/> at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:88)<br/> at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:331)<br/> ... 15 more<br/>Caused by: org.testcontainers.containers.ContainerLaunchException: Could not create/start container<br/> at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:551)<br/> at org.testcontainers.containers.GenericContainer.lambda$doStart$0(GenericContainer.java:341)<br/> at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:81)<br/> ... 16 more<br/>Caused by: org.testcontainers.containers.ContainerLaunchException: Timed out waiting for log output matching '.*Keycloak.*started.*'<br/> at org.testcontainers.containers.wait
.strategy.LogMessageWaitStrategy.waitUntilReady(LogMessageWaitStrategy.java:47)<br/> at org.testcontainers.containers.wait.strategy.AbstractWaitStrategy.waitUntilReady(AbstractWaitStrategy.java:52)<br/> at org.testcontainers.containers.GenericContainer.waitUntilContainerStarted(GenericContainer.java:904)<br/> at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:487)<br/> ... 18 more<br/>
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] [kogito-runtimes#4118] Do not share exception information directly in the logs. [incubator-kie-kogito-runtimes]
Posted by "gitgabrio (via GitHub)" <gi...@apache.org>.
gitgabrio commented on code in PR #4119:
URL: https://github.com/apache/incubator-kie-kogito-runtimes/pull/4119#discussion_r2494992236
##########
addons/common/process-instance-migration/src/main/java/org/kie/kogito/process/migration/BaseProcessInstanceMigrationResource.java:
##########
@@ -63,7 +63,7 @@ public T doMigrateAllInstances(String processId, ProcessMigrationSpec migrationS
message.put("numberOfProcessInstanceMigrated", numberOfProcessInstanceMigrated);
return buildOkResponse(message);
} catch (Exception e) {
- return badRequestResponse(e.getMessage());
+ return badRequestResponse("An exception occurred during process instances migration. Please check the logs for more information.");
Review Comment:
Same as before
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] [kogito-runtimes#4118] Do not share exception information directly in the logs. [incubator-kie-kogito-runtimes]
Posted by "baldimir (via GitHub)" <gi...@apache.org>.
baldimir commented on PR #4119:
URL: https://github.com/apache/incubator-kie-kogito-runtimes/pull/4119#issuecomment-3495435461
The Jenkins job failed with the usual MongoDB failures due to the job running the PR check getting the machine that doesn't support MongoDB. Can be ignored.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] [kogito-runtimes#4118] Do not share exception information directly in the logs. [incubator-kie-kogito-runtimes]
Posted by "baldimir (via GitHub)" <gi...@apache.org>.
baldimir commented on code in PR #4119:
URL: https://github.com/apache/incubator-kie-kogito-runtimes/pull/4119#discussion_r2497747407
##########
addons/common/process-instance-migration/src/main/java/org/kie/kogito/process/migration/BaseProcessInstanceMigrationResource.java:
##########
@@ -50,7 +50,7 @@ public T doMigrateInstance(String processId, ProcessMigrationSpec migrationSpec,
message.put("processInstanceId", processInstanceId);
return buildOkResponse(message);
} catch (Exception e) {
- return badRequestResponse(e.getMessage());
+ return badRequestResponse("An exception occurred during migration of a process instance. Please check the logs for more information.");
Review Comment:
There should be ideally a proper exception system implemented. Currently, we catch Exception class (so whatever is thrown) and put the exception message into the response for the user. This is highly risky from security perspective as the exceptions could contain sensitive information and not everything should be shared directly to the user, as the user could be some malicious entity.
##########
addons/common/process-instance-migration/src/main/java/org/kie/kogito/process/migration/BaseProcessInstanceMigrationResource.java:
##########
@@ -63,7 +63,7 @@ public T doMigrateAllInstances(String processId, ProcessMigrationSpec migrationS
message.put("numberOfProcessInstanceMigrated", numberOfProcessInstanceMigrated);
return buildOkResponse(message);
} catch (Exception e) {
- return badRequestResponse(e.getMessage());
+ return badRequestResponse("An exception occurred during process instances migration. Please check the logs for more information.");
Review Comment:
There should be ideally a proper exception system implemented. Currently, we catch Exception class (so whatever is thrown) and put the exception message into the response for the user. This is highly risky from security perspective as the exceptions could contain sensitive information and not everything should be shared directly to the user, as the user could be some malicious entity.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] [kogito-runtimes#4118] Do not share exception information directly in the logs. [incubator-kie-kogito-runtimes]
Posted by "gitgabrio (via GitHub)" <gi...@apache.org>.
gitgabrio commented on code in PR #4119:
URL: https://github.com/apache/incubator-kie-kogito-runtimes/pull/4119#discussion_r2494990704
##########
addons/common/process-instance-migration/src/main/java/org/kie/kogito/process/migration/BaseProcessInstanceMigrationResource.java:
##########
@@ -50,7 +50,7 @@ public T doMigrateInstance(String processId, ProcessMigrationSpec migrationSpec,
message.put("processInstanceId", processInstanceId);
return buildOkResponse(message);
} catch (Exception e) {
- return badRequestResponse(e.getMessage());
+ return badRequestResponse("An exception occurred during migration of a process instance. Please check the logs for more information.");
Review Comment:
HI @baldimir
I see the logic, but if an exception is thrown, and we completely hide it here, how could we know what happened ? Sorry, probably I miss important details of the context
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] [kogito-runtimes#4118] Do not share exception information directly in the logs. [incubator-kie-kogito-runtimes]
Posted by "baldimir (via GitHub)" <gi...@apache.org>.
baldimir merged PR #4119:
URL: https://github.com/apache/incubator-kie-kogito-runtimes/pull/4119
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org