gas-github icon indicating copy to clipboard operation
gas-github copied to clipboard

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

Open cookjeremiahironpadel opened this issue 4 years ago • 20 comments

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 avatar Jan 04 '21 18:01 cookjeremiahironpadel

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

cookjeremiahironpadel avatar Jan 04 '21 18:01 cookjeremiahironpadel

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

leonhartX avatar Jan 05 '21 00:01 leonhartX

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 avatar Jan 05 '21 01:01 oshag-mcesc

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

oshag-mcesc avatar Jan 05 '21 02:01 oshag-mcesc

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 avatar Jan 05 '21 08:01 cookjeremiahironpadel

{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 avatar Jan 05 '21 08:01 cookjeremiahironpadel

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

cookjeremiahironpadel avatar Jan 05 '21 08:01 cookjeremiahironpadel

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.

cookjeremiahironpadel avatar Jan 05 '21 08:01 cookjeremiahironpadel

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.

michaelos02 avatar Jan 06 '21 02:01 michaelos02

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

dcarnese avatar Jan 13 '21 09:01 dcarnese

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 avatar Jan 20 '21 23:01 andrewmoise-oydne

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

andrewmoise-oydne avatar Jan 24 '21 19:01 andrewmoise-oydne

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

leonhartX avatar Jan 25 '21 02:01 leonhartX

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

Berredad avatar Jan 26 '21 07:01 Berredad

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._

nattila1 avatar Mar 01 '21 13:03 nattila1

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 avatar Mar 01 '21 14:03 andrewmoise-oydne

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 avatar Oct 06 '21 17:10 andrewmoise-oydne

(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.)

andrewmoise-oydne avatar Oct 06 '21 17:10 andrewmoise-oydne

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!

m1ck5k1 avatar Feb 08 '22 17:02 m1ck5k1

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.

NoSubstitute avatar Feb 22 '23 14:02 NoSubstitute