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

Repeated errors in the absence of an internet connection #115

Closed
sardonicpresence opened this issue Jul 23, 2016 · 6 comments
Closed

Repeated errors in the absence of an internet connection #115

sardonicpresence opened this issue Jul 23, 2016 · 6 comments

Comments

@sardonicpresence
Copy link

When travelling with my laptop, when without an internet connection I am consistently plagued with the following error while I work on Purescript in atom:

Error: getaddrinfo ENOENT undefined:15118 at Object.exports._errnoException (util.js:856:11) at errnoException (dns.js:31:15) at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:77:26)

@nwolverson
Copy link
Owner

What makes you think this is to do with ide-purescript?

The only network connection this package makes is to localhost, it's possible that that is behaving badly on your system, it's also possible (as far as the stack trace you show) that something else in Atom is causing the issue - there are plenty of things that do make internet connections.

@sardonicpresence
Copy link
Author

A fair and obvious question, I should have justified better up-front.

Here's what I've discovered:

  • Under conditions in which the error occurs, I can reliably reproduce it by activating auto-completion (e.g. using ctrl-space) while editing a purescript source file (but not a javascript file for example)
  • I have not reproduced the error with the ide-purescript package disabled
  • If there is no internet connection when I start atom I get no errors (a useful work-around at least)
  • In fact, if there is internet when I start atom but I have not yet opened a purescript source file, I then lose internet and then auto-complete in a purescript file, there is no error i.e.
  • If there is internet when I first open a purescript file and I then lose internet, auto-completion generates the error
  • While I lack internet connection (in the presence or absence of errors) I get no auto-completion suggestions in purescript (if the package is disabled I get what I assume are the built-in provider's auto-completion suggestions)
  • When starting atom with no internet (with a purescript file open) I get the notification that psc-ide-server has been started, then once I connect internet I have to switch tabs to another purescript file, at which point I get a notification that it has connected to an existing psc-ide-server instance, then after a few seconds I get auto-completion suggestions again.

@nwolverson
Copy link
Owner

Thanks. What OS are you running? I feel like there's some issue around dns lookup for localhost, that may be slightly system specific.

I've tried and can't reproduce this on my machine :(

Can you try this with https://github.com/kRITZCREEK/pscid ? I imagine this is the same but may eliminate some possibilities. If this behaves the same, can you also try with pscid and manually started psc-ide-server --debug

@sardonicpresence
Copy link
Author

I'm running Windows 10.

I'm not sure what you mean by "try this" with pscid & I've never used the tool before. If I just run pscid it fails to start psc-ide-server. If I run psc-ide-server manually then pscid it starts fine and I can build without internet, but then that is also true with ide-purescript; as far as I'm aware it is just auto-completion that errors.

I've not done any atom plugin development, but as I can readily reproduce it I'd be happy to give some debugging a stab given some pointers if you'd like.

@nwolverson
Copy link
Owner

The reason I ask is auto-completion makes a connection to psc-ide, just as rebuild does (if you have 'fast rebuild' set, which is now default) (and pscid - BTW I mean to try the file watcher, not the b to build). Can you try the 'ide-purescript:search' command (^O /) when autocomplete is erroring and see if it is the same or different?

If only autocomplete is an issue but not search, tooltips, fast build - then it is unlikely to be to do with this package, and instead something to do with autocomplete+ or some other provider.

As for debugging if you open up the developer tools in Atom and manage to break on the exception in question, you may be able to find something interesting.

@sardonicpresence
Copy link
Author

Ah right. Yes pscid crashes with the same exception on file save and ide-purescript also errors on save with fast-build enabled. Although ide-purescript:search & tooltips don't function in the absence of internet they also do not produce an error pop-up.

It looks to me like this is probably nodejs/node#2237 where sadly the conclusion appears to have been:

I hate windows. why doesn't it just work like unix?

However, it looks like the solution is to install a loopback interface as described here for example. Having done so I seem to have full functionality without error =)

Thanks for your help!

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

No branches or pull requests

2 participants