Unable to run example

103 views
Skip to first unread message

Sorcerer Stone

unread,
Jun 27, 2016, 12:46:22 PM6/27/16
to OpenHIM-Implementers
Hello All,
I attempted to install and to learn how openHIM works a few months ago. Got tied up with other tasks and I am back to openHIM installation again.
My OS is Win8.1, 64 bit.
I download the latest version of openHIM (June). I am in the section "3.2 Creating your first channel"
I tried to run the example command: $ curl -k -u tut:tut https://localhost:5000/encounters/1
In DOS command window (both running normally or in admin mode), I got this error: An internal server error occurred
I followed the manual and changed the localhost to the IP address of the computer in the UI and ran the above command. Same error.

I ran the above command line in Windows Powershell both normally or as an administrator, I got same error (but more informative) running the command either as localhost or as IP Address. The error message is follow:

Invoke-WebRequest : Parameter cannot be processed because the parameter name 'u' is ambiguous. Possible matches
include: -UseBasicParsing -Uri -UseDefaultCredentials -UserAgent.
At line:1 char:9
+ curl -k -u tut:tut https://192.168.1.43:5000/encounters/1
+         ~~
    + CategoryInfo          : InvalidArgument: (:) [Invoke-WebRequest], ParameterBindingException
    + FullyQualifiedErrorId : AmbiguousParameter,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

Can anyone suggest how I can overcome this error?

Thanks in advance.

Hannes Venter

unread,
Jun 28, 2016, 4:57:00 AM6/28/16
to Sorcerer Stone, OpenHIM-Implementers
Hi Sorcerer Stone. Welcome back.

It seems the version of curl you're using doesn't support the -u flag (it specifies the basic auth credentials for the request)
In fact it looks like it's mapped to another application? InvokeWebRequestCommand. You may need to adapt the curl request to suite this command instead.

As alternative - you could also try using something like postman instead of curl? This doc should help you set the basic auth details for the tut user when creating a request if you want to try this option.

Cheers
Hannes

--
You received this message because you are subscribed to the Google Groups "OpenHIM-Implementers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openhim-implemen...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Hannes Venter
Senior Software Developer
Jembi Health Systems |  SOUTH AFRICA
Mobile: +27 73 276 2848 | Office: +27 21 701 0939 | Skype: venter.johannes

This e-mail contains proprietary and confidential information some or all of which may be legally privileged. It is for the intended recipient only. If an addressing or transmission error has misdirected this e-mail, please notify the author by replying to this e-mail and then deleting same. If you are not the intended recipient you must not use, disclose, distribute, copy, print or rely on this e-mail. Jembi Health Systems NPO, its subsidiaries and associated companies is not liable for the security of information sent by e-mail and accepts no liability of whatsoever nature for any loss, damage or expense resulting, directly or indirectly, from the access of this e-mail or any attachments hereto.

Sorcerer Stone

unread,
Jul 4, 2016, 1:21:08 AM7/4/16
to OpenHIM-Implementers, sorcer...@gmail.com
Hello Hannes,
I solved the -u flag problem. The cause of the problem was I closed all the DOS command windows for the 3 services at the beginning of Section 3.1. I reopened those services and then the problem with -u flag disappeared.

During the weekend, I tried to run the examples on setting up the channels. I went almost to the end of Section 3.3.2 (i.e. Java Mediator session) stopped just before executing the command "grunt serve". Then I run into new problems.

I switched to work on another open source project. I downloaded and reinstalled the latest version of 64 bit version of Apache Server and PHP engine. I believed I had 32 bit version of Apache Server installed before yesterday and no PHP engine was installed before yesterday. After I reinstalled Apache Server (running as Windows services), I used an app to clean up my computer to remove left over apps in the registry (because I remove a couple of unrelated apps as well)

Now the problem is I can't even bring up the openHIM console (the very first step of the openHIM manual described in Section 2.1)!
 
I typed " openhim-core" in a DOS command windows. Everything looks normal.

I typed " https://localhost:8080/authenticate/ro...@openhim.org" in Chrome browser. It returned: " {"salt":"0294317c0597855954667f5f9f26341f","ts":"2016-07-04T04:23:37.446Z"}"
At the same time, the DOS command box issued this message:
" 2016-07-04T04:23:37.599Z - info: [worker1] API request made by undefined from localhost:8080 is missing required API authentication headers, denying access"

The manual explained this is expected as I am issuing a self-signed certificate.
Then in a new browse page, I entered the URL:
"localhost"
or
" http://localhost/index.html"

For both of the above, Chrome browser returned "It works!" message on the screen. That is the screen I expected to see when I want to test whether PHP server is installed correctly when working with Apache Server.

Before I reinstalled Apache, when I typed in " http://localhost/index.html", Chrome browser (or any browser) used to bring me to openHIM login page, but now suddenly it does not.

What may be the problem here? Could I corrupted the system and have to uninstall node, mongodb, etc and reinstall everything including openHIM all over again?

Please advise.

Regards,
Sorcerer
To unsubscribe from this group and stop receiving emails from it, send an email to openhim-implementers+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Hannes Venter

unread,
Jul 4, 2016, 3:01:31 AM7/4/16
to Sorcerer Stone, OpenHIM-Implementers
Hi Sorcerer Stone,

It sounds like the openhim-core itself is fine, and so there shouldn't be any issue with node and mongo.

Did you redeploy the console content into the new installation of apache?
You might've lost this content when reinstalling (it might even still be sitting in the apache 32bit folder somewhere).

Btw we've recently written up a Windows howto guide which you may find useful (the console instructions are for IIS and nginx though).

Cheers
Hannes

To unsubscribe from this group and stop receiving emails from it, send an email to openhim-implemen...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Hannes Venter
Senior Software Developer
Jembi Health Systems |  SOUTH AFRICA
Mobile: +27 73 276 2848 | Office: +27 21 701 0939 | Skype: venter.johannes

This e-mail contains proprietary and confidential information some or all of which may be legally privileged. It is for the intended recipient only. If an addressing or transmission error has misdirected this e-mail, please notify the author by replying to this e-mail and then deleting same. If you are not the intended recipient you must not use, disclose, distribute, copy, print or rely on this e-mail. Jembi Health Systems NPO, its subsidiaries and associated companies is not liable for the security of information sent by e-mail and accepts no liability of whatsoever nature for any loss, damage or expense resulting, directly or indirectly, from the access of this e-mail or any attachments hereto.

--
You received this message because you are subscribed to the Google Groups "OpenHIM-Implementers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openhim-implemen...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Sorcerer Stone

unread,
Jul 5, 2016, 12:59:44 AM7/5/16
to OpenHIM-Implementers, sorcer...@gmail.com
Hello Hannes,
Thanks for the feedback.
Another related question.
If I choose to reinstall openHIM to start over. I have to uninstall mongodb first & to delete the openhim-core folder in ../npm/node_modules/openhim-core. These are the only thing I need to do before reinstalling openHIM (i.e. do not need to remove nodejs and related modules). Correct?
When I reinstall openHIM,
Thanks in advance.
Regards,
Sorcerer
To unsubscribe from this group and stop receiving emails from it, send an email to openhim-implementers+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Hannes Venter
Senior Software Developer
Jembi Health Systems |  SOUTH AFRICA
Mobile: +27 73 276 2848 | Office: +27 21 701 0939 | Skype: venter.johannes

This e-mail contains proprietary and confidential information some or all of which may be legally privileged. It is for the intended recipient only. If an addressing or transmission error has misdirected this e-mail, please notify the author by replying to this e-mail and then deleting same. If you are not the intended recipient you must not use, disclose, distribute, copy, print or rely on this e-mail. Jembi Health Systems NPO, its subsidiaries and associated companies is not liable for the security of information sent by e-mail and accepts no liability of whatsoever nature for any loss, damage or expense resulting, directly or indirectly, from the access of this e-mail or any attachments hereto.

--
You received this message because you are subscribed to the Google Groups "OpenHIM-Implementers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openhim-implementers+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Hannes Venter

unread,
Jul 5, 2016, 2:42:22 AM7/5/16
to Sorcerer Stone, OpenHIM-Implementers
Hi Sorcerer Stone,

Actually you can just run npm uninstall -g openhim-core to remove the HIM.

I don't think it's necessary to uninstall mongo, esp. since that normally doesn't remove the databases it had setup.
It's easier to just drop the openhim database you were using if that's what aiming to achieve.

Cheers
Hannes

To unsubscribe from this group and stop receiving emails from it, send an email to openhim-implemen...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Hannes Venter
Senior Software Developer
Jembi Health Systems |  SOUTH AFRICA
Mobile: +27 73 276 2848 | Office: +27 21 701 0939 | Skype: venter.johannes

This e-mail contains proprietary and confidential information some or all of which may be legally privileged. It is for the intended recipient only. If an addressing or transmission error has misdirected this e-mail, please notify the author by replying to this e-mail and then deleting same. If you are not the intended recipient you must not use, disclose, distribute, copy, print or rely on this e-mail. Jembi Health Systems NPO, its subsidiaries and associated companies is not liable for the security of information sent by e-mail and accepts no liability of whatsoever nature for any loss, damage or expense resulting, directly or indirectly, from the access of this e-mail or any attachments hereto.

--
You received this message because you are subscribed to the Google Groups "OpenHIM-Implementers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openhim-implemen...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Hannes Venter
Senior Software Developer
Jembi Health Systems |  SOUTH AFRICA
Mobile: +27 73 276 2848 | Office: +27 21 701 0939 | Skype: venter.johannes

This e-mail contains proprietary and confidential information some or all of which may be legally privileged. It is for the intended recipient only. If an addressing or transmission error has misdirected this e-mail, please notify the author by replying to this e-mail and then deleting same. If you are not the intended recipient you must not use, disclose, distribute, copy, print or rely on this e-mail. Jembi Health Systems NPO, its subsidiaries and associated companies is not liable for the security of information sent by e-mail and accepts no liability of whatsoever nature for any loss, damage or expense resulting, directly or indirectly, from the access of this e-mail or any attachments hereto.

--
You received this message because you are subscribed to the Google Groups "OpenHIM-Implementers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openhim-implemen...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Sorcerer Stone

unread,
Jul 7, 2016, 1:05:08 PM7/7/16
to OpenHIM-Implementers, sorcer...@gmail.com
Hello Hannes,
I am still running into this new problem of unable to access the opening page for openHIM console.

I had uninstalled openHIM and reinstalled it. I had uninstalled 32bit version of Apache and installed 64bit Apache. I have checked the ../config/default.json file. Since I am the one and only person using this project and accessing it via the same local machine, the default settings for port, host, are fine and I left these entries as is.

Still after openHIM core server started, I accessed  https://localhost:8080/authenticate/ro...@openhim.org to gain authentication/certificate. And when I tried to log into openHIM console using the URL localhost/index.html or localhost (as said in manual), Chrome browser displays "Its Works". Replaced "localhost" with IP address for my machine and repeated the same thing, same result.

It wasn't like that 8 days ago before I installed PHP engine. I could access openHIM login page w/o any problem. I tried to comment out all lines I modified for hooking up Apache to PHP engine in Apache24\conf\httpd.conf. Restarted Apache, same result.

I had logged some errors in the dos box (I am using Windows8) where core server was running. I caught these errors when I tried to append various ports listed in default.json to localhost:xxx. Do you think these errors (below) are expected as I am trying to access internal ports used by openHIM?

C:\Users\fortuna\AppData\Roaming\npm\node_modules\openhim-core\src\middleware\rerunBypassAuthorisation.coffee:19
    Channel.findOne _id: originalTransaction.channelID, (err, authorisedChannel) ->
                                            ^
TypeError: Cannot read property 'channelID' of null
    at Query.<anonymous> (C:\Users\fortuna\AppData\Roaming\npm\node_modules\openhim-core\src\middleware\rerunBypassAuthorisation.c
offee:19:45)
    at C:\Users\fortuna\AppData\Roaming\npm\node_modules\openhim-core\node_modules\mongoose\node_modules\kareem\index.js:177:19
    at C:\Users\fortuna\AppData\Roaming\npm\node_modules\openhim-core\node_modules\mongoose\node_modules\kareem\index.js:109:16
    at nextTickCallbackWith0Args (node.js:420:9)
    at process._tickCallback (node.js:349:13)
2016-07-07T15:02:42.602Z - info: [worker1] Stopped rerun task processor
2016-07-07T15:02:42.617Z - info: [worker1] Stopped Audit UDP server
2016-07-07T15:02:42.670Z - warn: [master] worker 6516 died



While waiting for your response, I am going to uninstall everything (nodejs, mongodb, etc...) and start from scratch. I am going to try to use nGINX web server this time around (while keeping current Apache web server, as I need it for other projects). 

Looking forwards for your reply.
And thanks in advance.

Regards,
Sorcerer
To unsubscribe from this group and stop receiving emails from it, send an email to openhim-implementers+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Hannes Venter
Senior Software Developer
Jembi Health Systems |  SOUTH AFRICA
Mobile: +27 73 276 2848 | Office: +27 21 701 0939 | Skype: venter.johannes

This e-mail contains proprietary and confidential information some or all of which may be legally privileged. It is for the intended recipient only. If an addressing or transmission error has misdirected this e-mail, please notify the author by replying to this e-mail and then deleting same. If you are not the intended recipient you must not use, disclose, distribute, copy, print or rely on this e-mail. Jembi Health Systems NPO, its subsidiaries and associated companies is not liable for the security of information sent by e-mail and accepts no liability of whatsoever nature for any loss, damage or expense resulting, directly or indirectly, from the access of this e-mail or any attachments hereto.

--
You received this message because you are subscribed to the Google Groups "OpenHIM-Implementers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openhim-implementers+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Hannes Venter
Senior Software Developer
Jembi Health Systems |  SOUTH AFRICA
Mobile: +27 73 276 2848 | Office: +27 21 701 0939 | Skype: venter.johannes

This e-mail contains proprietary and confidential information some or all of which may be legally privileged. It is for the intended recipient only. If an addressing or transmission error has misdirected this e-mail, please notify the author by replying to this e-mail and then deleting same. If you are not the intended recipient you must not use, disclose, distribute, copy, print or rely on this e-mail. Jembi Health Systems NPO, its subsidiaries and associated companies is not liable for the security of information sent by e-mail and accepts no liability of whatsoever nature for any loss, damage or expense resulting, directly or indirectly, from the access of this e-mail or any attachments hereto.

--
You received this message because you are subscribed to the Google Groups "OpenHIM-Implementers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openhim-implementers+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Hannes Venter

unread,
Jul 8, 2016, 9:52:28 AM7/8/16
to Sorcerer Stone, OpenHIM-Implementers
Hi Sorcerer Stone,

It doesn't sound like a problem with the HIM core itself - from what you've described it sounds like everything is okay on that side.

What contents do you have in the Apache document root?
Maybe console's sitting in a subfolder, in which case you'd need to access it as http://localhost/console (or whatever it's called).

Yeah those errors definitely look like they're due to accessing internal ports, so nothing to worry about there.

You'll probably only need the nginx step by itself if you want to go that route, I suspect that reinstalling node and mongo wouldn't make much difference to your current problem
(not that it would hurt if you're keen to do it though, getting the latest versions is always a good idea)

Hope this helps.

Cheers
Hannes

To unsubscribe from this group and stop receiving emails from it, send an email to openhim-implemen...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Hannes Venter
Senior Software Developer
Jembi Health Systems |  SOUTH AFRICA
Mobile: +27 73 276 2848 | Office: +27 21 701 0939 | Skype: venter.johannes

This e-mail contains proprietary and confidential information some or all of which may be legally privileged. It is for the intended recipient only. If an addressing or transmission error has misdirected this e-mail, please notify the author by replying to this e-mail and then deleting same. If you are not the intended recipient you must not use, disclose, distribute, copy, print or rely on this e-mail. Jembi Health Systems NPO, its subsidiaries and associated companies is not liable for the security of information sent by e-mail and accepts no liability of whatsoever nature for any loss, damage or expense resulting, directly or indirectly, from the access of this e-mail or any attachments hereto.

--
You received this message because you are subscribed to the Google Groups "OpenHIM-Implementers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openhim-implemen...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Hannes Venter
Senior Software Developer
Jembi Health Systems |  SOUTH AFRICA
Mobile: +27 73 276 2848 | Office: +27 21 701 0939 | Skype: venter.johannes

This e-mail contains proprietary and confidential information some or all of which may be legally privileged. It is for the intended recipient only. If an addressing or transmission error has misdirected this e-mail, please notify the author by replying to this e-mail and then deleting same. If you are not the intended recipient you must not use, disclose, distribute, copy, print or rely on this e-mail. Jembi Health Systems NPO, its subsidiaries and associated companies is not liable for the security of information sent by e-mail and accepts no liability of whatsoever nature for any loss, damage or expense resulting, directly or indirectly, from the access of this e-mail or any attachments hereto.

--
You received this message because you are subscribed to the Google Groups "OpenHIM-Implementers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openhim-implemen...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Hannes Venter
Senior Software Developer
Jembi Health Systems |  SOUTH AFRICA
Mobile: +27 73 276 2848 | Office: +27 21 701 0939 | Skype: venter.johannes

This e-mail contains proprietary and confidential information some or all of which may be legally privileged. It is for the intended recipient only. If an addressing or transmission error has misdirected this e-mail, please notify the author by replying to this e-mail and then deleting same. If you are not the intended recipient you must not use, disclose, distribute, copy, print or rely on this e-mail. Jembi Health Systems NPO, its subsidiaries and associated companies is not liable for the security of information sent by e-mail and accepts no liability of whatsoever nature for any loss, damage or expense resulting, directly or indirectly, from the access of this e-mail or any attachments hereto.

--
You received this message because you are subscribed to the Google Groups "OpenHIM-Implementers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openhim-implemen...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages