-
Notifications
You must be signed in to change notification settings - Fork 433
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
Avoiding Ctrl+c exits to every call #805
Comments
There seem to be multiple issues for the same thing. I am sure there are more but I can't find all of them. Not sure which one we want to be primary so I am posting this in all of them. Any resolution or idea what is wrong? |
Sorry, I hanve't touched this since I posted back in Sept 2020 with no plans to return to this as Apps Script was too buggy for my purposes. |
I hear ya. I love how much you can do with it but it has so many one off issues that prevent it from being a full fledged solution platform. I wish Google invested more time/resources on it. Either way, I just wanted to let the devs of |
Out of curiosity, do the issue also occurs when using forked-clasp is an npm package built from https://github.com/PopGoesTheWza/clasp/tree/forked which includes many changes/fixes and was heavily refactored. |
Do I need to uninstall @google/clasp first? |
@imthenachoman yes. Uninstall google/clasp globally before installing forked-clasp |
It pushes the files and then sits for 30+ seconds.
|
@imthenachoman but it exits normally after the "sitting" time, right? |
Yes -- but that is the same experience with normal clasp. The clasp calls do their thing and then just sit. Been trying to find out why that is and how to fix it. |
Without a windows system to test, it is difficult for me to find why it "hangs" for a while before exiting.Does this happens withg every clasp commands? |
It happens on my MacOS system too. It's happening on both Windows and MacOS for me. |
I am experiencing the same issue on Linux (using nixpkgs stable version: v2.2.1). It seems to affect only to subcommands that actually make calls to the server. |
My guess is that there are some unresolved promises/async functions which keeps the application from returning immediately. During previous refactoring I did focus on such issues, but obviously there is still some loose ends. |
I have not looked through |
We can try adding https://www.npmjs.com/package/why-is-node-still-running or https://www.npmjs.com/package/why-is-node-running on my fork so that I can release a version with information about what is delaying the exit. |
Sounds like a plan! I volunteer to test it out. |
@imthenachoman @nilp0inter you can try https://www.npmjs.com/package/forked-clasp/v/2.8.0 it has the option i.e. |
@PopGoesTheWza Here is the log of running The behavior is the same. The command runs and produces all the output you see in the log in about 2 seconds, then it sits still for about 70 seconds, then it exits. I hope this helps. Please, let me know if you require further tests. |
@nilp0inter Your output is nearly identical to mine... (macos big sur, immediate exit) |
@nilp0inter Can you try forked-clasp 2.8.1? There is now a new option |
I executed I executed again adding |
@PopGoesTheWza Are you saying you don't see the delay on your system? I'm seeing it on every system I have -- covering Windows, WSL, Linux, and MacOS. |
I never experienced any significant, noticeable delay. Maybe up to 2 seconds on some rare occasions. Typically I'm using LTS node (i.e. 14.x atm) from bash/zsh on latest macOS. |
I was able to test |
May this be a configuration issue in our end (or Google's end) instead of a bug? |
Is there a way to make a trimmed down version of clasp push or some command to see if it does the same thing? I don’t know NodeJS or what clasp code does to try to create it. |
It appears to work now |
@nilp0inter like? No more issue? No delayed exit? No need for |
Sorry, I didn't want to sound ungrateful. Thank you very much for your hard work. It is just I didn't think that the issue was closed, I mean, I thought you'll want to perform some more tests, maybe via @imthenachoman. Did I hurt your feelings or something? |
Just teasing. Since this issue has been floating for quite a while, I will not rush to close it until some time to confirm it is fine now. I am barely using clasp now and with TravisCI being broken, testing is minimal. In the last few days, I also bumped a few dependencies but without checking if it didn't break anything. If all goes well I'll drop |
You scared me, @PopGoesTheWza! 🤣🤣🤣 Just to be clear, I am a little bit concern about the fix. As I said, I think the solution is brittle and will break for somebody else in the future. You have all the right to ignore my opinion, but please, consider adding an environment variable to disable the check. Again, thank you very much for all your effort ❤️ ✨✨🍰✨✨ |
Removing all kind of is-online testing would go against the philosophy of original Google designers. Thus I will not rush taking such a route. |
What was decided on the DNS? I don't see why I tested just |
@imthenachoman in a nutshell:
When blocked it can cause some unresolved promises/async operations, which translate into a clasp command taking a long time upon exit. To address this situation, we considered some options:
The last option seems like a reasonable tradeoff, easy to implement. Latest |
Why not just check it against the API endpoint used to update GAS code? Even if it can access google.com but can't access the API endpoints then it is no good. I could see a corporate FW block the API endpoint but not google.com. |
Check how it is currently implemented |
I like this solution. I vote yes for what @PopGoesTheWza has done. |
I just tested this on corporate network and it works now. Brilliant! Thank you! |
@PopGoesTheWza , I've been using the patched version daily and I am getting the I've been unable to identify a pattern so far. Any ideas? |
@nilp0inter Do you think that a build which would display which tested URL is "unreachable" would help? |
Yes, I think so. |
@nilp0inter try |
@PopGoesTheWza, I am getting this results with nil@xan ~ [10:32:32]
> $ clasp list
script.google.com ✖
console.developers.google.com ✖
console.cloud.google.com ✖
drive.google.com ✖
Error: Looks like you are offline.
nil@xan ~ [10:33:04]
> $ clasp login --status
script.google.com ✖
console.developers.google.com ✖
console.cloud.google.com ✖
drive.google.com ✖
You are logged in as an unknown user. Looks like now everything is detected as down? Nevertheless I am able to access all domains from the browser, and the old version of clasp works (with the DNS drop rule disabled, of course) |
@nilp0inter I edited my copy of the code to also display successes and tested: ~/ref/clasp forked
❯ node ./build/src/index.js login --status
script.google.com ✔
console.developers.google.com ✔
console.cloud.google.com ✔
drive.google.com ✔
script.google.com ✔
console.developers.google.com ✔
console.cloud.google.com ✔
drive.google.com ✔
You are logged in as [email protected]. What can possibly cause issues on your side? |
I have an slow Internet connection. I executed it now and get no error: > $ clasp login --status [±master ●●]
You are logged in as [email protected]. |
@nilp0inter We could try with a longer timeout? https://github.com/sindresorhus/is-reachable#options Which value would you suggest? |
I don't know... the command without the Internet check, usually finish in less than 5 seconds. Maybe 5 seconds? |
@nilp0inter try |
@imthenachoman have you also experienced issues like the one @nilp0inter reported? |
I have not. But let me check with others at my company. |
@PopGoesTheWza , sorry I've been very busy at work and I was unable to perform any testing. I am now testing version nil@xan ~/Project/SePScripts [11:45:14]
> $ clasp status [±master ●●]
console.cloud.google.com ✖
Error: Looks like you are offline.
nil@xan ~/Project/SePScripts [11:45:42]
> $ clasp login --status [±master ●●]
script.google.com ✖
console.developers.google.com ✖
console.cloud.google.com ✖
drive.google.com ✖
You are logged in as an unknown user.
nil@xan ~/Project/SePScripts [11:46:00]
> $ clasp status [±master ●●]
script.google.com ✖
console.developers.google.com ✖
console.cloud.google.com ✖
drive.google.com ✖
Error: Looks like you are offline.
nil@xan ~/Project/SePScripts [11:46:19]
> $ clasp -v [±master ●●]
2.11.2
nil@xan ~/Project/SePScripts [11:51:52]
> $ clasp login --status [±master ●●]
script.google.com ✖
You are logged in as an unknown user.
nil@xan ~/Project/SePScripts [11:52:09]
> $ clasp login --status [±master ●●]
You are logged in as [email protected].
As you can see, it is pretty erratic, it seems to work every few tries and when it fails the errors are different. I am not sure this is related to timeouts anymore. In case you are wondering I have no proxies or any other restriction in my Internet access now. Thank you! |
Expected Behavior
Running any call (e.g.
clasp push
) should push to the server, then exit, returning to the normal terminal prompt.Actual Behavior
Running any call (e.g.
clasp push
) pushes correctly to the server, but the terminal remains unresolved, or unclosed properly. It is responsive, but will not return to the normal terminal prompt without forcefully exiting with Ctrl+c.Steps to Reproduce the Problem
clasp push
Specifications
node -v
): 14.9.0clasp -v
): 2.3.0The text was updated successfully, but these errors were encountered: