question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Refresh token not found error

See original GitHub issue

Hi,

This looks to be a great plugin but I am having trouble connecting to the Strava API.

I am running a grafana server locally in a docker container but I am getting the following error:

Refresh token not found, authorize datasource first

I have done the following:

  • Install the plugin in the docker container with the following command grafana-cli plugins install grafana-strava-datasource
  • Restart the docker container
  • Create a directory /var/lib/grafana/strava
  • Define an environment variable export GF_STRAVA_DS_DATA_PATH=/var/lib/grafana/strava/
  • Add a datasource specifying the Client ID and Client Secret from an app created in my Strava account
  • I get the following messages

image

Do you know how I can solve this issue please?

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:33 (18 by maintainers)

github_iconTop GitHub Comments

1reaction
Urbanssoncommented, Sep 12, 2022

Hey, I’m still getting errors trying to work with the strava datasource.

When I add it it says everything is fine, but when trying to use it I get: Error status: 401 Unauthorized With the following logs

logger=plugin.grafana-strava-datasource t=2022-09-12T09:49:48.67219754Z level=error msg="Strava API request error" error="Error status: 401 Unauthorized"
logger=context traceID=00000000000000000000000000000000 userId=2 orgId=1 uname=<redacted> t=2022-09-12T09:49:48.673140533Z level=error msg="Request Completed" method=POST path=/api/datasources/5/resources/strava-api status=500 remote_addr=10.1.0.41 time_ms=249 duration=249.390115ms size=76 referer="https://grafana.private/explore?left=%7B%22datasource%22% │

Looking in the logs when adding the data source i get the following:

logger=plugin.grafana-strava-datasource t=2022-09-12T09:46:44.184867085Z level=info msg="Starting background prefetcher"
logger=plugin.grafana-strava-datasource t=2022-09-12T09:46:44.196263286Z level=info msg="Cache has been reset" datasource=Strava
logger=plugin.grafana-strava-datasource t=2022-09-12T09:46:44.725947909Z level=error msg="Error fetching activities" error="error fetching activities: Error status: 401 Unauthorized"

But in the gui it reports as a success: image

I’m running on grafana version v9.1.2 (3c13120cde)

1reaction
alexanderzobnincommented, Jun 27, 2022

I changed a fallback for data directory, now if GF_STRAVA_DS_DATA_PATH is not set, files will be created in default OS cache directory (under strava-datasource subfolder). Hope, I will fix issues when token is writing into the file in the root directory. Changes were made in 22a87da1dd4f8b4a17d865e9dfb5d610e3fef1f0 and 7eaddba777394ecc13142befdc2f8a908736e803.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I fix the error "Refresh token missing"?
This error may occur if you have your inbox setup and connected with Google Apps. ... In some rare cases, you may run...
Read more >
Understanding Refresh Tokens - Auth0
To solve this problem, OAuth 2.0 introduced an artifact called a refresh token. ... Some of the reasons a refresh token may no...
Read more >
Refresh token not working. - Constant Contact Community
The two most common reasons for expired refresh token errors are: 1) When you refresh, you get both a new access token and...
Read more >
How to handle "refresh token is not available"? - Stack Overflow
1 Answer 1 ... Make sure that you are using access_type=offline when you are authenticating the user (Making him go through OAuth2 cycle)....
Read more >
Confusing error message on failed refresh token request
Eventually I found I could successfully refresh the access token by supplying a scope parameter with my custom scope based on it being ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found