chronic-care / mcc-project

MCC eCare Plan project planning and documentation
Apache License 2.0
0 stars 1 forks source link

eCarePlanner 3.1.1 - logging calls being sent to wrong domain #346

Closed mattStorer closed 7 months ago

mattStorer commented 7 months ago

These are the calls that eCarePlanner 3.1.1 is making to perform logging requests:

image

As you can see, it's hitting provder-mccecare-dev.ohsu.edu, which is incorrect. It should be hitting log-mccecare-dev.ohsu.edu, as we configure it in the docker create command that creates the container:

image

swmuir commented 7 months ago

Unable to duplicate

the following environment

services: ecareplanner: image: chroniccare/ecareplanner:latest container_name: ecareplanner${MELD_SANDBOX_NAME} domainname: ecareplanner${MELD_SANDBOX_NAME} network_mode: default environment:

results in [Error] Failed to load resource: the server responded with a status of 405 (Not Allowed) (do-log, line 0) http://localhost/someurlhere/log/do-log

kbertodatti commented 7 months ago

@mattStorer please see the comment above from Sean.

mattStorer commented 7 months ago

upon attempting to recreate this issue, eCarePlanner doesn't appear to be attempting to log anything at all now, which is weird.

here's what we use to create the container:

docker create --name=ecareplanner-1 -p 127.0.0.1:50001:80 --restart always --env CLIENT_ID="7666b9ec-8caa-43bd-8231-2eea4f5d281d" --env LOG_ENABLED="true" --env LOG_ENDPOINT_URI="https://log-mccecare-dev.ohsu.edu" --env LOG_API_KEY="f9ba53e8-ea8c-437c-a813-e750d0166c63" chroniccare/ecareplanner:latest

see attached for a zipped copy of the network tab / HAR file export for network details: eCarePlanner 3.1.1 - POC - 2024-03-27.har.zip

kbertodatti commented 7 months ago

@swmuir to re-test

mattStorer commented 7 months ago

checked this again in eCarePlanner v3.1.2 - issue appears to persist. calls to do-log are still being sent to https://provider-mccecare-dev.ohsu.edu instead of to the configured LOG_ENDPOINT_URI domain https://log-mccecare-dev.ohsu.edu:

image

Request headers:

POST /log/do-log HTTP/2
Host: provider-mccecare-dev.ohsu.edu
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:124.0) Gecko/20100101 Firefox/124.0
Accept: application/json, text/plain, */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
Content-Type: application/json
Authorization: Bearer f9ba53e8-ea8c-437c-a813-e750d0166c63
Content-Length: 94
Origin: https://provider-mccecare-dev.ohsu.edu
Connection: keep-alive
Referer: https://provider-mccecare-dev.ohsu.edu/goals?code=eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJ1cm46b2hzdTpjZXBvYyIsImNsaWVudF9pZCI6Ijc2NjZiOWVjLThjYWEtNDNiZC04MjMxLTJlZWE0ZjVkMjgxZCIsImVwaWMuZWNpIjoidXJuOmVwaWM6T0hTVSIsImVwaWMubWV0YWRhdGEiOiJ6LTczeUZOQ1ptV0hXUlc4Q2Jpb0EzUE5mQ1JnU0lPRmthR21DR25ibU9FUHlVUy1Zay12RUdBLXFzdngxeDkzWVFYNjNSRVYtOFR3Y2pEYzUyWkVsUlVzOWFuejhrSXlmZXFzS1hxNG5JWEt1U3RMNnB2YVFUUTVTYVVDZ280eCIsImVwaWMudG9rZW50eXBlIjoiY29kZSIsImV4cCI6MTcxMjY4NjIzMSwiaWF0IjoxNzEyNjg1OTMxLCJpc3MiOiJ1cm46b2hzdTpjZXBvYyIsImp0aSI6Ijc5MGVjZTVlLTJkYmQtNDZjNC1iZGJmLWQ4MTIxY2QxMzIyNyIsIm5iZiI6MTcxMjY4NTkzMSwic3ViIjoiZVVOV2UtVGNVTlpKZ3lReFRpeVB5V0EzIn0.YMVp_YzFfXil74oRR7zeMOflmqL1SWYkO7XPpTw_pJcv4gq5bx-TKkH0LYAvX-EqgfIniCUvDw6g4gIW7KkDrhQz-m6vcZdDi3SeB06AqaNA2DjOIfLTylD0SluuEGJVzjK2TZs2QSJtsfxdbdJcqlk1466ajeAkIUg2IA2qGDnkkKgoNTucThaLT10DgRaw3W5VvB8YnbSveNDVU9pEG2CRMRrs_ouCRPc_nX0ES5wMSXhB5H-ZvqGSgqNiS_TZe2_vEC6ZKsMPXx7DVIucNRqkFcBKKWHAgU11uTrXCu_q2nsKI2XXmaxqabwKFRsscjDr-qXqm_h7lFCMyoSg-A&state=KPFKizNGz9m2eidL
Cookie: _ga=GA1.1.1956091573.1696437684; _ga_2R8QZM78M8=GS1.2.1696520762.2.0.1696520762.0.0.0; _ga_YLG8SJ3WGG=GS1.1.1708445656.17.1.1708446898.0.0.0; _ga_W69YK8NNSD=GS1.1.1708360146.2.0.1708360150.0.0.0; visid_incap_2883747=bxQwP1FLSBKlKmerFxV0FSPNJmUAAAAAQUIPAAAAAAB9zg1aUWLzwciyScWwFELN; _ga_Q2Z9M88T34=GS1.1.1711464354.8.0.1711464354.0.0.0; visid_incap_2219153=rsL42TK9SaecKZxMxJ644AfEgWUAAAAAQUIPAAAAAAAJGm8MFEu+NpUFr/3wLGZC; ohsu_cid=GA4-1956091573.1696437684; WFC_INSTANCE=z23TJO6wyFa4MRlfS0rowtpDpCKF2hzzeOxaKR9Pakc-; WFC_USER=+gMublYD+6WQescO6N8AZCUZ4o1wVaHw6NKk46iLMz7wgUeaZuoNuWdNV3ThwtJB; OAM_LANG_PREF=v1.0~cHJlZmVycmVkTGFuZ3VhZ2U9ZW5+ZGVmYXVsdExhbmd1YWdlTWFya2VyPWZhbHNl; OAMAuthnHintCookie=1; FISPRD=jj3zfY7qCjxwVsZYwEOvc0CI0x; incap_ses_2101_2219153=Vr7OSjnC0yXpaMUa3EAoHV/XgWUAAAAAT/vMyk9ni5YtHZFzmMgZxw==
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-origin
Pragma: no-cache
Cache-Control: no-cache

Response headers:

HTTP/2 405 
date: Tue, 09 Apr 2024 18:05:35 GMT
server: nginx/1.25.4
strict-transport-security: max-age=17280000; includeSubDomains; preload
content-security-policy: frame-ancestors 'self' https://*.epic.com https://*.ohsu.edu;
x-content-type-options: nosniff
content-type: text/html; charset=UTF-8
content-length: 157
access-control-allow-origin: *
vary: Origin
X-Firefox-Spdy: h2

This is how we create the container, which contains the correct log endpoint URL:

docker create --name=ecareplanner-1 -p 127.0.0.1:50001:80 --restart always \
  --env CLIENT_ID="7666b9ec-8caa-43bd-8231-2eea4f5d281d" \
  --env LOG_ENABLED="true" \
  --env LOG_ENDPOINT_URI="https://log-mccecare-dev.ohsu.edu" \
  --env LOG_API_KEY="f9ba53e8-ea8c-437c-a813-e750d0166c63" \
  chroniccare/ecareplanner:latest
mattStorer commented 7 months ago

ah okay yes I see that the environment variable was changed from LOG_ENDPOINT_URI to LOG_END_POINT_URI. not sure why that _ was added in there but whatever at least now I know why it wasn't working. updated environment variable and tested, verified it's now calling to the right place.

image

still not working due to failing OPTIONS calls which may be something on our end, will investigate