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.

Users unable to complete setup due to Error: Bad Request: missing parameter: ‘code’

See original GitHub issue

Bug Description

There have been multiple reports over the past few days of users encountering an Error Bad Request: Missing parameter: ‘code’ error during plugin setup. This occurs when clicking on the “Continue” button at the OAuth stage.

image

There were reports of a similar error previously, with various different causes. In these cases the error was slightly different - invalid parameter: 'code' (screenshot) This has been documented internally and in some cases there has been a “re-do the plugin set up” option which did allow users to proceed.

One user (Not the original poster) was able to successfully complete setup after re-attempting. In this users cases they has encountered a 400 error on a Site Kit URL: https://sitekit.withgoogle.com/v2/site-management/setup/ 400

Another user who we suspect may be encountering the same reporting the below, indicating a possible permissions error. Another user, however, did specifically state they granted all permissions yet they encounter the same: https://example.com//?oauth2callback=1&authuser=0&error=access_denied&prompt=consent

Other users have reported the same after a site reset and after using the Health Check & Troubleshooting plugin, meaning no other plugins other than Site Kit active. Adam has tested the same hosting provider used by one reporter, without encountering any issue. Troubleshooting ongoing.

Reports:

It’s possible the below may also also experiencing the same error, based on the experience, with no mention of this specific error in the dashboard:

Insights & Troubleshooting Checks performed

  • Health Check & Troubleshooting plugin check - Same occurs
  • Uninstalled and reinstalled plugin
  • User confirmed no ““Critical errors”” in their Site Health status
  • Attempted setup/viewing dashboards from another device
  • Temporary disabled WAF rules at host level - including ModSecurity
  • Checked site setup and dashboard from another WordPress site on the same hosting platform
  • Reset Site Kit - Same occurs
  • Reset previous site records (on the SK service)
  • Disconnected Site Kit
  • Checked does the same occur from another WordPress administrator account

Additional Context

  • Recent reports all started with SK 1.73.0
  • Unknown if these recent reports were all first time setup’s at this point
  • Unknown if all the same hosting platforms at this point
  • Unreproducible in support during testing so far

Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

Implementation Brief

Test Coverage

QA Brief

Changelog entry

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:11

github_iconTop GitHub Comments

2reactions
adamdunnagecommented, May 9, 2022

Below is a recording of the experience with the ‘Auto-redirect AMP pages’ setting first switched on(which it is by default in the Brave browser) and when it is switched off.

https://user-images.githubusercontent.com/91896826/167396761-6179f2e7-f1e0-4e03-9fa7-ec720c638822.mp4

1reaction
eugene-manuilovcommented, Dec 12, 2022

Yes, I mean that its weird that query params are stripped for the automatic AMP redirects case. In the code we use the same variable for both headers. Actually, I just noticed that we use Redirect-To and AMP-Redirect-To headers which is weird because the standard redirect header is Location. @felixarntz, do you know why we use the Redirect-To header?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error Bad Request: Missing parameter: 'code' - WordPress.org
I have tried the Health Check & Troubleshooting, and I've tried using a default theme and the error persists.
Read more >
Setup - Site Kit by Google
Error : Bad Request: missing parameter: 'code' ... This error can occur when AMP pages are automatically redirected to non-AMP pages by a...
Read more >
Google Site Kit Error - Bad Request missing parameter: 'code'
In this video, I will explain to you how to fix the Google site kit integration error. #wordpress #elementor.
Read more >
How to Fix a 400 Bad Request Error (Causes and Fixes) - Kinsta
The 400 (Bad Request) status code indicates that the server cannot or will not process the request due to something that is perceived...
Read more >
LinkedIn API Error Handling - Microsoft Learn
This error indicates that the HTTP protocol methods in your request are not supported. Check the documentation for the API to see supported ......
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