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

When pulling from repository I see [github assistant] undefined and nothing happens #135

Open
cookjeremiahironpadel opened this issue Jan 4, 2021 · 20 comments

Comments

@cookjeremiahironpadel
Copy link

I have followed the instructions in the video demo and I have used this in the old version . But when I tried today with the new editor, I get the undefined error in the editor and nothing happens when I click pull.

@cookjeremiahironpadel
Copy link
Author

I have figured out I can push successfully, there is just no way for me to successfully perform a pull.

@leonhartX
Copy link
Owner

could you open the browser's developer tools to check some logs in console?

@oshag-mcesc
Copy link

Some info: Private Google account, I have no issues (the extension was disabled, I enabled, open a script file and was presented with the usual "permsisions" screen. Gave permissions everything works great!
Using my Workplace account... issued getting logged in, finally got in using access token. Never got the permissions screen, somehow I finally did when logging in on the extension screen. Still no luck. I have attached 2 log files, on for a small pull and another for a big pull from 2 different scripts. Let me know if you need more info...
oshag2-script.google.com-1609810947485.log
oshag-script.google.com-1609810775190.log

@oshag-mcesc
Copy link

Just a quick update - for me, I am about 90% certain this has to with my Google Workplace (GSuite) account. I shared everything from my Workplace account to my "free" account and I was able to pull updates using the Assistant. So.... I will be getting with the Workplace admin to discuss further... I will direct them to info from issue #111

@cookjeremiahironpadel
Copy link
Author

Nothing much to see in the logs that you didn't already get from oshag-mcesc
jquery.min.js:6 PUT https://script.googleapis.com/v1/projects/1_aDg-KZc8QwQxi6xGwOsSogHk0bAKfZyGThyXefebwgyx2XxusJt9e2T/content?access_token=ya29.a0AfH6SMBv1m4JsfVrPqKELp4jPytbaLi3lIPGjRiyRpG4S-UcZDvthgFco3CkqmlSZbsiyxFEjaCfi5U5RolC_L6E4ggMy_Bu2d9yl8U7soUpdHD8nB_1cyZ2ff7NRloZ9LVGNRrEgMFvsiYiXXKSGvkpSPh09Uw5I_RP7 403
send @ jquery.min.js:6
ajax @ jquery.min.js:6
(anonymous) @ script-api.js:60
(anonymous) @ script-api.js:59
Promise.then (async)
pull @ script-api.js:58
(anonymous) @ gas-hub.js:464
dispatch @ jquery.min.js:5
y.handle @ jquery.min.js:5
m=_b,_tp:471 [Violation] 'requestAnimationFrame' handler took 57ms
[Violation] Forced reflow while executing JavaScript took 30ms

@cookjeremiahironpadel
Copy link
Author

{error: {code: 403,…}}
error: {code: 403,…}
code: 403
details: [{@type: "type.googleapis.com/google.rpc.LocalizedMessage", locale: "en-US",…}]
0: {@type: "type.googleapis.com/google.rpc.LocalizedMessage", locale: "en-US",…}
@type: "type.googleapis.com/google.rpc.LocalizedMessage"
locale: "en-US"
message: "User has not enabled the Apps Script API. Enable it by visiting https://script.google.com/home/usersettings then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry."
message: "User has not enabled the Apps Script API. Enable it by visiting https://script.google.com/home/usersettings then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry."
status: "PERMISSION_DENIED"

@cookjeremiahironpadel
Copy link
Author

It's fixed now, I had to enable the apps scripts API https://script.google.com/home/usersettings

@cookjeremiahironpadel
Copy link
Author

This would be good to add to the installation instructions and demo video if you can:

Remember to enable google apps script api https://script.google.com/home/usersettings or pull will not work.

@michaelos02
Copy link

michaelos02 commented Jan 6, 2021

I can also confirm that enabling apps script API in my Workplace account solved my issues! I don't know how it got "disabled" but, thanks to cookjeremiahironpadel providing the direct link I was all fixed up in no time!

I would suggest adding something like "even if you have enabled app scripts API before take a moment and verify it is still enabled...." or something like that.

@leonhartX leonhartX pinned this issue Jan 8, 2021
@dcarnese
Copy link

dcarnese commented Jan 13, 2021

Unfortunately, I'm getting the "[github assistant] undefined" warning on push rather than pull. After the attached console output is generated, nothing further happens.
gas-github push error

@andrewmoise-oydne
Copy link

I also see this - the last time I used it was before the IDE update that Google did. Now my IDE is updated and I get the "undefined" error when trying to push or pull (and rolling back to the previous IDE version leaves me without the push and pull arrows).

</3

I also am using a G Suite user for my editing if that makes a difference.

@andrewmoise-oydne
Copy link

Just verified that my app scripts API is enabled in G Suite (it was enabled the whole time). It still doesn't work :-(.

Push and pull both fail with the same error. I see "[github assistant] undefined" in the execution window, and this in my browser's JS console (actual access token is replaced with "(censored)":

GET https://script.googleapis.com/v1/projects/1fDM41IS3Afe3XJRGmNOBU6ul8cvaEIRCCPMrA5Yu6XRUYIm-hCn4A3pe/content?access_token=(censored) 403

@leonhartX
Copy link
Owner

umm, so seems it's the Script API permission issue, but sorry I don't have any G Suite account so can't find a way to check it. will check some doc to find if there's any diff between normal google account and G Suite

@Berredad
Copy link

Hello, I have the same issue I'm logged in and I can see the project and its branchs in the Google Apps Script IDE. But, when performing a pushing request the Chrome console throws {"message":"404 Project Not Found"}. I did make sure that the Google Apps Script API is enabled

@nattila1
Copy link

nattila1 commented Mar 1, 2021

Umm, I also a get [github assistant] undefined error despite I have already enabled API. I am also a G Suite user (super admin). Is there any chance to find the G Suite related problem?
BTW I was able to create a branch, but nothing more. Pull or push thow an error. In console I can see following error

Cross-Origin Read Blocking (CORB) blocked cross-origin response https://script.googleapis.com/v1/projects/1_NElg8Vmwa3Lksd9aMKKDsSzFHK6LfPqW33_2A07C153NTr4LIAetGZy/content?access_token=ya29.A0AfH6SMDS5qX_-0qIBUcLJ31-ptAvdRnps8le-YFuoTWiJtAEIqh1nH6Jiy7ZZompnlr8yF2eofv5f863BHI8fKWZixiYrACbh5q6bPw9ykh54WUQVLVTLG2rqt2JjSG3Owef9FuT_TLEJMnRvRo1YEFxk7LTtw with MIME type application/json. See https://www.chromestatus.com/feature/5629709824032768 for more details.

@andrewmoise-oydne
Copy link

I'm happy to dig into it if that's helpful... I haven't done any hacking / development work on gas-github but this is a pretty critical part of my workflow so I'm open to putting some work into getting it resolved.

@andrewmoise-oydne
Copy link

So this behavior just changed for me - for me, what used to work was enabling Google Apps Script API in both my G Suite user and my @gmail.com user. For some reason that would make everything work... up until the last week or so. Then recently, I've been getting this error when both pushing and pulling even when apps script API is enabled on both users.

I'll see if I can get time to dig into it + find out more but it's impacting me again as of now sadly.

@andrewmoise-oydne
Copy link

(Amendment: Actually that's not 100% true - the Google Sheet where I usually work is still working for both pushing and pulling. So maybe the issue is things changed in the last week, or maybe the issue is that things work in one of my sheets and not in another. Like I say I'll plan to dig into it more if there's no known fix or workaround on my end or settings or etc.)

@m1ck5k1
Copy link

m1ck5k1 commented Feb 8, 2022

I saw/had the same error message:

Error	[github assistant] TypeError: Cannot read properties of undefined (reading 'forEach')

After checking/confirming 'Google Apps Script API' was on (it was!)
I tracked the issue to my expired 'Github Assisstant' > 'Personal Access Token'.

Resolution steps;

  1. Renewed the 'Github Assisstant' > 'Personal access token' in GitHub
  2. Logged out of the Extension and then back in, with the new Token.

PS: And a big 'thank you' to everyone who contributes to this great utility!

@NoSubstitute
Copy link

One small detail, but perhaps quite important.

You can't pull code, if the syntax is wrong on github.

During the pull process the code is also saved, and as you know, incorrect code can't be saved in the GAS IDE.
Sadly, the error message doesn't say this is the reason. It only replies with the undefined message.

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

No branches or pull requests

10 participants