Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

WP Strava ERROR 401 Unauthorized #109

Open
jrfoell opened this issue Sep 24, 2021 · 4 comments · Fixed by #112 or #114
Open

WP Strava ERROR 401 Unauthorized #109

jrfoell opened this issue Sep 24, 2021 · 4 comments · Fixed by #112 or #114
Assignees
Labels

Comments

@jrfoell
Copy link
Collaborator

jrfoell commented Sep 24, 2021

This is an ongoing issue started here: https://wordpress.org/support/topic/wp-strava-error-401-unauthorized/

Several sites are having this issue but aren't reporting anything actively. See this search.

@thusgaard
Copy link

I seem to be getting a new error, @jrfoell :
WP Strava ERROR strava_info should be an array, received: false

Check out https://thusgaard.com in the right sidebar for an updated view.

@jrfoell
Copy link
Collaborator Author

jrfoell commented Sep 28, 2021

I seem to be getting a new error, @jrfoell : WP Strava ERROR strava_info should be an array, received: false

Interesting! I'm going to add some more debug code and build a release-candidate update zip that you can try to help resolve this 💪

@jrfoell
Copy link
Collaborator Author

jrfoell commented Nov 26, 2021

The mainline wp-strava plugin as of v2.12.0 now has all the debugging code (beta install not necessary): https://wordpress.org/plugins/wp-strava/

Level 1 - WPSTRAVA_DEBUG

To tun on wp-strava debugging, add this to your wp-config.php file:

define( 'WPSTRAVA_DEBUG', true );

The 401 Unauthorized errors seem to center around the authorization data not getting saved in the database (wp_option - strava_info). v2.12.0 and above will show a Debug section under Settings -> Strava when WPSTRAVA_DEBUG is set to true:

Strava-Settings-Debug-Info-WordPress

Steps I suggest you take:

  1. Remove your current Strava API settings by going to Settings -> Strava, removing the Saved ID and Nickname, then clicking Save Changes.
  2. Reconnect to your Strava account by going to Settings -> Strava, entering your Client ID and Client Secret, and clicking Save Changes.
  3. After reconnecting, copy and paste the Connection Info data into an email to [email protected]

Level 2 - WP_DEBUG + WPSTRAVA_DEBUG

This is only necessary if the Level 1 debugging doesn't produce any useful clues.

To start logging, make sure these settings (including the WPSTRAVA_DEBUG setting from above) are saved in your wp-config.php file:

define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );

These settings have the potential to produce a lot of output, so it's best they're not left on for long. Steps I suggest you take:

  1. Remove your current Strava API settings by going to Settings -> Strava, removing the Saved ID and Nickname, then clicking Save Changes.
  2. Upgrade the plugin to the beta version by going to Plugins -> Add New -> Upload Plugin. You'll be prompted to overwrite wp-strava.
  3. Add the above define settings to your wp-config.php file.
  4. Reconnect to your Strava account by going to Settings -> Strava, entering your Client ID and Client Secret, and clicking Save Changes.
  5. Verify that you have a file called debug.log in the wp-content folder of your WP installation.
  6. Remove or comment out the above define settings in your wp-config.php file to stop additional logging.
  7. Attach the debug.log file here or email it to [email protected]

Your debug.log file will contain sensitive information. Not usernames & passwords, but API key information. If you post it here, we can delete it after I've had a chance to take a look. If you don't feel comfortable posting here you can email it to me directly.

I have an idea of what's happening, but this will really help me nail down what the source is. Thank you for your help!

@jrfoell
Copy link
Collaborator Author

jrfoell commented Oct 28, 2022

@thusgaard are you able to test the latest version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants