grafana-infinity-datasource: [Bug] Crash when adding or updating OAuth2 datasources in latest grafana
Describe the bug
“An unexpected error happened” when adding OAuth2 client secret to a datasource, or when editing a datasource with OAuth2 enabled. For example, I set up an azure AD app by following instructions on https://github.com/yesoreyeram/grafana-infinity-datasource/discussions/404 and while I am able to get data from this datasource, I am unable to edit the datasource or add new OAuth2 datasources. I am able to add other types of datasource.
TypeError: Cannot assign to read only property 'oauth2_type' of object '#<Object>'
at fO (https://muonspacegroundprod.grafana.net/public/plugins/yesoreyeram-infinity-datasource/module.js?_cache=2.0.0:3:1780081)
Steps to reproduce
Add new datasource Use OAuth2 authentication Fill out the fields When I type in the field for “client secret” I get redirected to “An unexpected error happened” When editing an existing datasource using OAuth2, most interactions with the datasource authentication lead to the same issue.
Sample Data
No data other than the error message and the screen recording below
Screenshots
Version Details:
- Grafana version : 10.2.0-60139
- Plugin version : 2.0.0
Additional context
I’m not sure if this is an issue with grafana or with the datasource itself or some combination of both
About this issue
- Original URL
- State: closed
- Created 10 months ago
- Reactions: 2
- Comments: 25
Just back to work after a break. I will take a look later this week.
Meantime, workaround is to use older version of grafana or use grafana http api to configure the datasource or use grafana datasource provisioning or things such as terraform to configure the datasource. ( I can confirm that this is just a UI bug but the underlying functionality not affected )
New version 2.2.1 is now available in grafana cloud for download with this fix. Let me know if anyone still having issue
Actually, I published v2.1.0 which included some fix along with other features. But unfortunately the fix didn’t help. Also noticing this happening only on grafana cloud.
I am planning to work on the follow-up fix later this weekend. Sorry for the trouble. Meantime, feel free to use the workarounds suggested.
@Av8tor101 My colleague confirmed that downgrading to 10.0.x works. He had Grafana Support downgrade his Cloud instance.
Alternative, you can try via API. Here is a public postman collection for my example. https://www.postman.com/eduardo-melendez/workspace/grafana-infinity-datasource/collection/23517476-0fe17351-56f9-44a1-a2cd-b94866d806f3?action=share&creator=23517476
Just fork it, change the variables, and make modifications to the
POST Create a data source
body endpoint for your needs. Just need to convert the Provisioning config into JSON.Any update on this? I’m not sure what the work around is. Grafana v10.3.0-62882 (dd773e74f1)