Situation
Have installed OpenEMR on AWS and trying to call REST Api… both from Postman and browser and I am getting 500 Internal server error…
I havent changed any settings…the install is totally out of the box setup…
You’ll need to provide more details than what you have provided. We need to know the OpenEMR version you installed (any relevant patches) whether this was done via docker, kubernetes, the Amazon AMIs.
It would also be helpful if you posted your API request and the relevant server error logs. W/o additional information there’s really not much anyone can help you with.
Hi Stephen…Thanks for the response…
I installed Amazon AMI into the AWS Instance and I am not able to access the API…
BTW I tried to install OpenEMR on XAMPP windows and I am facing the same issues…I am not getting any response for API calls and when I run http://localhost/openemr/tests/api/InternalApiTest.php it is loading an empty page…
I have already modified .htaccess file to AllowOverride All and activated rewrite…
I have also enabled the settings in administration/connector…
Do you know how to get the server logs? What do your logs show? If you run on your AWS machine
tail -f /var/log/apache2/error.log
It should tell you why you are getting the 500 error.
Also, you still are not posting the HTTP Request/Response (Postman gives you this information). I imagine something in your request is triggering the error.
[Sat Oct 30 01:32:21.747747 2021] [core:error] [pid 15920:tid 608] (20024)The given path is misformatted or contained invalid characters: [client 127.0.0.1:64639] AH00127: Cannot map GET /openemr:80300/tests/api/InternalApiTest.php HTTP/1.1 to file
[
[Sat Oct 30 01:36:43.568494 2021] [php7:error] [pid 15920:tid 608] [client 127.0.0.1:64713] PHP Fatal error: Uncaught LogicException: Key path “file://D:/xampp/htdocs/openemr/sites/default/documents/certificates/oapublic.key” does not exist or is not readable in D:\xampp\htdocs\openemr\vendor\league\oauth2-server\src\CryptKey.php:52\nStack trace:\n#0 D:\xampp\htdocs\openemr\vendor\league\oauth2-server\src\ResourceServer.php(50): League\OAuth2\Server\CryptKey->__construct(‘file://D:/xampp…’)\n#1 D:\xampp\htdocs\openemr\_rest_config.php(203): League\OAuth2\Server\ResourceServer->__construct(Object(OpenEMR\Common\Auth\OpenIDConnect\Repositories\AccessTokenRepository), ‘D:/xampp/htdocs…’)\n#2 D:\xampp\htdocs\openemr\apis\dispatch.php(56): RestConfig::verifyAccessToken()\n#3 {main}\n thrown in D:\xampp\htdocs\openemr\vendor\league\oauth2-server\src\CryptKey.php on line 52
Are you running this on your local machine or on amazon AWS? I’m pretty sure we don’t have a windows OpenEMR AMI.
Also port 80300 is not a standard port as the default is 8300. Did you install OpenEMR onto a windows machine in the amazon cloud? If so as Jerry said it looks like a file permission issue as your keys can’t write to the directory.
The permissions can’t be right as the error literally says that the PHP process does not have access to the file://D:/xampp/htdocs/openemr/sites/default/documents/certificates folder.
Windows gets weird with external drives or drives other than c:. Check security settings.
FYI: the keys get saved to file system here src/Common/Auth/OAuth2KeyConfig.php around L-137 to troubleshoot…