Clasp: Error 400: invalid_scope

Created on 30 Aug 2018  路  14Comments  路  Source: google/clasp

Getting Error 400: invalid_scope when tried to authorize.

Steps to Reproduce the Problem

  1. Open cmd
  2. Type clasp login
  3. copy url and paste in browser
  4. hits to error

Specifications

  • Node version (node -v): 5.6.0
  • Version (clasp -v):1.5.3
  • OS (Mac/Linux/Windows):Windows
API outage

Most helpful comment

Hi all,
It looks like there's an outage with StackDriver causing the error. I'm trying to have the team fix it.

If you want to temporarily fix login until that problem is resolved, follow these instructions:

Open the file

/usr/local/lib/node_modules/@google/clasp/src/auth.js

(If that doesn't work, your computer may have a different location. Try this to find the location: npm list -g | grep "clasp")

And comment out the line with a prefix of //:

https://www.googleapis.com/auth/logging.read

Update: Aug 31, 6:30pm PST
The API team says that they will fix this issue Monday. 馃檨

I'll give updates here.

All 14 comments

Thanks for the report. It looks like there is a backend change causing this issue.
I'll triage this tomorrow.

Just tried using Clasp for the first time today and got a similar error when attempting to login.

I just started using clasp yesterday. Was able to login just fine. However, after some experimentation, I removed the hidden credential file and tried to login again. I now get this error as well:

Error 400: invalid_scope
Some requested scopes cannot be shown:     [https://www.googleapis.com/auth/drive.metadata.readonly,     https://www.googleapis.com/auth/script.projects, https://www.googleapis.com/auth/script.deployments, https://www.googleapis.com/auth/logging.read, https://www.googleapis.com/auth/script.webapp.deploy, https://www.googleapis.com/auth/cloud-platform.read-only]
Request Details
access_type=offline
response_type=code
client_id=<snip/>.apps.googleusercontent.com
redirect_uri=http://localhost:35237
display=page
scope=https://www.googleapis.com/auth/script.deployments     https://www.googleapis.com/auth/script.projects https://www.googleapis.com/auth/drive.metadata.readonly https://www.googleapis.com/auth/script.webapp.deploy https://www.googleapis.com/auth/cloud-    platform.read-only https://www.googleapis.com/auth/logging.read

Hi all,
It looks like there's an outage with StackDriver causing the error. I'm trying to have the team fix it.

If you want to temporarily fix login until that problem is resolved, follow these instructions:

Open the file

/usr/local/lib/node_modules/@google/clasp/src/auth.js

(If that doesn't work, your computer may have a different location. Try this to find the location: npm list -g | grep "clasp")

And comment out the line with a prefix of //:

https://www.googleapis.com/auth/logging.read

Update: Aug 31, 6:30pm PST
The API team says that they will fix this issue Monday. 馃檨

I'll give updates here.

Thanks for the update, @grant! Do we need to revert this change once Stackdriver is back, or is it safe to wait for the next npm update?

@janikgar This change disables the StackDriver logs feature.
Once the API outage is over (hopefully soon), you can manually uncomment the line or simply npm install clasp (the same version) again.

for those using Windows, the path is %appdata%\npm\node_modules\@google\clasp\src

On mac with NVM it will be under this kinda path:

$HOME/.nvm/versions/node/v10.8.0/lib/node_modules/@google/clasp/src

@grant yay! Thanks for the workaround 馃憤

Thanks @FransDM. The path you gave is missing the \ after node_modules (because of the github editor):
%appdata%\npm\node_modules\@google\clasp\src

Is this fixed yet? Thanks.

@jasonjurotich I'm going to talk to the team tomorrow after the US holiday (today) and I hope they'll fix it and provide an ETA then.

Hi all,
The team has fixed the login issue (logging.read issue). I've tested this locally. Thanks for your patience.

If you manually hacked the clasp source code with https://github.com/google/clasp/issues/303#issuecomment-417403202 and want to use clasp logs, just reinstall clasp to undo the change.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

freddy-daniel picture freddy-daniel  路  7Comments

dskeithbuck picture dskeithbuck  路  5Comments

smandava picture smandava  路  8Comments

Haris-Jamil picture Haris-Jamil  路  6Comments

OleksandrRakovets picture OleksandrRakovets  路  3Comments