Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Bug]: Packard Health (athena health) issue - NetworkError when attempting to fetch resource. #396

Closed
eldridgea opened this issue Jan 29, 2024 · 19 comments · Fixed by #398
Closed
Assignees
Labels
bug Something isn't working

Comments

@eldridgea
Copy link

eldridgea commented Jan 29, 2024

Contact Details

eldridgea@gmail.com

What happened?

When adding the data source Packard Health, I am able to login and am redirected back to Fasten, where a tile for Pakcard Health appears. However after a moment, it vanished and showed an error toast message An error occurred while initialize external data source connection: '{}'

Apologies fir the lack of log attachments -- are you looking for the docker container logs or something else?

Screenshot 2024-01-29 at 11 10 57 AM Screenshot 2024-01-29 at 11 11 06 AM

(Loving the software so far -- thanks so much for the efforts!)

Flavor

Docker

Version

1.1.0

Relevant log output

No response

@eldridgea eldridgea added the bug Something isn't working label Jan 29, 2024
@AnalogJ
Copy link
Member

AnalogJ commented Jan 29, 2024

can you open up the background jobs page (click the bell icon in the top right, then the show background jobs link)
You should see a row in the table for your failed connection. If you click on that, do you see anything in the JSON that could be relevant?

(please be sure to remove any ids/personally identifiable information before copy-pasting in this issue)

@eldridgea
Copy link
Author

Ah, thank you! Yes I see a line item for each time I tried where it has the status of STATUS_FAILED

The details show

{
  "source_id": "00000000-0000-0000-0000-000000000000",
  "brand_id": "3bbe88aa-a376-464c-85f7-a30ab04c57c3",
  "checkpoint_data": {
    "brand_id": "3bbe88aa-a376-464c-85f7-a30ab04c57c3",
    "code_challenge_method": "S256",
    "endpoint_id": "c80fbbc2-ad04-4a3c-90a3-f94ebeb9f34e",
    "portal_id": "72dcf23a-5ad2-4999-aa34-059042faf752",
    "state": "0b806c11-dd80-4683-8295-4ab7f26fbc05"
  },
  "error_data": {
    "error": "{}",
    "stack": "",
    "summary": "An error occurred while initializing external data source connection: '{}'"
  }
}

@AnalogJ
Copy link
Member

AnalogJ commented Jan 29, 2024

ugh. thats not helpful at all. Let me make some changes to the main branch and add some additional debugging if I can.

In the meantime, can you check your Browser console and docker terminal for errors that could be related?

@abuettner93
Copy link

This is for another athena health connection (MedHelp). Ive sanitized the ids, but the big one seems to be the stack in error_data. Running as a docker image on Mac. Potentially missing/unavailable resources in the web assets?

{
"source_id": "00000000-0000-0000-0000-000000000000",
"brand_id": "7fdbf11c-4bc1-47a2-b14b-0c5ec1452ada",
"checkpoint_data": {
"brand_id": "7fdbf11c-4bc1-47a2-b14b-0c5ec1452ada",
"code_challenge_method": "S256",
"endpoint_id": "sanitized",
"portal_id": "0d58b2b2-7280-45c8-8faf-888a368ab340",
"state": "sanitized"
},
"error_data": {
"error": "{}",
"stack": "TypeError: Failed to fetch\n at http://localhost:9090/web/assets/js/lforms/assets/lib/zone.min.js:29:5826\n at a. (http://localhost:9090/web/assets/js/lforms/assets/lib/zone.min.js:22:3126)\n at http://localhost:9090/web/main.3010d54f37fe1180.js:1:756473\n at Generator.next ()\n at De (http://localhost:9090/web/polyfills.5ca82281f9682ff9.js:1:215358)\n at kt (http://localhost:9090/web/polyfills.5ca82281f9682ff9.js:1:215584)\n at e.invoke (http://localhost:9090/web/assets/js/lforms/assets/lib/zone.min.js:14:7205)\n at Object.onInvoke (http://localhost:9090/web/main.3010d54f37fe1180.js:1:114496)\n at e.invoke (http://localhost:9090/web/assets/js/lforms/assets/lib/zone.min.js:14:7145)\n at t.run (http://localhost:9090/web/assets/js/lforms/assets/lib/zone.min.js:14:2289)",
"summary": "An error occurred while initializing external data source connection: '{}'"
}
}

@Eschguy
Copy link

Eschguy commented Jan 29, 2024

Having the same issue for HealthPartners

{
  "source_id": "00000000-0000-0000-0000-000000000000",
  "brand_id": "3905751e-68d3-4cc8-b8b4-3b340160661f",
  "checkpoint_data": {
    "brand_id": "3905751e-68d3-4cc8-b8b4-3b340160661f",
    "code_challenge_method": "S256",
    "endpoint_id": "5e4643f0-fb3b-46b6-a4f4-1fa108246eb6",
    "portal_id": "514e1d13-1ad0-42c9-9972-0139d1698642",
    "state": "3598bb7b-0642-4aec-bb01-3b40aa0c4d21"
  },
  "error_data": {
    "error": "{}",
    "stack": "298/callback/Rot</a<@http://172.16.0.199:9090/web/main.3010d54f37fe1180.js:1:2689464\nDe@http://172.16.0.199:9090/web/polyfills.5ca82281f9682ff9.js:1:215358\nkt@http://172.16.0.199:9090/web/polyfills.5ca82281f9682ff9.js:1:215586\ne.prototype.invoke@http://172.16.0.199:9090/web/assets/js/lforms/assets/lib/zone.min.js:14:7205\nonInvoke@http://172.16.0.199:9090/web/main.3010d54f37fe1180.js:1:114496\ne.prototype.invoke@http://172.16.0.199:9090/web/assets/js/lforms/assets/lib/zone.min.js:14:7145\nt.prototype.run@http://172.16.0.199:9090/web/assets/js/lforms/assets/lib/zone.min.js:14:2289\nZ/<@http://172.16.0.199:9090/web/assets/js/lforms/assets/lib/zone.min.js:29:2798\ne.prototype.invokeTask@http://172.16.0.199:9090/web/assets/js/lforms/assets/lib/zone.min.js:14:7889\nonInvokeTask@http://172.16.0.199:9090/web/main.3010d54f37fe1180.js:1:114312\ne.prototype.invokeTask@http://172.16.0.199:9090/web/assets/js/lforms/assets/lib/zone.min.js:14:7810\nt.prototype.runTask@http://172.16.0.199:9090/web/assets/js/lforms/assets/lib/zone.min.js:14:2952\nm@http://172.16.0.199:9090/web/assets/js/lforms/assets/lib/zone.min.js:14:10271\n",
    "summary": "An error occurred while initializing external data source connection: '{}'"
  }
}

@AnalogJ
Copy link
Member

AnalogJ commented Jan 29, 2024

thanks for all the info @Eschguy @abuettner93 @eldridgea

@abuettner93: the references in the stack trace field just mean that the failure occurred in the frontend javascript, not that there's a missing resource.

Do you see anything in your browser console logs? There should be something there, or in the network tab at the very least.

@eldridgea
Copy link
Author

eldridgea commented Jan 29, 2024

I did have some console areas. This is a little out of my wheelhouse so not sure if this is relevant but attached the erros below that I got in the console after try to add Packard Health again. There did seem to be some issues with the callbac urls.

Loading module from “https://fasten.naphos.com/web/sources/callback/polyfills.5ca82281f9682ff9.js” was blocked because of a disallowed MIME type (“text/html”).
[1d69cb82-79c9-4729-954d-0b7f15dd52b2](https://fasten.naphos.com/web/sources/callback/1d69cb82-79c9-4729-954d-0b7f15dd52b2?code=Z0Mu-nfcqhOCLg8_X9ZAYZ2CydQoXqKWDqlQ6Nxrwyw&state=1d69cb82-79c9-4729-954d-0b7f15dd52b2)
The script from “https://fasten.naphos.com/web/sources/callback/assets/js/webcomponents/webcomponents-loader.js” was loaded even though its MIME type (“text/html”) is not a valid JavaScript MIME type.
[1d69cb82-79c9-4729-954d-0b7f15dd52b2](https://fasten.naphos.com/web/sources/callback/1d69cb82-79c9-4729-954d-0b7f15dd52b2?code=Z0Mu-nfcqhOCLg8_X9ZAYZ2CydQoXqKWDqlQ6Nxrwyw&state=1d69cb82-79c9-4729-954d-0b7f15dd52b2)
Loading module from “https://fasten.naphos.com/web/sources/callback/runtime.e434440f45e5e380.js” was blocked because of a disallowed MIME type (“text/html”).
[1d69cb82-79c9-4729-954d-0b7f15dd52b2](https://fasten.naphos.com/web/sources/callback/1d69cb82-79c9-4729-954d-0b7f15dd52b2?code=Z0Mu-nfcqhOCLg8_X9ZAYZ2CydQoXqKWDqlQ6Nxrwyw&state=1d69cb82-79c9-4729-954d-0b7f15dd52b2)
The script from “https://fasten.naphos.com/web/sources/callback/assets/js/asmcrypto-2.3.2.all.es5.min.js” was loaded even though its MIME type (“text/html”) is not a valid JavaScript MIME type.
[1d69cb82-79c9-4729-954d-0b7f15dd52b2](https://fasten.naphos.com/web/sources/callback/1d69cb82-79c9-4729-954d-0b7f15dd52b2?code=Z0Mu-nfcqhOCLg8_X9ZAYZ2CydQoXqKWDqlQ6Nxrwyw&state=1d69cb82-79c9-4729-954d-0b7f15dd52b2)
The script from “https://fasten.naphos.com/web/sources/callback/assets/js/lforms/assets/lib/zone.min.js” was loaded even though its MIME type (“text/html”) is not a valid JavaScript MIME type.
[1d69cb82-79c9-4729-954d-0b7f15dd52b2](https://fasten.naphos.com/web/sources/callback/1d69cb82-79c9-4729-954d-0b7f15dd52b2?code=Z0Mu-nfcqhOCLg8_X9ZAYZ2CydQoXqKWDqlQ6Nxrwyw&state=1d69cb82-79c9-4729-954d-0b7f15dd52b2)
The script from “https://fasten.naphos.com/web/sources/callback/assets/js/lforms/lhc-forms.js” was loaded even though its MIME type (“text/html”) is not a valid JavaScript MIME type.
[1d69cb82-79c9-4729-954d-0b7f15dd52b2](https://fasten.naphos.com/web/sources/callback/1d69cb82-79c9-4729-954d-0b7f15dd52b2?code=Z0Mu-nfcqhOCLg8_X9ZAYZ2CydQoXqKWDqlQ6Nxrwyw&state=1d69cb82-79c9-4729-954d-0b7f15dd52b2)
Loading module from “https://fasten.naphos.com/web/sources/callback/main.65e7f4c9abd826a6.js” was blocked because of a disallowed MIME type (“text/html”).
[1d69cb82-79c9-4729-954d-0b7f15dd52b2](https://fasten.naphos.com/web/sources/callback/1d69cb82-79c9-4729-954d-0b7f15dd52b2?code=Z0Mu-nfcqhOCLg8_X9ZAYZ2CydQoXqKWDqlQ6Nxrwyw&state=1d69cb82-79c9-4729-954d-0b7f15dd52b2)
The script from “https://fasten.naphos.com/web/sources/callback/assets/js/lforms/fhir/lformsFHIRAll.min.js” was loaded even though its MIME type (“text/html”) is not a valid JavaScript MIME type.
[1d69cb82-79c9-4729-954d-0b7f15dd52b2](https://fasten.naphos.com/web/sources/callback/1d69cb82-79c9-4729-954d-0b7f15dd52b2?code=Z0Mu-nfcqhOCLg8_X9ZAYZ2CydQoXqKWDqlQ6Nxrwyw&state=1d69cb82-79c9-4729-954d-0b7f15dd52b2)
The script from “https://fasten.naphos.com/web/sources/callback/scripts.54bdb8578a17581d.js” was loaded even though its MIME type (“text/html”) is not a valid JavaScript MIME type.
[1d69cb82-79c9-4729-954d-0b7f15dd52b2](https://fasten.naphos.com/web/sources/callback/1d69cb82-79c9-4729-954d-0b7f15dd52b2?code=XXXXXX&state=1d69cb82-79c9-4729-954d-0b7f15dd52b2)
Uncaught SyntaxError: expected expression, got '<'
[asmcrypto-2.3.2.all.es5.min.js:1:1](https://fasten.naphos.com/web/sources/callback/assets/js/asmcrypto-2.3.2.all.es5.min.js)
Uncaught SyntaxError: export declarations may only appear at top level of a module [scripts.54bdb8578a17581d.js:1:1286](https://fasten.naphos.com/web/scripts.54bdb8578a17581d.js)
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://api.platform.athenahealth.com/oauth2/v1/token. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 200.

TypeError: NetworkError when attempting to fetch resource.
Screenshot 2024-01-29 at 3 40 36 PM

There were also a few errors in the Network tab:

Screenshot 2024-01-29 at 3 44 30 PM

Edited some potentially sensitive data - @AnalogJ

@AnalogJ
Copy link
Member

AnalogJ commented Jan 29, 2024

This is exactly what I needed, thanks @eldridgea

CORS header Access-Control-Allow-Origin missing - that's the issue. Let me do some spelunking and get back to you all once I have a fix.

@AnalogJ
Copy link
Member

AnalogJ commented Jan 30, 2024

confirmed, I was able to replicate this issue locally (it took me a while because I had to find a healthcare institution that uses Athena, and allows me to register as a patient)

The error was actually NetworkError when attempting to fetch resource. -- Which in turn is related to the CORS header Access-Control-Allow-Origin missing message we saw in the browser console

working on a fix now

@AnalogJ AnalogJ changed the title [Bug]: Packard Health (athena health) add issue [Bug]: Packard Health (athena health) issue - NetworkError when attempting to fetch resource. Jan 30, 2024
@AnalogJ
Copy link
Member

AnalogJ commented Jan 30, 2024

Fix is in place, letting it run though CI. I'll merge it after dinner.

@AnalogJ
Copy link
Member

AnalogJ commented Jan 30, 2024

Hey @eldridgea @Eschguy @abuettner93

Can you pull the latest docker image and verify that the Athena providers you were trying to connect are now working? I was able to replicate this issue locally and I've since made a fix

@eldridgea
Copy link
Author

Thanks! I updated but looks like there's still one CORS issue: Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://api.platform.athenahealth.com/oauth2/v1/token. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 200.

Console:
Screenshot 2024-01-30 at 10 43 35 AM

Network tab:
Screenshot 2024-01-30 at 10 43 47 AM

The Fasten job history was still STATUS_FAILED with these details:

{
  "source_id": "00000000-0000-0000-0000-000000000000",
  "brand_id": "3bbe88aa-a376-464c-85f7-a30ab04c57c3",
  "checkpoint_data": {
    "brand_id": "3bbe88aa-a376-464c-85f7-a30ab04c57c3",
    "code_challenge_method": "S256",
    "endpoint_id": "c80fbbc2-ad04-4a3c-90a3-f94ebeb9f34e",
    "portal_id": "72dcf23a-5ad2-4999-aa34-059042faf752",
    "state": "13143927-03c3-426c-a0e2-e52b669fb0a4"
  },
  "error_data": {
    "error": "{}",
    "stack": "",
    "summary": "An error occurred while initializing external data source connection: '{}'"
  }
}

@AnalogJ
Copy link
Member

AnalogJ commented Jan 30, 2024

Hey @eldridgea can you confirm which version of the Docker image you're running? There should be some version information in the footer once you login.

@eldridgea
Copy link
Author

eldridgea commented Jan 30, 2024

Looks like v1.1.0.
Maybe I didn't update the image like I thought I did?

@AnalogJ
Copy link
Member

AnalogJ commented Jan 30, 2024

that'll be locked to a specific tag.

Can you try pulling and running ghcr.io/fastenhealth/fasten-onprem:main

@eldridgea
Copy link
Author

Ahh, that did it! (version main#c48af66)

This is great, thanks so much for the amazingly quick turnaround and the great software overall!

@Eschguy
Copy link

Eschguy commented Jan 30, 2024

Still no luck with a fresh pull

{
  "source_id": "00000000-0000-0000-0000-000000000000",
  "brand_id": "3905751e-68d3-4cc8-b8b4-3b340160661f",
  "checkpoint_data": {
    "brand_id": "3905751e-68d3-4cc8-b8b4-3b340160661f",
    "code_challenge_method": "S256",
    "endpoint_id": "5e4643f0-fb3b-46b6-a4f4-1fa108246eb6",
    "portal_id": "514e1d13-1ad0-42c9-9972-0139d1698642",
    "state": "fee540da-8195-4b84-94a0-ce16c5137c83"
  },
  "error_data": {
    "error": "{\"fileName\":\"http://172.16.0.199:9090/web/main.5a380b0d0f41b8fc.js\",\"lineNumber\":1,\"columnNumber\":2689696,\"message\":\"invalid_grant\"}",
    "stack": "298/callback/Rot</a<@http://172.16.0.199:9090/web/main.5a380b0d0f41b8fc.js:1:2689696\nDe@http://172.16.0.199:9090/web/polyfills.5ca82281f9682ff9.js:1:215358\nkt@http://172.16.0.199:9090/web/polyfills.5ca82281f9682ff9.js:1:215586\ne.prototype.invoke@http://172.16.0.199:9090/web/assets/js/lforms/assets/lib/zone.min.js:14:7205\nonInvoke@http://172.16.0.199:9090/web/main.5a380b0d0f41b8fc.js:1:114496\ne.prototype.invoke@http://172.16.0.199:9090/web/assets/js/lforms/assets/lib/zone.min.js:14:7145\nt.prototype.run@http://172.16.0.199:9090/web/assets/js/lforms/assets/lib/zone.min.js:14:2289\nZ/<@http://172.16.0.199:9090/web/assets/js/lforms/assets/lib/zone.min.js:29:2798\ne.prototype.invokeTask@http://172.16.0.199:9090/web/assets/js/lforms/assets/lib/zone.min.js:14:7889\nonInvokeTask@http://172.16.0.199:9090/web/main.5a380b0d0f41b8fc.js:1:114312\ne.prototype.invokeTask@http://172.16.0.199:9090/web/assets/js/lforms/assets/lib/zone.min.js:14:7810\nt.prototype.runTask@http://172.16.0.199:9090/web/assets/js/lforms/assets/lib/zone.min.js:14:2952\nm@http://172.16.0.199:9090/web/assets/js/lforms/assets/lib/zone.min.js:14:10271\n",
    "summary": "An error occurred while initializing external data source connection: '{\"fileName\":\"http://172.16.0.199:9090/web/main.5a380b0d0f41b8fc.js\",\"lineNumber\":1,\"columnNumber\":2689696,\"message\":\"invalid_grant\"}'"
  }
}

Do I need to have a domain tied to the instance or anything? With it being health records I didn't want to expose it anywhere and keep it internal (my 172.16.X.X IP).

I have my docker logs if you want them, Pastebin seems down at the moment though.

@AnalogJ
Copy link
Member

AnalogJ commented Jan 30, 2024

@Eschguy I think you're running into a different error actually.

Your provider seems to be using Epic/MyChart to manage their patient portal.

Do I need to have a domain tied to the instance or anything? With it being health records I didn't want to expose it anywhere and keep it internal (my 172.16.X.X IP).

Nope, that shouldn't effect it at all. If I had to guess, this is related to the version of the Epic software that your provider uses. I have a epic-legacy integration that I might have to enable for this provider. Can you open a new GH issue to track this?

@Eschguy
Copy link

Eschguy commented Jan 30, 2024

Done, see #400

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants