Stream: IG creation
Topic: Offline Issue
Kurt Allen (Jun 12 2020 at 21:32):
@Grahame Grieve I am trying to run publisher connected to the internet via my cell phone acting as a hotspot, and publisher tells me it is running in offline mode. I get same issue if connected to the internet via a USB connection to my cell phone. All works fine if I have a wired connection.
I am connected to the internet, and proved it by downloading the latest ig publisher jar file :-)
Any ideas/workarounds?
Grahame Grieve (Jun 12 2020 at 21:34):
how exactly does it tell you that?
Jose Costa Teixeira (Jun 12 2020 at 22:38):
Are you using the _genonce.bat?
Jose Costa Teixeira (Jun 12 2020 at 22:39):
That one will tell you it's offline if it can't ping tx.fhir
Kurt Allen (Jun 14 2020 at 15:44):
@Grahame Grieve
When I run _genonce.bat, I get the following.
- Checking internet connection...
- We're offline...
- Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
- FHIR IG Publisher Version 1.0.100-SNAPSHOT (Git# 6c6b419dd19f). Built 2020-06-07T09:06:40.927+10:00 (7 days old)
- Detected Java version: 1.8.0_251 from C:\Program Files\Java\jre1.8.0_251 on amd64 (64bit). 7259MB available
- Parameters: -ig ig.ini -tx n/a
....
As it runs, I get lots of errors that I don't get when I run from home, which I assume is from publisher not being able to download content.
@Jose Costa Teixeira : I can successfully ping 'tx.fhir.org' (in your note, I assume you meant 'tx.fhir.org' when you said 'tx.fhir')
The ability to run this from my phone is a really nice convenience, but something I can work around if you do not see an simple fix for for this. (i.e. if this works, I can work from my cabin, otherwise I will just have to relax in my hammock instead... OMG)
Thx
Jose Costa Teixeira (Jun 14 2020 at 15:53):
can you try to run this command instead of only _genonce?
_genonce.bat -tx http://tx.fhir.org
Jose Costa Teixeira (Jun 14 2020 at 15:55):
perhaps your system is blocking ping to the outside.
Jose Costa Teixeira (Jun 14 2020 at 15:56):
or you can change your _genonce.bat, line 8,
SET txoption=-tx n/a
to
REM SET txoption=-tx n/a
Grahame Grieve (Jun 14 2020 at 19:37):
@Jose Costa Teixeira I would think that checking on-line status by ping is a high risk operation, since some windows systems require admin privilege to ping. I presume this is the case for Kurt.
Jose Costa Teixeira (Jun 14 2020 at 19:48):
I was not thinking of that. Is there an alternative?
Grahame Grieve (Jun 14 2020 at 19:49):
https://support.microsoft.com/it-it/help/310099/description-of-the-portqry-exe-command-line-utility
Grahame Grieve (Jun 14 2020 at 19:51):
Jose Costa Teixeira (Jun 14 2020 at 20:25):
i think wget was not used because some systems might not have wget installed
Jose Costa Teixeira (Jun 14 2020 at 20:28):
same with curl
Grahame Grieve (Jun 14 2020 at 20:34):
is easier to require them to be installed than to deal with permissions issues on ping?
Jose Costa Teixeira (Jun 14 2020 at 20:38):
I can work with that. two questions:
1 If they are not installed, should it abort or proceed?
2 If proceed, best to assume that it's online or offline?
Grahame Grieve (Jun 14 2020 at 20:43):
vote on it? (and make a parameter?)
Jose Costa Teixeira (Jun 14 2020 at 21:17):
/poll _genonce.bat / .sh currently uses ping to see if it's online, but this may be blocked by some firewalls or system settings, which would cause it to wrongly assume it's offline. Should we:
Add a "-online" parameter: When ping fails, display "Unable to ping the terminology server. If you are online, run "_genonce -online to skip check
Add a prompt: when ping fails, "Unable to ping the terminology server. If you are online, type "y", otherwise "n" (after 5 sec default to "n")
Change from ping to wget - if wget fails, tell the user where to get it (and also prompt the user if online or offline)
Jose Costa Teixeira (Jun 14 2020 at 21:35):
(added option 4 - we may want to avoid forcing people to download wget if their ping is fine. this would be less disruptive)
David Hay (Jun 15 2020 at 19:23):
and if you have the on-line parameter and it fails then display an error...
John Moehrke (Jun 15 2020 at 19:33):
I like the automatic ping. and the edge case where ping doesn't work but you are online seems like a good use of a commandline switch. Hence my choice of ( a )
Kurt Allen (Jun 16 2020 at 16:46):
@Jose Costa Teixeira I tried rem'ing Set txOption and all worked.
Didn't realize that the 'offline' message came the -genonce.bat file, assumed it came directly from publisher.
So, I tried running 'PING tx.fhir.org -n 1 -w 1000' command and got the following response.
Pinging tx.fhir.org [2607:7700:0:1f:0:1:68c4:a611] with 32 bytes of data:
Reply from 2607:7700:0:1f:0:1:68c4:a611: time=207msPing statistics for 2607:7700:0:1f:0:1:68c4:a611:
Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 207ms, Maximum = 207ms, Average = 207ms
Note, there is no 'TTL' string in there, so the dos batch line (_genonce.bat, # 12)
PING tx.fhir.org -n 1 -w 1000 | FINDSTR TTL && GOTO isonline
will fail (not goto isonline).
I don't know why ping from home returns 'TTL,' and ping here at my cabin does not. May have to go sit in my hammock for a few hours an ponder that.
So, I don't think that the problem is that permissions for ping fail, but that ping on this system connected via my phone returns something different than my home system.
Jose Costa Teixeira (Jun 16 2020 at 16:47):
That is very useful
Gino Canessa (Jun 16 2020 at 16:59):
That looks like a difference for IPv6 resolution instead of v4.
Kurt Allen (Jun 16 2020 at 17:10):
@Gino Canessa I think you are right, you have better eyes than me :-)
@Jose Costa Teixeira
Changing
PING tx.fhir.org -n 1 -w 1000 | FINDSTR TTL && GOTO isonline
to
PING tx.fhir.org -n 1 -w 1000 | FINDSTR Reply && GOTO isonline
fixes the problem on this machine, though I would want to try this one on a couple more systems before I suggested a permanent change.
Jose Costa Teixeira (Jun 16 2020 at 17:10):
I think the TTL is/was the only language-neutral way of checing if the server is responding. Seems that error codes will have false negatives (will return 0 even if server is not there)
Jose Costa Teixeira (Jun 16 2020 at 17:10):
"Reply" will not work in non-english systems
Kurt Allen (Jun 16 2020 at 17:13):
@Jose Costa Teixeira Didn't consider non-english systems. My bad...
Jose Costa Teixeira (Jun 16 2020 at 17:13):
@Kurt Allen I did send you a fixed version that if ping is not OK, it tries wget (for testing if you can)
Gino Canessa (Jun 16 2020 at 17:26):
You could also try adding the -4
switch to force it to use v4. I assume it will then provide the v4-style output
Vassil Peytchev (Jun 16 2020 at 17:26):
ping -4 forces IPv4, where the TTL will work.
Jose Costa Teixeira (Jun 16 2020 at 17:35):
any downsides of using -4 ?
Jose Costa Teixeira (Jun 16 2020 at 17:35):
@Kurt Allen do you want to test that?
Kurt Allen (Jun 16 2020 at 17:48):
@Jose Costa Teixeira I just got your updated _genonce.bat to work (Thanks!) and then I added the -4 (Thx @Gino Canessa ) option to the ping command and that worked also (didnt call wget, 'cause the ping worked.).
Personally, I like the -4 option....
-K
Jose Costa Teixeira (Jun 16 2020 at 17:53):
so this is extra robust. Cool.
Jose Costa Teixeira (Jun 16 2020 at 17:57):
Now the problem I have is that we had a vote, and since the voting happened, we have much more information that might influence the vote.
Jose Costa Teixeira (Jun 16 2020 at 18:00):
so to make everyone happy or equally unhappy except the "coder", I propose to
-
force ping to ipv4
AND -
add a wget just in case
AND -
add a parameter to force online or offline behaviour
(thumbs up/down pls?)
Jose Costa Teixeira (Jun 16 2020 at 18:01):
(deleted)
Kurt Allen (Jun 16 2020 at 18:45):
@Jose Costa Teixeira Adding -4 and wget and force online parameter certainly works for me, though in all honesty I would be happy just adding the -4 option.
Jose Costa Teixeira (Jun 16 2020 at 19:24):
@Kurt Allen give it a few minutes, then run _updatePublisher.bat
you can say no to update the publisher jar, but if you say Yes to update the scripts, your _genOnce will be updated
(in other words, would you please test that as well ?)
Kurt Allen (Jun 16 2020 at 20:36):
@Jose Costa Teixeira Delighted to test this. I ran _updatepublisher.bat and I think I got a new _genonce.bat, but it doesnt look correct (i.e. it looks like the original problamatic ping ...)
Should the ping look like this?
ECHO Checking internet connection...
PING tx.fhir.org -n 1 -w 1000 | FINDSTR TTL && GOTO isonline
Running this tells me I am offline.
I am running the _updatepublisher I got from Sushi. Could that be an issue?
Plz let me know if I am doing something wrong. inquiring minds want to know.. :-)
-K
Jose Costa Teixeira (Jun 16 2020 at 20:39):
Kurt Allen said:
I am running the _updatepublisher I got from Sushi. Could that be an issue?
perhaps. The _updatePublisher works well here: it gets the right scripts
Jose Costa Teixeira (Jun 16 2020 at 20:40):
so:
- get your _updatePublisher.bat from here: https://raw.githubusercontent.com/FHIR/sample-ig/master/_updatePublisher.bat
Jose Costa Teixeira (Jun 16 2020 at 20:40):
(if you can do that please, then it should get the right _genOnce)
Jose Costa Teixeira (Jun 16 2020 at 20:40):
- @Chris Moesel is the sushi _updatePublisher up to date?
Kurt Allen (Jun 16 2020 at 22:20):
@Jose Costa Teixeira
We might want to add the -4 option to _updatepublisher.bat
PING tx.fhir.org -n 1 -w 1000 | FINDSTR TTL && GOTO isonline
Same problem with offline in _updatepublisher.bat as with _genonce.bat.
I hand modified _updatepublisher.bat (added -4) and ran it. It downloaded the new _genonce.bat.
(This _updatepublisher.bat is definitely different than the one that comes with sushi.)
Ran the new _genonce.bat with the spiffy new -4 option and it works perfectly.
Many thanks,
-K
John Moehrke (Jun 17 2020 at 15:18):
given that we have abandoned all but windows 10 and linux. In the windows batch file, are we sure we can't rely on ping exit code from windows 10?
John Moehrke (Jun 17 2020 at 15:22):
the updated genonce did work for me fine for both online and offline..
John Moehrke (Jun 17 2020 at 15:25):
John Moehrke said:
given that we have abandoned all but windows 10 and linux. In the windows batch file, are we sure we can't rely on ping exit code from windows 10?
I updated my genonce to just use the exit code of ping. It seemed to work. I think we were using findstr because of all the variations of ping in all the varitions of windows we were trying to support. But for various reasons we only support windows 10 now days
John Moehrke (Jun 17 2020 at 15:26):
I don't have a way to foce my system to only support IPv6.. easily... @Kurt Allen can you try that?
Rob Hausam (Jun 17 2020 at 15:31):
I think macOS needs to remain in that list along with Windows 10 and Linux. It's certainly what I'm using.
John Moehrke (Jun 17 2020 at 15:31):
are you using bat or sh?
Vassil Peytchev (Jun 17 2020 at 15:32):
I don't have a way to foce my system to only support IPv6.. easily... Kurt Allen can you try that?
ping -6 will force IPv6
Rob Hausam (Jun 17 2020 at 15:32):
macOS is pretty close to Linux in most respects - it's sh
Jose Costa Teixeira (Jun 17 2020 at 15:32):
Mac is unix, same thing applies as linux
John Moehrke (Jun 17 2020 at 15:33):
right, I was only looking at fixing the .bat for windows
John Moehrke (Jun 17 2020 at 15:34):
Vassil Peytchev said:
I don't have a way to foce my system to only support IPv6.. easily... Kurt Allen can you try that?
ping -6 will force IPv6
well, I don't have a v6 stack (my ISP is draconian) so forcing v6 ping fails even when I am online
Jose Costa Teixeira (Jun 17 2020 at 15:34):
the .bat is patched for now. Will apply the same for the _updatePublisher (thaks Kurt for reminder)
John Moehrke (Jun 17 2020 at 15:37):
note that offline build fails as it doesn't seem to remember during the build that it is offline
Jose Costa Teixeira (Jun 17 2020 at 16:08):
where does it fail?
Jose Costa Teixeira (Jun 17 2020 at 16:08):
it seems to be detecting online and offline correctly, and passing that parameter to the publisher
Kurt Allen (Jun 17 2020 at 18:06):
I don't have a way to foce my system to only support IPv6.. easily... Kurt Allen can you try that?
I can do that, but will have to wait until I am at the cabin again. Maybe tomorrow or next week depending on weather (sorry :-))
Grahame Grieve (Jun 17 2020 at 19:02):
given that we have abandoned all but windows 10 and linux
I don't see why that's true.
John Moehrke (Jun 17 2020 at 19:30):
ah, I thought that the updatepublisher was only using webClient
John Moehrke (Jun 17 2020 at 19:31):
ah, I thought that the updatepublisher was only using webClient
John Moehrke (Jun 17 2020 at 19:31):
I see it seems to have conditionsals, but do we know if any of them work? I was the last one using win 8, and I have updated to 10
Grahame Grieve (Jun 17 2020 at 19:31):
the .bat file is wndows only, yes. OSX and Linux use the .sh file, but no one is showering that with the TLC that the batch file is getting
John Moehrke (Jun 17 2020 at 19:35):
understood... linux geeks need less TLC
John Moehrke (Jun 17 2020 at 19:35):
understood... linux geeks need less TLC
John Moehrke (Jun 17 2020 at 19:35):
they bring it on themselves
David Pyke (Jun 17 2020 at 19:43):
Actually, we've changed the .sh files a lot, we just don't have long discussions about it.
Last updated: Apr 12 2022 at 19:14 UTC