Hi Guys, So I tried to set up medplum on localhost...
# general
i
Hi Guys, So I tried to set up medplum on localhost and then make the server running on port 8103 available over the web using ngrok. I updated the medplum.config.json located in medplum/packages/server by changing all the instance of http://localhost:8103/ with the new url from ngrok. I also created a lambda role in AWS console and then updated the botLambdaRoleArn in the medplum.config file. I ran the deploy-bot-layer.sh and It created a layer on my AWS. The thing now is that after all that, whenever I try to access the bot endpoint using subscriptions, I always get “Bot not enabled”. I do not know if I am skipping any step, so pls help me with this, Thanks!
r
You'll need to enable bots at a project level! 1. Log in as Super Admin 2. Navigate to your Project /Project/ 3. Edit the "Features" - you can add this to the JSON for the Project to enable bots "features": [ "bots", ],
i
Thank you, I’ll try this
New error is Could not load credentials for any providers
Pls, what does this mean?
c
Hi @insane_dev - That error can come from a few places, but the most likely case is that the Medplum server cannot find any AWS credentials. The most common place would be loading them from
~/.aws/credentials
. See this guide: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html
i
Thank you @codye , I’ll look into that now
Good day all, @codye So I’ve you looked at the guide above and still the same error. I am new to AWS but I was able to create a lambda role and after running the deploy-bot-layer.sh it created a lambda layer in AWS. I enabled bots at project level and used the bot endpoint for my endpoint. And still the same error. My AWS credentials are ok, port 8103 is hosted over the web using ngrok and the botlambdarolearn was updated in the medplum.config.json. I think I’m missing something, pls help me with this
c
Ok, sorry to hear that. Do you have the AWS CLI setup? Can you run
aws lambda list-functions
?
i
Yes
I’ll send a screenshot now
c
Hm, interesting. Are you running medplum server directly on the host OS? Or are you running in a Docker image or a VM of some kind?
i
c
Are there any related logs in the medplum server console where you're running the application?
Ok, that looks good -- yes, that would confirm that your credentials are correctly configured.
So now the question is why medplum server cannot find them
i
I am running medplum on docker
With the redis and postgress image
And then npm run dev to start the server and app
c
Ok, you run
npm run dev
also in a Docker container? Or you run that directly on your host OS?
i
Directly on the host os
c
Ok. Are you free to do screensharing sometime 2-5pm Pacific Time today?
Nothing obvious jumping out at me right now
Maybe check the server logs in your terminal window -- might be some clues there
i
Yes I will be free by that time
There’s nothing on the server logs, I only see job successfuly created when I create a new Patient resources. I believe the job is from the subscription
c
Ok, it looks like you're triggering the Bot via Subscription. Did you try to execute the Bot via the Bot Editor UI? Also, just to confirm, have you tried deploying the Bot?
(That is a common gotcha - there is an explicit "deploy" step for the Bots)
i
I am currently redeploying medplum on my localhost, I’ll try to execute medplum using the bot editor ui and revert back
Thanks
Also after creating the medplum-bot-layer layer, am I to add it to a lambda function.. And what compatible runtime is best for the medplum-bot-layer ?
c
When you create a new bot through Project Admin, it should have
runtimeVersion: "awslambda"
i
Yes, that’s the default value
Same error even with the code editor
c
Ok, I'll DM you
Ok, this was really interesting! The issue was when running with
sudo
, because then the AWS libraries look for AWS credentials in `root`'s home directory, not the user. We got it figured out. I'll add a note somewhere in the documentation for this. Thanks @insane_dev !
i
Thank you @codye , I really appreciate!