leonhartX / gas-github

sync gas code to github
https://chrome.google.com/webstore/detail/lfjcgcmkmjjlieihflfhjopckgpelofo
MIT License
3.49k stars 70 forks source link

Still getting [github assistant] undefined error when trying to pull #142

Open oscarmanriqueb opened 3 years ago

oscarmanriqueb commented 3 years ago

I have already set up login successfully to github and I even see the changes identified by the PULL, but when I click on the button to bring the changes down, I'm still getting this error. Already made sure that the GAS API is properly enabled. I removed and added the extension twice already, so I'm sure I'm using the latest version (5.0.0.2).

Already tried installing and uninstalling many times and also generated a new key on github; I'm able to see the repositories and the code changes, though, but the error happens whenever the pull is done.

Adia-US commented 3 years ago

Same issue here. From everything I see from the other related issues this seems to only be affecting GSuite Users, but I'm not entirely sure. Either way this is a huge blocker for many of us. @leonhartX If there is anything we can do to provide more information or attempt to support you in getting this resolved, it will be greatly appreciated. I love this Extension but haven't been able to use it in months.

This is the error I receive from the console:

{
  "error": {
    "code": 401,
    "message": "Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.",
    "status": "UNAUTHENTICATED"
  }
}
ainthateasy commented 3 years ago

I am getting the same error. I've been using this extension happily for months (a couple small issues here and there) now it's suddenly stopped talking to Github.

It can see my repos but refuses to push/pull.

Same error:

{ "error": { "code": 401, "message": "Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.", "status": "UNAUTHENTICATED" } }

I've tried uninstall/reinstall, new access token and removing the app's google auth. Nothing working so far....

oscarmanriqueb commented 3 years ago

It seems the developer has not been able to take a look at the issues for the new version. Hopefully he'll retake on this. I really like the extension as it is really useful.

leonhartX commented 3 years ago

sorry guys, I can't manage to get some time to look at this now due to my work and family, wish I could get back in later August.

Adia-US commented 3 years ago

@leonhartX No problem friend, we appreciate all of your effort and really love this extension that you've built. It's so very helpful for all of us and we appreciate your hard work. Please let us know if there is any way to go open source with this so that we can assist in troubleshooting and perhaps take some work off of your plate. Thanks again!

andrewroberts commented 3 years ago

The source code is all there ... have at it!

On Wed, 28 Jul 2021 at 05:14, AdiaProductTeam @.***> wrote:

@leonhartX https://github.com/leonhartX No problem friend, we appreciate all of your effort and really love this extension that you've built. It's so very helpful for all of us and we appreciate your hard work. Please let us know if there is any way to go open source with this so that we can assist in troubleshooting and perhaps take some work off of your plate. Thanks again!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/leonhartX/gas-github/issues/142#issuecomment-887995211, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABD4XXMUEUHCPU6RNFQ6I2TTZ57ZJANCNFSM4Y6RKDHQ .

andrewroberts commented 3 years ago

I tried all the suggested solutions: could push, but not pull. I ended up just going back to the old IDE and installing v4.0.7.

Hell-K commented 3 years ago

Hello, so actually I'm using this at work (with GitLab and the new GAS IDE after my fixes in the pull request) and we're within a custom GSuite environment. It's true that out of the box you'll get these errors but there's nothing that leonhartX can do about it since it's probably blocked by your organization. The way to fix this would be to set up your own OAuth2 with your own KEY and CLIENT ID from within your organization's GCP. Or at least, that's how it worked for me.

Adia-US commented 3 years ago

Hi @Hell-K glad to hear this is working for you currently. Would you be willing to share a bit of instruction on the fix you mentioned? Maybe just some screenshots and directions to make it easier for us who aren't as familiar with that process off hand? It would be greatly appreciated.

ghost commented 2 years ago

I tried all the suggested solutions: could push, but not pull. I ended up just going back to the old IDE and installing v4.0.7.

HI Andrew. Can you provide some guidance on how to install that old version? (I have no clue how to do something like that). Thanks in advance!

andrewroberts commented 2 years ago

To install the old v4.0.7 to use on the old Apps Script editor.

The extra Gas-GitHub buttons should now appear in your editor.

Enjoy!

On Tue, 16 Nov 2021 at 21:30, KoosKaas @.***> wrote:

I tried all the suggested solutions: could push, but not pull. I ended up just going back to the old IDE and installing v4.0.7. https://drive.google.com/file/d/1o2D4DM_sBGVDaHLBDZF6LPepqifcfuUQ/view?usp=sharing

HI Andrew. Can you provide some guidance on how to install that old version? (I have no clue how to do something like that). Thanks in advance!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/leonhartX/gas-github/issues/142#issuecomment-970695871, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABD4XXKWLUQR55KYUUANVP3UMLEP3ANCNFSM4Y6RKDHQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

ghost commented 2 years ago

Finally found the (or at least: "my") issue: my code that I wrote in local editor contained a bug that can't be saved by gas. So just check your code!!! (Or: develop in GAS and commit from GAS)

andrewroberts commented 2 years ago

Although my token was set to never expire, creating a new one got it working in the new UI.

brownm09 commented 2 years ago

I received this error, too. However, I did not have Google Apps Script API enabled; once I fixed that here, I was able to pull without a problem. This is on Version 5.0.5.

Creating a new token (alone) did not fix my problem. (It is possible that the combination of fixing the token and enabling the API fixed the problem, but I tried the token first, so I will never know.)

djpecot commented 2 years ago

@brownm09 I also had to enable the Google Apps Script API AND create a new token. But I was also logged into a different user for the extension and the actual App Script, so not sure which one actually fixed it. Oops 😱

Adia-US commented 2 years ago

I have recreated my token, ensured that the GAS API was enabled, but yet I'm still experiencing the same issue. Not sure what's going on.

andreChmielewski commented 2 years ago

I received this error, too. However, I did not have Google Apps Script API enabled; once I fixed that here, I was able to pull without a problem. This is on Version 5.0.5.

Creating a new token (alone) did not fix my problem. (It is possible that the combination of fixing the token and enabling the API fixed the problem, but I tried the token first, so I will never know.)

This worked for me. I engaged Google Apps Script API and I could pull!

SupportPlan commented 2 years ago

Wasn't working for me.

I disabled Google Apps Script API, deleted the Token, enabled Google Apps Script API, created a new Token and then added it.

Now it works.

Adia-US commented 2 years ago

Still not working for me

andreChmielewski commented 2 years ago

Still not working for me

Are you getting the undefined error or is something else wrong?

Adia-US commented 2 years ago

@andreChmielewski So basically what happens is that when I open the Apps Script editor, it still does that thing where it opens a new tab to sign into Google, and even though the Github Assistant tool tabs appear e.g. - "Repository", push/pull - nothing happens when I click on any of those.

I went through the entire process of disabling/enabling Apps Script API both in my personal Apps Script User Settings and for the project itself in GCP, deleted/recreated a GitHub PAT, reinstalled the extension, etc etc and it's still not working for me. Not sure if I'm doing something wrong or if I should revert to a previous version of the extension.

andreChmielewski commented 2 years ago

@Adia-US I think I had this problem once - I had installed everything but it didn't load any of my repositories. So I read somewhere that switching into the classic editor and then back into the new one would fix it. And it did!

Try switching to the classic editor and then back the new editor. Maybe refresh the browser then too.

Adia-US commented 2 years ago

@andreChmielewski Ugh, thank you for the recommendation but unfortunately that still didn't work for me. I've attempted all of the recommendations/work-arounds in this thread so far to no avail, so I'm wondering if there is something specific blocking me on the Google Workspace/GCP Administration side.

NoSubstitute commented 2 years ago

This happened to me again today. Made sure that the API was enabled. Flipped it Off and On again. Still didn't work. Reloaded the Chrome window a few times. Still didn't work. right clicked the extension and opened the options of GasHub to verify I was still logged in. Yes I was.

Tried pull again. Well, hello there! Now it works!

Didn't have to fix new token.

solroi commented 2 years ago

@Adia-US I think I had this problem once - I had installed everything but it didn't load any of my repositories. So I read somewhere that switching into the classic editor and then back into the new one would fix it. And it did!

Try switching to the classic editor and then back the new editor. Maybe refresh the browser then too.

@andreChmielewski There is no option to switch to classic editor anymore. The legacy Apps Script IDE was deprecated in Q4 2022.

https://issuetracker.google.com/issues/254509556

andrewroberts commented 2 years ago

I've done all the usual changes but it works on some repos but not others. I've resorted to using clasp for those ones.

On Thu, 3 Nov 2022 at 17:29, solroi @.***> wrote:

@Adia-US https://github.com/Adia-US I think I had this problem once - I had installed everything but it didn't load any of my repositories. So I read somewhere that switching into the classic editor and then back into the new one would fix it. And it did!

Try switching to the classic editor and then back the new editor. Maybe refresh the browser then too.

There is no option to switch to classic editor anymore. The legacy Apps Script IDE was deprecated in Q4 2022.

https://issuetracker.google.com/issues/254509556

— Reply to this email directly, view it on GitHub https://github.com/leonhartX/gas-github/issues/142#issuecomment-1302445284, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABD4XXOBIJHWPDX4FZYKIO3WGPY7NANCNFSM4Y6RKDHQ . You are receiving this because you commented.Message ID: @.***>

NoSubstitute commented 1 year ago

As I commented in another thread, I also today learned that this undefined error occurs on Pull when the code in github is incompatible, and thereby can't be saved in the GAS IDE. Since the code can't be saved, it gives some error back to the extension, and it only responds with the undefined message.

Took me a while to find the : where there should be a ;

Kycko commented 1 year ago

Finally found the (or at least: "my") issue: my code that I wrote in local editor contained a bug that can't be saved by gas. So just check your code!!! (Or: develop in GAS and commit from GAS)

Yup, I've checked my new code and noticed for (smth, smth, smth) {} with commas (,), no dot-commas (;). Just replaced commas and pulled my new code successfully.

MAD0MARKETING commented 1 month ago

I received this error, too. However, I did not have Google Apps Script API enabled; once I fixed that here, I was able to pull without a problem. This is on Version 5.0.5.

Creating a new token (alone) did not fix my problem. (It is possible that the combination of fixing the token and enabling the API fixed the problem, but I tried the token first, so I will never know.)

you saved me man