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

Sometimes the mongo object is null and it stops the webserver #14

Closed
lattmann opened this issue Apr 30, 2014 · 6 comments
Closed

Sometimes the mongo object is null and it stops the webserver #14

lattmann opened this issue Apr 30, 2014 · 6 comments
Assignees

Comments

@lattmann
Copy link
Contributor

We have seen this on Mac and Windows. We do not know how to reproduce it. We have seen it when the webserver was running from 'home' and connected to a mongodb, which is located at 'work'.

/Users/zsolt/GitHub/webgme-domain-tools/node_modules/webgme/storage/mongo.js:145
                        mongo.collectionNames(function (err, collections) {
                              ^
TypeError: Cannot call method 'collectionNames' of null
    at Object.getProjectNames (/Users/zsolt/GitHub/webgme-domain-tools/node_modules/webgme/storage/mongo.js:145:10)

@ksmyth
Copy link
Contributor

ksmyth commented Apr 30, 2014

It seems this happens when connecting to mongo fails? If this is true, please report an error that makes sense, e.g. "Cannot connect to mongodb at 127.0.0.1:123"

It would be preferable to get this error at startup (fail-fast). I got it only when trying to browse project.

@kecso
Copy link
Member

kecso commented Apr 30, 2014

I would say that this doesn't happens when we initiate the connection towards mongo but when it is somehow being dropped or we close it intentionally when we shouldn't have to. I will try to check the issue, but as it is not reproducible I cannot guarantee a quick solution.
On the other hand I agree that it seems as it happens only during connection setup, but the errors there are handled (maybe not all of them).
An other cause can be some change in the library which we are not aware of...

@ksmyth
Copy link
Contributor

ksmyth commented Apr 30, 2014

I see that the connection is initialized at startup, though the error message could be improved

C:\Users\kevin\Documents\webgme-domain-tools>grep mongoip config.json
    "mongoip": "asdf.asdf",

C:\Users\kevin\Documents\webgme-domain-tools>node app.js
   info  - socket.io started
worker initialization failed, try again

@ksmyth
Copy link
Contributor

ksmyth commented Apr 30, 2014

re: dropping an existing connection, tcpview.exe from Sysinternals has an option to kill existing connections. WebGME successfully reconnects when you do this. I'll keep an eye out for a reliable repro.

@kecso
Copy link
Member

kecso commented Apr 30, 2014

could someone who encounters the issue please send npm list and configuration context info?
unfortunately I never saw it on my machine...

In the meantime I will create some immediate-respones for the initializing issues

@kecso
Copy link
Member

kecso commented Apr 30, 2014

Some initial logs have been added to console reporting as well (they were existing in the log file, but as they were initiated by an external library and not propagated it was not straightforward how to catch them...) although the execution of the server is not stopped.
The mongodb closing also have a workaround solution.

Closing the issue, but please reopen it if some similar error occures.

@kecso kecso closed this as completed Apr 30, 2014
papszi pushed a commit to papszi/webgme that referenced this issue Jul 8, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants