Stream: IG creation
Topic: sample-ig - _updatePublisher failure
John Moehrke (Sep 11 2019 at 21:25):
When I try to do the first act (_updatePublisher) after cloning the sample-ig, I get failures... ---- Is this a Windows 7 issue?
C:\Users\john.moehrke\Git\sample-ig>_updatePublisher
A subdirectory or file input-cache already exists.
"Downloading most recent publisher - it's ~100 MB, so this may take a bit
Exception calling "DownloadFile" with "2" argument(s): "The underlying connecti
on was closed: An unexpected error occurred on a send."
At line:1 char:47
+ (new-object System.Net.WebClient).DownloadFile <<<< ("https://fhir.github.io/
latest-ig-publisher/org.hl7.fhir.publisher.jar","input-cache\org.hl7.fhir.publi
sher.jar")
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException
"Done"
Press any key to continue . . .sample-ig - getting started
Grahame Grieve (Sep 11 2019 at 21:42):
typically this is a network access issue
John Moehrke (Sep 12 2019 at 14:50):
yet I could put that http GET into my browser and pull it without issue. While still the bat still failed.
Lloyd McKenzie (Sep 12 2019 at 18:08):
Grahame had the same issue. I think there may be certain security policies in Windows that keep that code from working. I'm not enough of a Windows expert to know how to do a command-prompt download from a website in some other way though.
Jose Costa Teixeira (Sep 12 2019 at 18:28):
@John Moehrke can you try this and see if it works? in a command line anywhere, run
bitsadmin /transfer "Get IG Publisher" https://fhir.github.io/latest-ig-publisher/org.hl7.fhir.publisher.jar %cd%\org.hl7.fhir.publisher.jar
John Moehrke (Sep 12 2019 at 18:31):
I get this
DISPLAY: 'Get IG Publisher' TYPE: DOWNLOAD STATE: ERROR
PRIORITY: NORMAL FILES: 0 / 1 BYTES: 0 / UNKNOWN
Unable to complete transfer.
ERROR FILE: https://fhir.github.io/latest-ig-publisher/org.hl7.fhir.publishe
ERROR CODE: 0x80072f7d - An error occurred in the secure channel support
ERROR CONTEXT: 0x00000005 - The error occurred while the remote file was being
C:\Users\john.moehrke\Git\sample-ig>
Jose Costa Teixeira (Sep 12 2019 at 18:33):
seems a network issue indeed...
https://www.drivethelife.com/windows-10/fix-microsoft-store-error-code-0x80072f7d.html
Grahame Grieve (Sep 12 2019 at 18:35):
I think @Lloyd McKenzie should find some other more reliable way to download rather than using a microsoft way
John Moehrke (Sep 12 2019 at 20:27):
If it works on windows 10 reliably.. then I am fine... I presumed it was due to me being on WIn 7... I should not be on 7. or not for much longer.
Lloyd McKenzie (Sep 12 2019 at 21:20):
I'm open to alternatives. What I want is a .bat and a .sh file that can do the download - ideally without requiring each IG to have a local copy of a jar or something that does the work.
Lloyd McKenzie (Sep 12 2019 at 21:21):
Grabbing the new publisher should just be a question of double-clicking on something, not having to remember/look-up a URL, launch a browser and then save it into a standard location.
Jose Costa Teixeira (Sep 13 2019 at 00:14):
...curl?
Jose Costa Teixeira (Sep 13 2019 at 00:15):
or you can Ant both batch scripts..
Jose Costa Teixeira (Sep 13 2019 at 00:16):
@John Moehrke if you don't mind testing, does this work for you?
curl https://fhir.github.io/latest-ig-publisher/org.hl7.fhir.publisher.jar -O .\org.hl7.fhir.publisher.jar
Lloyd McKenzie (Sep 13 2019 at 00:30):
I was surprised to find that 'curl' appears to be installed on my machine. Is it a standard part of Windows, Unix and MacOS now?
Jose Costa Teixeira (Sep 13 2019 at 00:40):
it seems that in windows curl is just an alias to a built in function
John Moehrke (Sep 13 2019 at 01:06):
curl is not native on windows 7... so no good.
Lloyd McKenzie (Sep 13 2019 at 01:56):
If it's native on Windows and Unix, I might take it anyhow. Those who are using Windows 7 might have to manage the download on their own.
Patrick Werner (Sep 13 2019 at 02:03):
"If your Windows 10 build is 17063, or later, cUrl is included by default. "
Lloyd McKenzie (Sep 13 2019 at 02:03):
Do you happen to know what the date on 17063 is? Are we talking last few months or last couple of years?
Patrick Werner (Sep 13 2019 at 02:05):
i think Jan 2018
Patrick Werner (Sep 13 2019 at 02:07):
my PR currently uses wget, will switch to curl as well as i just found out that stock OSX only includes curl and no wget
Patrick Werner (Sep 13 2019 at 02:22):
pushed the change, _updatePublisher.sh now uses curl
Patrick Werner (Sep 13 2019 at 02:22):
script also checks if curl is available and exits with an error if not
Lloyd McKenzie (Sep 13 2019 at 02:40):
Awesome
Eric Haas (Sep 13 2019 at 02:42):
here is my bash for OSX users it kind of does everything depending on the situation but the p option get the latest Ig-pub - It lives in my downloads and it and keeps the last version of the ig-pub in case the newest one is broken.
ignore the d n and s options those are for my custom script of ig.json an ig.xml
#!/bin/bash # exit when any command fails set -e path1=/Users/ehaas/Downloads/org.hl7.fhir.igpublisher.jar path2=/Users/ehaas/Downloads/org.hl7.fhir.igpublisher-old.jar path3=/Users/ehaas/Documents/FHIR/IG-tools/ while getopts ds:tonpw option do case "${option}" in d) DEFN=1;; s) SOURCE=${OPTARG};; t) NA='N/A';; o) PUB=1;; n) USEDEF=1;; p) UPDATE=1;; w) WATCH=1;; esac done echo "=================================================================" echo === Publish $SOURCE IG!!! $(date -u) === echo see 'local workflow.md' file for how to use echo "Optional Parameters" echo '-d parameter = create definitions files = ' $DEFN echo '-n parameter = use definitions source directory definition files = ' $USEDEF echo '-s parameter = source directory = ' $SOURCE echo '-t parameter for no terminology server (run faster and offline)= ' $NA echo '-o parameter for running previous version of the igpublisher= ' $PUB echo '-p parameter for downloading latest version of the igpublisher from source = ' $UPDATE echo '-w parameter for using watch on igpublisher from source default is off = ' $WATCH echo ' current directory =' $PWD echo "=================================================================" echo getting rid of .DS_Store files since they gum up the igpublisher.... find . -name '.DS_Store' -type f -delete sleep 1 # git status if [[ $UPDATE ]]; then echo "=================================================================" echo === get the latest ig-pub file === echo "=================================================================" #mv /Users/ehaas/Downloads/org.hl7.fhir.igpublisher.jar /Users/ehaas/Downloads/org.hl7.fhir.igpublisher-old.jar # _L flag for redirects curl -L https://github.com/FHIR/latest-ig-publisher/raw/master/org.hl7.fhir.publisher.jar -o /Users/ehaas/Downloads/org.hl7.fhir.igpublisher.jar sleep 3 fi if [[ $DEFN ]]; then echo "=================================================================" echo === run definitions maker with optional source directory name as first argument === echo === create ig.json and ig.xml in $PWD and ../$SOURCE === echo "=================================================================" python3.5 ${path3}definitions.py $SOURCE sleep 3 git status fi if [[ $USEDEF ]]; then echo "=================================================================" echo === use definition files from relative path ../$SOURCE === echo "=================================================================" cp ../$SOURCE/ig.json $PWD/ig.json sed -i "" "s|source/pages|../$SOURCE/source/pages|g" ${PWD}/ig.json sed -i "" "s|source/resources|../$SOURCE/source/resources|g" ${PWD}/ig.json sed -i "" "s|source/examples|../$SOURCE/source/examples|g" ${PWD}/ig.json sleep 3 git status fi if [[ $WATCH ]]; then echo "=================================================================" echo ===un most recent version of the igpublisher with watch on === echo "=================================================================" java -jar ${path1} -ig ig.json -watch -tx $NA elif [[ $PUB ]]; then echo "=================================================================" echo === run last known good version of the igpublisher run most recent version of the igpublisher === echo "=================================================================" java -jar ${path2} -ig ig.json -watch -tx $NA else echo "=================================================================" echo ===run igpublisher just once \(no watch option\)=== echo "=================================================================" java -jar ${path1} -ig ig.json -tx $NA fi
Lloyd McKenzie (Sep 13 2019 at 03:07):
Yeah, that's more complex than what I want. First, the .bat/.sh script needs to be user independent and can't assume the existence of a downloads folder. Second, I want separate scripts for the common combinations so that no-one needs to use commandline - they should be able to just launch whatever type of build they need to run.
John Moehrke (Sep 13 2019 at 10:52):
If it's native on Windows and Unix, I might take it anyhow. Those who are using Windows 7 might have to manage the download on their own.
Yes I agree. Win7 should not be a limiting factor... but it would be good to be aware of the limit. Most organizations are off of win7, but there are some machines that have not yet been expired. I think I am a month or two away from upgrade on the last machine that isn't win10.
Jose Costa Teixeira (Sep 13 2019 at 10:56):
@John Moehrke i read that PowersHell has an issue with TLS not being set to 1.2
Jose Costa Teixeira (Sep 13 2019 at 10:56):
- Perhaps this helps: run this before the download
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12;
Jose Costa Teixeira (Sep 13 2019 at 10:58):
the command line to download is
POWERSHELL -command (new-object System.Net.WebClient).DownloadFile("https://fhir.github.io/latest-ig-publisher/org.hl7.fhir.publisher.jar","org.hl7.fhir.publisher.jar")
Last updated: Apr 12 2022 at 19:14 UTC