-
Notifications
You must be signed in to change notification settings - Fork 438
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
CLASP RUN PRODUCES ERRORS #204
Comments
@campionfellin Can you look at this? |
Yep, I'll take a look in a little bit. |
So after some investigation this is what I've found: If you follow the instructions in this PR: #172 you should be able to use More complex functions (like yours, requiring access to Sheets) are not yet supported by
Which indicates that you don't have authorization. Of course this makes sense, because when we logged in we didn't give it the right scopes (for Sheets). Go here: Line 20 in 8e1c3fb
and add this scope
And if you open up the Sheet, you'll see the header has changed like you wanted to do. Obviously, this is not ideal. There is some discussion to be had about how we want to go about making this easier for the user. I remember @grant had some ideas previously about doing that, so we'll have to discuss. |
Makes sense, good report.
|
Hey, actually, I don't think we even really need |
We need Eventually we can have How script.google.com Requests ScopesFor example, running this in the Apps Script editor: function myFunction() {
SlidesApp.create("test");
} Will implicity request the How the
|
I don't think that we need All I see it used for is here: Line 155 in 8e1c3fb
Where it calls
Line 58 in 8e1c3fb
Line 270 in 8e1c3fb
|
Thanks guys. If it were possible, I think the idea would be to be able to stay in the terminal, even if that meant to type in more info at the beginning when beginning clasp. I am trying to get it to where we don't have to leave the terminal and go back to the GAS or the cloud project, which sort of defeats the purpose of using clasp in the first place, I would think. It would be wonderful, even if it meant adding more info within the terminal at the beginning, if we could just add the scopes we need, when we begin clasp in the terminal, or, ... another suggestion is that you just add the scopes that most people need, like gmail, sheets, slides, docs, drive, scripts, etc. so we can avoid having to go out to specify what else we needed. I don't think most people who use this would have a problem giving permissions to more scopes, if it reduced the steps... Either way, the goal would be not to have to leave the terminal so that we could run GAS anywhere (like on a cell phone using something like Termius), even if that meant putting in more info at the beginning. |
@campionfellin How did you create the |
OK, saw that you guys updated the readme file. (Remotely executes an Apps Script function. This function runs your script in the cloud. You must supply the functionName params. For now, it can only run functions that do not require other authorization.) Just a quick question, the sendMail doesn't need the Gmail API to send things? I know you guys must be overworked, but would it be possible to check-in in about a month to see if you had time to add the scopes? Thanks once again for all your hard work!!! |
Hey @jasonjurotich I don't think it needs the Gmail API, but it does need this scope: Definitely check in in about a month and we can update you! @grant I think this would be a good flow for how it works:
It would add those scopes to the |
Setting up
|
This is the flow (more or less): `clasp login`: logs you in using the default `clasp` credentials. Saves `.clasprc.json` to your `~` directory. `clasp login --creds`: logs you in using the file `credentials.json` in the directory that you are running the command in. Saves `.clasprc.json` to your current directory. `clasp login --creds other_creds.json`: logs you in using the credentials in `other_creds.json`. Saves `.clasprc.json` to your current directory. Your credentials file should look like this: ``` {"installed":{"client_id":"239267426989-275aglft6htcfsdj7t5d3csdlogchamh.apps.googleusercontent.com","project_id":"project-id-xxxxxxxxx","auth_uri":"https://accounts.google.com/o/oauth2/auth","token_uri":"https://accounts.google.com/o/oauth2/token","auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs","client_secret":"xxxxxxxx","redirect_uris":["urn:ietf:wg:oauth:2.0:oob","http://localhost"]}} ``` Signed-off-by: campionfellin <[email protected]> Related to #204 - [x] `npm run test` succeeds. - [x] `npm run lint` succeeds. - [ ] Appropriate changes to README are included in PR.
Hey all, two things:
|
Thanks IanWhalen, I was actually going to send a message to see how this was going. If there were a way to add the scopes and get them approved, that would be awesome, to solve this problem. I will be more than happy to make a YouTube video on this as soon as we can run other things to help other. |
Hi! Thanks for all your great work on this. Any updates? What is the smoothest way to use |
Yes, are there any updates in regards to being able to use other scopes? That would really help a ton to run things from the terminal. Thanks!! |
I hope to get some progress on this feature at some point. However, it is complicated to implement and not the highest upvoted feature request (proxy support is high). Pull requests or design ideas for this feature are also welcome. |
Perfectly understood. I have the same problem on a lower level when people ask me for GAS scripts. Thanks for keeping an eye on it. |
So theres actually another way in which we can add scopes to If you run a script but it doesn't have permissions, the error actually states the permissions required to run the script in an interesting string within the API response:
Unfortunately it only reports one scope at a time. We could possibly have the flow:
|
Note: This issue could probably be closed with #411. |
Qualitatively, I have to say this process is a huge pain in the butt. More substatively, and maybe this should be a separate issue, but the whole oauth process is only working with the Chrome browser: on both Firefox and Safari, I'm getting error messages when redirected to localhost. |
(Please search existing issues before creating a new one.)
Expected Behavior
A simple function should run to add text to a cell in a Google Spreadsheet
Actual Behavior
errors
Steps to Reproduce the Problem
function myFunction() {
SpreadsheetApp.openById('1acJRcIGXIYa9YNgO8g3DTrgFRO6Iqk0wNJoxYpsust8').getRange('A1').setValue('set');
}
Specifications
I am using the GCP with a VM instance with Ubuntu 18 (up to date) with Node 10.2 and @google/[email protected]
The errors are in the document attached. I tried the script in a normal manner after clasp open and it worked, so something is off with the clasp run. Maybe something with permissions?
errorclasp.txt
The text was updated successfully, but these errors were encountered: