slush-marklogic-node icon indicating copy to clipboard operation
slush-marklogic-node copied to clipboard

Slow internet or other mishap might break install. Can we improve logging?

Open grtjn opened this issue 9 years ago • 18 comments

Not entirely sure, but have the impression that slow connection, or other mishap during slush generation is not always detected properly, and not always reported back to the end user. Particularly the npm install seems to show issues on occasion. Heard from several people that needed to rerun npm install to make the generated project work for instance.

Can we improve error handling and logging?

grtjn avatar Sep 18 '15 12:09 grtjn

I think drawing the line of how to fix this is going to be hard.

  • Could fail it on warning
  • Could try to verify afterwards but who knows what files may/may not be missing
  • Add to readme?

I can see situations where a bug is included in a new minor version and the app is broken without everyone's knowledge. Think possibly should look into a public or semi public CI server that tries a fresh install every so often just to verify nothing breaks due to dependency changes.

hunterwilliams avatar Sep 21 '15 04:09 hunterwilliams

Interesting points, but perhaps not entirely what I meant. I was talking about error handling and logging to end user in case one of the automated steps during slush generation fails. For instance during npm install, or bower install, or maybe even somewhere else. Will the generator stop, and report some message, or will it continue as if nothing happened, making it appear to the end user nothing essential went wrong?

My impression is that the generator continues as if nothing went wrong. A simple message stating to rerun the slush generator, or rerun a few manual commands could be nice. Nothing more fancy than that for the moment. And more robust error handling of course, if needed..

grtjn avatar Sep 21 '15 08:09 grtjn

Should it just error out and stop the install and basically say how to reinstall? Killing my wifi connection during install gave this. FYI it kept spinning. It may time out at some point.. error

hunterwilliams avatar Sep 21 '15 08:09 hunterwilliams

It looks like we can flat out stop the install process if npm/bower install fails at any step. Basically an on error (can verify it's not a warning I believe) and call process.exit.

Otherwise can just list that it failed at the end. (Sorta pointless as who knows what caused that)

hunterwilliams avatar Sep 21 '15 09:09 hunterwilliams

I was thinking of stopping the generator all together, and print a message that suggests to rerun (possibly at a later time if it looked like internet was having trouble).

If you do wait, does slush continue or stop?

grtjn avatar Sep 21 '15 09:09 grtjn

I waited 2 minutes. It could possibly continue I can try later. I'm assuming telling just to remove bower/npm installs and rerun their commands?

hunterwilliams avatar Sep 21 '15 09:09 hunterwilliams

It looks like it finally errors out then just pauses.

capture

note: "f" was the name of the project since I wasn't feeling creative

hunterwilliams avatar Sep 22 '15 03:09 hunterwilliams

I think we need to step back a moment, and see what kind of things could go wrong. Perhaps consider taking npm install and bower install out of the generator. Pushing away for next release..

grtjn avatar Sep 24 '15 19:09 grtjn

Just had an issue with imagmin getting an ENOENT error which after a quick google seems to stem from an issue during npm install. Unfortunately no good way to detect that one... Maybe add it to the wiki as a symptom.

hunterwilliams avatar Sep 28 '15 14:09 hunterwilliams

I think we need to:

a. vote whether to keep npm/bower install as part of generator at all. b. add a catch for any npm/bower failure in the generator if intend keeping it in.

grtjn avatar Feb 18 '16 14:02 grtjn

We could help users by just telling them to run npm install or bower install in an error/log message if either fail for any reason.

joemfb avatar Feb 18 '16 16:02 joemfb

yes, nice extension of option b..

grtjn avatar Feb 18 '16 20:02 grtjn

That's also the standard when running some other generators I've seen.

hunterwilliams avatar Feb 21 '16 03:02 hunterwilliams

If keeping the npm/bower install as part of the generator, we do need to make sure that if npm install failed, it won't continue with bower install after that, because any npm failure message gets pushed away in a lot of bower install console messages, and people might not notice npm install failed..

grtjn avatar Mar 08 '16 15:03 grtjn

Let's attempt to fix the generator to notice the failure, and provide messages appropriately and such. If that ends up being difficult, we can always decide to cut out these steps, and make them manual steps after all.

Anyone up for this?

grtjn avatar Mar 08 '16 15:03 grtjn

Not sure if it is because better fault tolerance in node 5.1.0, but I am unable to get this to break with turning on and off my internet connection during install. Though I wait for minutes, it waits for me to connect again.

ryanjdew avatar Mar 08 '16 23:03 ryanjdew

Hmm, maybe I should try as well then, I am still running 0.10, which is used on servers a lot as well..

grtjn avatar Mar 09 '16 11:03 grtjn

More complicated to test as thought, pushing this away till after UI templates..

grtjn avatar Mar 10 '16 16:03 grtjn