Running bot on a Ubuntu server installation
# support
t
Hello, I have some questions about bot on vmcontext. I wanted to add an api call to an external server in my bot. But when running the bot on a self hosted Ubuntu installation I have the following error :
Copy code
Erreur: There is no suitable adapter to dispatch the request since :
- adapter xhr is not supported by the environment
- adapter http is not supported by the environment
- adapter fetch is not supported by the environment
AxiosError: There is no suitable adapter to dispatch the request since :
- adapter xhr is not supported by the environment
- adapter http is not supported by the environment
- adapter fetch is not supported by the environment
Unhandled error: An unknown error occurred
Error: An unknown error occurred
    at evalmachine.<anonymous>:5142:13
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async Object.handler (evalmachine.<anonymous>:5405:5)
    at async evalmachine.<anonymous>:5436:20
    at async runInVmContext (/usr/lib/medplum/packages/server/dist/fhir/operations/execute.js:375:30)
    at async executeBot (/usr/lib/medplum/packages/server/dist/fhir/operations/execute.js:154:22)
    at async executeOperation (/usr/lib/medplum/packages/server/dist/fhir/operations/execute.js:92:20)
    at async /usr/lib/medplum/packages/server/dist/fhir/operations/execute.js:48:24
Error {}
How would you recommend to handle this ? Thank you. @User
m
@thomabig so sorry for the delay! It looks like you might need to try a different adapter to make the HTTP requests. Is there a chance I could see the bot code where this error occurs? We might be able to use node's fetch api to perform the request that is failing
t
Hi Maddy, I modified my process. I create a Communication with a category code of "notification" and added a subscription to all creation of Communication that sends an api call to my server. It works 😉
161 Views