-
Notifications
You must be signed in to change notification settings - Fork 157
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
Broken handling in run.sh
of persistence.json
provided as base64-encoded string via ENV_TOOL_INPUT
environment variable when running Docker fhir-persistence-schema
on PostgreSQL bug
#1802
Comments
I've updated the readme |
The analysis of the code and purpose of the lines is a bit 50/50 - part was correct - the last bit on the decoding is not. if you have a specific commandline you are using, and can share it, please let me know. |
In order to ease the testing I have created a very simple test fixture using Docker Compose. For that my local folder now contains the following files:
First I perform the test with a not base64-encoded holger@homer:~$ docker-compose down
holger@homer:~$ ENV_TOOL_INPUT=$(cat persistence.json) docker-compose up This works basically as expected except for the warning
Now I perform the test with a base64-encoded holger@homer:~$ docker-compose down
holger@homer:~$ ENV_TOOL_INPUT=$(cat persistence.json | base64 -w 0) docker-compose up Well, this does not really work as expected and so all I get is this:
But if I now change in echo "${TOOL_INPUT_USED}" | /opt/schematool/jq -r '.' > /opt/schematool/workarea/persistence.json to echo "${TOOL_INPUT_USED}" | /opt/schematool/jq -rR '@base64d' > /opt/schematool/workarea/persistence.json
then I get again the expected result:
So I am again sorry but in the end I am still having problems in understanding your code in |
ibm-fhir-schematool_1 | base64: invalid input <-- this as expected, I test the input. I don't intend on fixing that as it is working as designed. The problem is I am checking for a cert base64 which is absent when you are calling it not as intended or designed. I'll make a slight change to accommodate your use case, however I cannot modify it too much for my usecase. |
I am sorry yet again but I do not understand what you mean with "I am checking for a cert base64 " and "you are calling it not as intended or designed" there... I am just doing exactly what is described at https://hub.docker.com/r/ibmcom/ibm-fhir-schematool for onboarding only wrapping the normal Docker run procedure in a Docker Compose so that I can quickly overwrite the Therefore I could also not use Docker Compose but rather simply create the Docker image containing your latest ...or do you mean something completely different with what you say. BTW: Your latest |
I'll clean it up. I'll clarify the use-case the use in the documentation, however you aren't using it exactly as intended. I'm going to once again, make a slight modification, and I will make that change. |
Yes, it would be great if you could clarify the really intended use: I believed that the use case would be that you have an empty PostgreSQL database and the (fitting) |
That's the correct use case. The intended use of the variable is incorrect. I need to re-read your comments, and address in the future, as it doesn't match my use and tests in our offering. |
Yes, it would be great if you re-read my comments... 😄 Well, I do not understand when you say "The intended use of the variable is incorrect." as I am just doing what is written at https://hub.docker.com/r/ibmcom/ibm-fhir-schematool. On that page it says under Use:
So I obviously do not go for "mounted into the workarea folder" but for "set the variables as Environment Variables". Now, under Environment Variables it states:
...and then under Configuration file - persistence.json for Mac :
...and for Linux:
Therefore I am following exactly what is written on that page and I am using the variable But if what is described on your page there is not the actually intended use of the variable can you please explain what the intended use of the variable really is? |
You seem to be doing something slightly different, as I do not hit this error in our test case and our OpenShift/Kubernetes cluster where we do the steps as documented. I'll test exactly what you are doing when I can. Once again, I am very much attempting to accommodate what you are intending to do. |
Well, thanks for your help but perhaps you are doing something slightly different as you are performing your tests on a OpenShift/Kubernetes cluster... 🙂 I am just performing my tests following your own documentation for Mac and Linux at https://hub.docker.com/r/ibmcom/ibm-fhir-schematool on macOS Big Sur 11.0.1 with Docker Engine 19.03.13 and Ubuntu Server LTS 20.04.1 with Docker Engine 19.03.5. I mean there have been quite some (rather obvious) bugs even in the released versions of the Dockerized |
I have used it also in docker-compose and on my local machine with docker run. |
Ok, I see! ...but then I re-ask my question from above: But if what is described on your [documentation] page there is not the actually intended use of the variable can you please explain what the intended use of the variable really is? Or to speed up things... Can you perhaps simply drop here the configuration files and the command lines which do work for you on your local machine? |
Here are the primary files - https://github.com/IBM/FHIR/tree/master/fhir-install/src/main/docker/ibm-fhir-schematool/examples/postgres I added this... https://github.com/IBM/FHIR/blob/master/fhir-install/src/main/docker/ibm-fhir-schematool/DEVELOPMENT.md I didn't keep it updated as I'll further update when I can |
I've added some tests and cleaned up the code. it works for your use and my use. I'm not sure when I regressed the code behavior, but I did, I've fixed it, and your use-case turned out to be my use-case (just behaves slightly differently) |
Signed-off-by: Paul Bastide <pbastide@us.ibm.com>
(If you do not have time to read the whole rant then simply scroll down to the end of this comment for a properly working solution.) Thank you very much for trying fixing this bug but I must admit that I am not really impressed by the way you handled this issue. I am sorry if it now sounds harsh but your comments and replies make me feel that you might not be working with the necessary professional diligence but perhaps rather acting somewhat haphazardly. So I have my slight doubts that it just pure coincidence that (only) yesterday the necessary test cases appear in the GitHub repository and that exactly then you discovered that our use cases are actually the same. ...but the issue is not 100% fixed - see below. Well, when you say that you are not sure when you regressed the code behavior, then why don't you simply look at the Git history of function process_cmd_properties {
if [ ! -z "${TOOL_INPUT_USED}" ]
then
OS_TYPE="$(uname -s)"
case "${OS_TYPE}" in
Linux*) echo ${TOOL_INPUT_USED} | base64 -d > ${TOOL_INPUT_FILE};;
Darwin*) echo ${TOOL_INPUT_USED} | base64 --decode > ${TOOL_INPUT_FILE};;
*) exit -1;;
esac
fi
# Take the commandline and dump it out to the temporary inputfile.
echo -n "" > ${TOOL_INPUT_FILE}
for TOOL_ARG in ${TOOL_ARGS}
do
echo "${TOOL_ARG}" | sed 's|--||g' >> ${TOOL_INPUT_FILE}
done
} First of all you do not need the distinction there between So the changes in your next commit on 13.11.2020 (f554c12) definitely make sense except for the fact that you still empty the file ...
set +o errexit
set +o pipefail
echo ${TOOL_INPUT_USED} | base64 -d > ${TOOL_INPUT_FILE}
RC=$?
if [ "${RC}" != '0' ]
then
echo ${TOOL_INPUT_USED} > ${TOOL_INPUT_FILE}
fi
set -o errexit
set -o pipefail
... Your commit on 13.11.2020 (c5b3af8) was the base for my initial bug report...
So after looking closer again at the above Actually I do not understand why you need to call In the Finally, your latest commit from today (e6dc655) things now work for base64-encoded JSON but you kill the functionality to use not base64-encoded JSON. When you write that there was an error handling, what are you referring to? In your code before the call to So to conclude all this lamenting here you have a working function function process_cmd_properties {
if [ ! -z "${TOOL_INPUT_USED}" ]
then
OS_TYPE="$(uname -s)"
case "${OS_TYPE}" in
Linux*|Darwin*)
# Since the pipe is used in a couple places where it can fail
# we don't want it to kill this script, and have overriden (temporarily)
# the fail on pipe and errexit, we'll control the exits.
set +o errexit
set +o pipefail
local file=/opt/schematool/workarea/persistence.json
if [ ! -f ${file} ]
then
base64 -d > ${file} <<< ${TOOL_INPUT_USED}
if [ ! -s ${file} ]
then
echo ${TOOL_INPUT_USED} > ${file}
fi
fi
set -o errexit
set -o pipefail
;;
*)
exit 1
;;
esac
fi
# Take the commandline and dump it out to the temporary inputfile.
echo -n "" > ${TOOL_INPUT_FILE}
for TOOL_ARG in ${TOOL_ARGS}
do
echo "${TOOL_ARG}" | sed 's|--||g' >> ${TOOL_INPUT_FILE}
done
} |
I appreciate your passion and hard work and thought behind each one of these issues. I tried to replicate your issues as close as possible and bring forward my internal test-cases (originally skipped as I hard coded the tests for my use-case). I hope my latest commit addresses your concerns. I am happy to continue the discussion. |
Well, I am sorry but I am a bit at a loss as to what else I could possibly discuss here as this seems to be not so fruitful. I mean, even in the latest version of Also you keep your duplicated code for Therefore, your last commit did not really address my concerns at all or even calm them down. On the contrary, after this discussion I am deeply concerned that the code quality of the IBM FHIR server in general as well as its development/testing process/procedures are not optimal and flawed as well. Is there are possibility to escalate this issue in order for it to be checked and solved on a higher/lead level? |
The bugs you are producing and how are fixing those bugs is quite actually revealing and sheds quite some light on how obviously "well" you personally follow standard quality procedures when it comes to code quality and testing: Looking at So in your first pushed commit of both files you had Then until today you had ...but wait a minute, oooops, you performed the fix only in Well, at least you have finally changed today the ...but of course your first shot at setting that was not so correct as you had ...and while I am at it: For PostgreSQL the element So where is your (personal) quality control? Does nobody check what you do? The way you seem to do your work here is actually very scary to me... |
@holger-stenzhorn Thank you for the detailed information that you have provided on this issue. This is an open source project. It is free software. Support is provided on a best effort basis. As you can see by the activity in our repository, this issue is not the only thing that Paul is working on. Clearly there are some nuances to this particular code that will require dedicated focus beyond what we can currently provide. We do, however, accept PRs from external contributors. If you have something working that fixes the issues you are seeing, then please put it into a pull request. |
@JohnTimm Thank you very much for chiming in here! I totally understand that this is an open source project and it is free software - yet it is obviously not a "toy project" but rather backed and financed by a rather big company who uses this software - correct me if I am wrong - in its commercial offering IBM Watson Health. So for me this is in the same spirit as, just to name one example, the open source KeyCloak from your subsidiary RedHat which is used in many mission-critical environments. Well, for us concretely, IBM FHIR Server is supposed to be feed with clinical data - so quite a delicate and valuable asset - and this is quite obviously the same use case for pretty much all users of your software. Hence, I am not asking for any support at all but rather for that the quality necessary for such a use is properly ensured. Now, when I see how your staff is performing in such a haphazardous fashion at this particular piece of code and you suggest that he is working in many other places within the codebase too, then how can I rest assured that his coding there is on a level appropriate for that use case? In this concrete case at hand, we are also not talking about nuances, i.e. matters of taste and style, but rather about the fact that the things produced by your staff did not work properly at all - and this in publicly released versions of the tool. |
@holger-stenzhorn Some parts of the codebase are significantly more mature than others. What you are seeing, in this particular instance, is an immature part of the codebase getting exercised and bugs (quite expectedly) are getting uncovered. What you are also seeing is a very busy member of our team attempting to respond and support your effort in using this immature code while juggling other work. All software will have bugs -- regardless the size of the company supporting it, whether it is a "toy project" or whether it is "mission-critical". The fact that you are uncovering issues is a good thing and will only help us to improve the quality of our codebase. Going back what I said in my earlier comment -- we encourage and appreciate all external contributions. Please feel free to submit a PR with what you have working. Regarding your comment about "released software", I will take this as an action to clearly identify less mature / more experimental capabilities that are included in our releases. |
@JohnTimm Thank you very much again for your reply! Could you perhaps point me to a warning in the release notes, the tool's page on Docker Hub, or somewhere else which tells me as a (regular) user that the officially released version of this tool is in an immature state and should therefore not be used in production environments? Well, it is of course an obvious truism that any kind of software - even that developed by large, established companies - contains bugs, but that "killer argument" is too often used as an excuse to distract from one's own concrete deficiencies. So have you actually looked at the specific commits of your staff? Most bugs found in his code are there not because the code is exorbitantly complicated or complex but only because of the necessary diligence seems to be missing: If he would simply read a bit more properly and pay a little more attention to the "small print" then he would not have to redo and fix things over and over again - and in the end that means more time and less stress. Makes sense? 😄 I will do a pull request about this particular change tomorrow. ...but I am already expecting some interesting, lengthy discussions from especially those who seem to have no time. 😏 |
We do not currently have such a warning. My earlier comment was intended to indicate that I will take an action to make sure to include such a warning in the future so that it is abundantly clear which capabilities are in the "more experimental / less mature" category. |
* Enable OpenLiberty override the fhiropenapi functionality #1760 Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * Issue #1780 - add compartment search/search parameter config section Signed-off-by: Mike Schroeder <mschroed@us.ibm.com> * issue #1789 refresh-tenants does not handle Db2 multi-tenant/multi-schema scenarios Signed-off-by: Robin Arnold <robin.arnold23@ibm.com> * Invalid SQL object name `--pool-size` exception when running Docker `fhir-persistence-schema` on PostgreSQL #1797 Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * Misleading error messages when using command line parameters and not `persistence.json` for Docker `fhir-persistence-schema` #1796 Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * Schema defined for `fhir` in `persistence.json` not used correctly when running Docker `fhir-persistence-schema` #1795 Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * doc: update must gather to include open shift details Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * use the fhiruser password from helm (set by overrides from KeyProtect) Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com> * Fix the definition for List-identifier search A workaround for https://jira.hl7.org/browse/FHIR-29937 Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com> * #1802 Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * #1802 Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * Fix up the Must Gather Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * IBM FHIR Server audit does not log bundles correctly. #1803 Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * update documentation for the mustgather Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * fix: per code review changed the compare, and added an additional ignore for the metadata endpoints Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * Update fhir-server/src/main/java/com/ibm/fhir/server/util/RestAuditLogger.java Signed-off-by: Paul Bastide <pbastide@us.ibm.com> Co-authored-by: Lee Surprenant <lmsurpre@us.ibm.com> * doc: compilation errors are now fixed Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * doc: compilation errors are now fixed Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * Add tests case and fixes for #1795 Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * Add tests case and fixes for #1795 Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * Add tests case and fixes for #1795 Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * Add tests case and fixes for #1796 Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * Add tests case and fixes for #1797 Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * Add tests for cp and #1802 Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * fix: #1808 Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * Add tests for plain and base64 encoded environment variables Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * fix per comments in code review and issue Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * Prevent unauthorized reads before they happen This prevents us from leaking information about what patient resources exist / don't exist on the system, which was deemed as useful in case an implementer uses sensitive data for the Resource.id of the Patient resources (which still isn't advised). Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com> * Prevent unauthorized vread and history operations against Patient too Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com> * doc: adding code of conduct md file to root of repository Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * doc: update to clarify the experimental use of the ibm-fhir-schematool Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * doc: update to clarify the experimental use of the ibm-fhir-schematool Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * doc: adding code of conduct md file to root of repository Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * add communication method Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com> * Audit Refactoring #1542 - Refactor to separate Configuration, Mapping and AuditService - Configuration to use EventStreams Binding by default - Add a MapperFactory to split between cadf and auditevent types - AuditEventMapper - Wraps the AuditLogEntry into AuditEvent format - CADFMapper - Wraps the AuditLogEntry into CADF format - Audit Service is now KafkaService, NoOpService separating the Streaming framework from the mapping actions. - Removed duplicate code for Event/EventStrams processing - Add Test Coverage for Uncovered Classes Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * Clean up spare printStackTrace Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * update the documentation for fhir-audit Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * updates per team code review - Change NoOp to Nop Service - Remove references to WHC/Disabled - Changed and clarified package names - Changed references to specific default places to generic/unknown places (e.g. dallas to unknown) - added examples for audit from config and audit from environment Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * issue #1818 reindex resource selection update slows down as reindex progresses Signed-off-by: Robin Arnold <robin.arnold23@ibm.com> * updates per team code review - changed package names to remove logging.api and .model (reconciling it to a flatter structure) Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * update docs Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * change formatting slightly on MapperFactory Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * fix: it tests were not running for drug formulary and c4bb Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * fix incorrect variable in minor startup log message Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com> * Convert Strings to Constants for Kafka Key-Value in Properties objects - Per Code Review with Robin Arnold Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * Code Review for FHIR Audit - CadfEvent doesn't write out target - Addresses Written Twice in CadfResource Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * Added Test for FHIR Audit so it doesn't have multiple address blocks Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * update docs Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * Removed auditLogService <extension url="http://ibm.com/fhir/extension/auditLogProperties"> Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * fix: referenced license was incorrect Signed-off-by: Paul Bastide <pbastide@us.ibm.com> Co-authored-by: Paul Bastide <pbastide@us.ibm.com> Co-authored-by: Mike Schroeder <mschroed@us.ibm.com> Co-authored-by: Robin Arnold <robin.arnold23@ibm.com> Co-authored-by: Lee Surprenant <lmsurpre@us.ibm.com> Co-authored-by: Michael W Schroeder <66479070+michaelwschroeder@users.noreply.github.com>
* Enable OpenLiberty override the fhiropenapi functionality #1760 Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * Issue #1780 - add compartment search/search parameter config section Signed-off-by: Mike Schroeder <mschroed@us.ibm.com> * issue #1789 refresh-tenants does not handle Db2 multi-tenant/multi-schema scenarios Signed-off-by: Robin Arnold <robin.arnold23@ibm.com> * Invalid SQL object name `--pool-size` exception when running Docker `fhir-persistence-schema` on PostgreSQL #1797 Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * Misleading error messages when using command line parameters and not `persistence.json` for Docker `fhir-persistence-schema` #1796 Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * Schema defined for `fhir` in `persistence.json` not used correctly when running Docker `fhir-persistence-schema` #1795 Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * doc: update must gather to include open shift details Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * use the fhiruser password from helm (set by overrides from KeyProtect) Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com> * Fix the definition for List-identifier search A workaround for https://jira.hl7.org/browse/FHIR-29937 Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com> * #1802 Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * #1802 Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * Fix up the Must Gather Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * IBM FHIR Server audit does not log bundles correctly. #1803 Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * update documentation for the mustgather Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * fix: per code review changed the compare, and added an additional ignore for the metadata endpoints Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * Update fhir-server/src/main/java/com/ibm/fhir/server/util/RestAuditLogger.java Signed-off-by: Paul Bastide <pbastide@us.ibm.com> Co-authored-by: Lee Surprenant <lmsurpre@us.ibm.com> * doc: compilation errors are now fixed Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * doc: compilation errors are now fixed Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * Add tests case and fixes for #1795 Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * Add tests case and fixes for #1795 Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * Add tests case and fixes for #1795 Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * Add tests case and fixes for #1796 Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * Add tests case and fixes for #1797 Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * Add tests for cp and #1802 Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * fix: #1808 Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * Add tests for plain and base64 encoded environment variables Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * fix per comments in code review and issue Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * Prevent unauthorized reads before they happen This prevents us from leaking information about what patient resources exist / don't exist on the system, which was deemed as useful in case an implementer uses sensitive data for the Resource.id of the Patient resources (which still isn't advised). Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com> * Prevent unauthorized vread and history operations against Patient too Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com> * doc: adding code of conduct md file to root of repository Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * doc: update to clarify the experimental use of the ibm-fhir-schematool Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * doc: update to clarify the experimental use of the ibm-fhir-schematool Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * doc: adding code of conduct md file to root of repository Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * add communication method Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com> * Audit Refactoring #1542 - Refactor to separate Configuration, Mapping and AuditService - Configuration to use EventStreams Binding by default - Add a MapperFactory to split between cadf and auditevent types - AuditEventMapper - Wraps the AuditLogEntry into AuditEvent format - CADFMapper - Wraps the AuditLogEntry into CADF format - Audit Service is now KafkaService, NoOpService separating the Streaming framework from the mapping actions. - Removed duplicate code for Event/EventStrams processing - Add Test Coverage for Uncovered Classes Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * Clean up spare printStackTrace Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * update the documentation for fhir-audit Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * updates per team code review - Change NoOp to Nop Service - Remove references to WHC/Disabled - Changed and clarified package names - Changed references to specific default places to generic/unknown places (e.g. dallas to unknown) - added examples for audit from config and audit from environment Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * issue #1818 reindex resource selection update slows down as reindex progresses Signed-off-by: Robin Arnold <robin.arnold23@ibm.com> * updates per team code review - changed package names to remove logging.api and .model (reconciling it to a flatter structure) Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * update docs Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * change formatting slightly on MapperFactory Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * fix: it tests were not running for drug formulary and c4bb Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * fix incorrect variable in minor startup log message Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com> * Convert Strings to Constants for Kafka Key-Value in Properties objects - Per Code Review with Robin Arnold Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * Update to 4.6.0-SNAPSHOT Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * Code Review for FHIR Audit - CadfEvent doesn't write out target - Addresses Written Twice in CadfResource Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * Added Test for FHIR Audit so it doesn't have multiple address blocks Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * update docs Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * Removed auditLogService <extension url="http://ibm.com/fhir/extension/auditLogProperties"> Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * fix: referenced license was incorrect Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * Package name consistency issue after Code Review of FHIR-Audit Config Examples Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * issue #1831 - fix search parameter filtering issue Signed-off-by: Mike Schroeder <mschroed@us.ibm.com> * issue #1739 - Update _include and _revinclude parameter checking Signed-off-by: Troy Biesterfeld <tbieste@us.ibm.com> * Update .index.json Warning about invalid entry when discovering HREX profile. An example snuck into the .index.json. Signed-off-by: Paul Bastide <pbastide@us.ibm.com> * update changelog.md Signed-off-by: Paul Bastide <pbastide@us.ibm.com> Co-authored-by: Paul Bastide <pbastide@us.ibm.com> Co-authored-by: Mike Schroeder <mschroed@us.ibm.com> Co-authored-by: Robin Arnold <robin.arnold23@ibm.com> Co-authored-by: Lee Surprenant <lmsurpre@us.ibm.com> Co-authored-by: Michael W Schroeder <66479070+michaelwschroeder@users.noreply.github.com> Co-authored-by: Troy Biesterfeld <tbieste@us.ibm.com>
I confirmed that the README was updated based on the original comments, and verified that the usage of TOOL_INPUT_FILE vs TOOL_INPUT_USED in the process_cmd_properties function was updated as well. |
Describe the bug
When running Docker
fhir-persistence-schema
on PostgreSQL the handling inrun.sh
ofpersistence.json
provided as base64-encoded string viaENV_TOOL_INPUT
environment variable is broken.To Reproduce
Broken handling in
run.sh
ofpersistence.json
provided as base64-encodedENV_TOOL_INPUT
environment variable (This bug report is based on branchissue-1797a
.)Before actually going into the issue(s) in
run.sh
there is already an issue in the README found at https://hub.docker.com/r/ibmcom/ibm-fhir-schematool where it saysBesides the unnecessary but unproblematic mention of
time
, the name of the Docker image is incorrect and also to make the base64 encoding work on Linux systems the option-w 0
needs to be provided to disable line wrapping. Hence on Linux it should readdocker run --env ENV_TOOL_INPUT=$(cat persistence.json | base64 -w 0) ibm/ibm-fhir-schematool:latest
and on Mac (simply)
docker run --env ENV_TOOL_INPUT=$(cat persistence.json | base64) ibm/ibm-fhir-schematool:latest
But now coming to the actual
run.sh
issue(s) which can be found in the functionprocess_cmd_properties
:At the top of the function
tests (correctly) whether the
persistence.json
is provided as string in the environment variableTOOL_INPUT_USED
.Looking at the following Linux "branch" the line
below tests if the file
persistence.json
exists at the given location but that file cannot exist at that point in time (if not put there manually before somehow e.g. via a Docker volume).So this also logically contradicts the use of
TOOL_INPUT_USED
holding the content ofpersistence.json
as a string and the linewhich only then creates that file.
(Sidenote regarding the Darwin "branch":
is also buggy because
TOOL_INPUT_FILE
just holds the path to the (temporary) file and so it should read here too)
In the next line
RC=$(cat "${TOOL_INPUT_FILE}" | wc -l )
the result will always be
0
as no content has been written to the fileTOOL_INPUT_FILE
but rather (in the line above) to/opt/schematool/workarea/persistence.json
.(Also an issue in the Darwin "branch": Here it reads
RC=$(cat "${TOOL_INPUT_USED}" | wc -l )
but it should not be
TOOL_INPUT_USED
butTOOL_INPUT_FILE
- well - if the latter would really contain thepersistence.json
.)Now there is the line
which breaks for any base64-encoded string in
TOOL_INPUT_USED
and therefore should rather readBut then: Why is there actually the line
before ?
I am terribly sorry if my "analysis" of the code is wrong but if it is correct then it would be great if it would be fixed... :-)
Expected behavior
n/a
Additional context
n/a
The text was updated successfully, but these errors were encountered: