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

Data does not persist #3

Closed
DandroidDeveloper opened this issue Jun 27, 2016 · 24 comments
Closed

Data does not persist #3

DandroidDeveloper opened this issue Jun 27, 2016 · 24 comments

Comments

@DandroidDeveloper
Copy link

So I ran npm install, react-native start, and got the example working on Ubuntu w/ android studio... and I was wondering if you could help me out with a few things. First, the list selectors on Android do not work, you cannot mark something as completed. Second, when I run npm run server, it seems as if mongodb just idles. Third, data did not persist (maybe because mongoDB gets stuck at "starting a MongoDB deployment to test against...", and when I reopen the app all to do's are wiped).

@callmephilip
Copy link
Member

@callmephilip
Copy link
Member

Also, could you please try the latest master to see if solved the issue based on this

@DandroidDeveloper
Copy link
Author

No luck at parse dashboard : / npm run server causes "Starting a MongoDB deployment to test against..." to indefinitely idle it seems.

@DandroidDeveloper
Copy link
Author

*immutable is also not included, but simple npm install immutable solves it

@callmephilip
Copy link
Member

@DandroidDeveloper : could be related to mongodb-runner's occasional flaky behavior (parse-community/parse-server#272)

@callmephilip
Copy link
Member

callmephilip commented Jun 27, 2016

@DandroidDeveloper : can you try running mongodb-runner in debug mode and share the traces

DEBUG=* node ./node_modules/mongodb-runner/bin/mongodb-runner start

@DandroidDeveloper
Copy link
Author

mongodb-version-manager:activate added /home/daniel/.mongodb/versions/mongodb-current/bin to $PATH and its now /home/daniel/.mongodb/versions/mongodb-current/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/local/android-studio/bin/ +0ms
mongodb-runner:bin running action start +177ms
mongodb-download-url Building URL for options {"version":"stable","arch":"x86_64","platform":"linux","branch":"master","bits":"64","debug":false,"ext":".tgz","distro":"linux_64"} +3ms
mongodb-version-list getting versions list +0ms
mongodb-version-list versions cache /tmp/dl.mongodb.org/dl/src +1ms
mongodb-version-list cache last modified 1467068262444 +1ms
mongodb-version-list using cached versions html +0ms
mongodb-version-list extracting from 1772 links in table +72ms
mongodb-version-list filtering out pre 2.2 versions +44ms
mongodb-version-list 192 versions of mongodb are available +28ms
mongodb-download-url fully resolved +1ms {
"version": "3.2.7",
"arch": "x86_64",
"platform": "linux",
"branch": "master",
"bits": "64",
"debug": false,
"ext": ".tgz",
"distro": "linux_64",
"name": "mongodb",
"artifact": "mongodb-linux-x86_64-3.2.7.tgz",
"url": "http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.2.7.tgz"
}
mongodb-version-manager:resolve resolved +4ms { name: 'mongodb',
platform: 'linux',
version: '3.2.7',
filename: 'mongodb-linux-x86_64-3.2.7.tgz',
url: 'http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.2.7.tgz',
debug: false,
enterprise: false,
distro: 'linux_64',
bits: '64',
directory: '/home/daniel/.mongodb/versions',
download_directory: '/home/daniel/.mongodb/versions/downloads',
download_path: '/home/daniel/.mongodb/versions/downloads/mongodb-linux-x86_64-3.2.7.tgz',
root_directory: '/home/daniel/.mongodb/versions/mongodb-3.2.7-linux-64',
bin_directory: '/home/daniel/.mongodb/versions/mongodb-3.2.7-linux-64/bin' }
mongodb-version-manager:download downloading +11ms { name: 'mongodb',
platform: 'linux',
version: '3.2.7',
filename: 'mongodb-linux-x86_64-3.2.7.tgz',
url: 'http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.2.7.tgz',
debug: false,
enterprise: false,
distro: 'linux_64',
bits: '64',
directory: '/home/daniel/.mongodb/versions',
download_directory: '/home/daniel/.mongodb/versions/downloads',
download_path: '/home/daniel/.mongodb/versions/downloads/mongodb-linux-x86_64-3.2.7.tgz',
root_directory: '/home/daniel/.mongodb/versions/mongodb-3.2.7-linux-64',
bin_directory: '/home/daniel/.mongodb/versions/mongodb-3.2.7-linux-64/bin' }
◜ Starting a MongoDB deployment to test against... mongodb-version-manager:download already have artifact at /home/daniel/.mongodb/versions/downloads/mongodb-linux-x86_64-3.2.7.tgz +2ms
mongodb-version-manager::extract already extracted ~/.mongodb/versions/mongodb-3.2.7-linux-64 +0ms
mongodb-version-manager:activate removing old symlink if it exists... +1ms
mongodb-version-manager:activate symlinking /home/daniel/.mongodb/versions/mongodb-3.2.7-linux-64 -> /home/daniel/.mongodb/versions/mongodb-current... +3ms
mongodb-runner configuring... +1ms
mongodb-runner configured opts +1ms { debug: false,
action: 'start',
version: undefined,
topology: 'standalone',
name: 'standalone',
logpath: '/home/daniel/.mongodb/standalone.log',
pidpath: '/home/daniel/.mongodb/pid',
port: 27017,
mongodBin: 'mongod',
mongosBin: 'mongos',
storageEngine: undefined,
auth_mechanism: 'none',
purge: true }
mongodb-dbpath searching for writeable dbpath in +1ms [ '/home/daniel/.mongodb/data/standalone',
'/mongodb/data/standalone' ]
mongodb-dbpath dbpath is +1ms /home/daniel/.mongodb/data/standalone
mongodb-runner starting! +0ms
mongodb-runner no pid file +1ms
mongodb-runner forking worker /home/daniel/Documents/todomvc-react-native-master/node_modules/mongodb-runner/bin/mongodb-runner-worker.js with args ["--name=standalone","--dbpath=/home/daniel/.mongodb/data/standalone","--logpath=/home/daniel/.mongodb/standalone.log","--port=27017","--topology=standalone","--mongodBin=mongod","--mongosBin=mongos","--purge=true","--auth_mechanism=none"] +2ms
mongodb-runner forked proc with pid +6ms 19669 /home/daniel/Documents/todomvc-react-native-master/node_modules/mongodb-runner/bin/mongodb-runner-worker.js [ '--name=standalone',
'--dbpath=/home/daniel/.mongodb/data/standalone',
'--logpath=/home/daniel/.mongodb/standalone.log',
'--port=27017',
'--topology=standalone',
'--mongodBin=mongod',
'--mongosBin=mongos',
'--purge=true',
'--auth_mechanism=none' ]
mongodb-runner waiting for error or message from forked worker... +0ms
◜ Starting a MongoDB deployment to test against... mongodb-runner:worker worker opts: {"":[],"name":"standalone","dbpath":"/home/daniel/.mongodb/data/standalone","logpath":"/home/daniel/.mongodb/standalone.log","port":27017,"topology":"standalone","mongodBin":"mongod","mongosBin":"mongos","purge":"true","auth_mechanism":"none"} +0ms
mongodb-runner:worker starting +4ms {
"
": [],
"name": "standalone",
"dbpath": "/home/daniel/.mongodb/data/standalone",
"logpath": "/home/daniel/.mongodb/standalone.log",
"port": 27017,
"topology": "standalone",
"mongodBin": "mongod",
"mongosBin": "mongos",
"purge": true,
"auth_mechanism": "none"
}
◞ Starting a MongoDB deployment to test against... mongodb-tools:server_manager setting timeout to ping server... +1s
mongodb-tools:server_manager Starting with cmd mongod --smallfiles --noprealloc --setParameter enableTestCommands=1 --port 27017 --dbpath /home/daniel/.mongodb/data/standalone --logpath /home/daniel/.mongodb/standalone.log --rest --nojournal +12ms
◠ Starting a MongoDB deployment to test against...^C
*same thing. I get here and it just spins on me....

@callmephilip
Copy link
Member

Ok. So it looks like mongo does not start for some reason. Do you have another instance running on the machine? I have also updated mongo command to point to a directory inside the project folder as db-path: https://github.com/thebakeryio/todomvc-react-native/blob/master/package.json#L13

@callmephilip
Copy link
Member

As a temporary workaround, I've added a way to run local server without mongod-runner (https://github.com/thebakeryio/todomvc-react-native/blob/master/package.json#L15) which assumes that you have an instance of mongod running on your machine and you've updated connection string here: https://github.com/thebakeryio/todomvc-react-native/blob/master/settings/development.json#L5

You can then run

npm run server-without-mongo-runner

@DandroidDeveloper
Copy link
Author

gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 3.19.0-61-generic
gyp ERR! command "/usr/bin/nodejs" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/daniel/Documents/todomvc-react-native-master/node_modules/mongodb-runner/node_modules/mongodb-tools/node_modules/kerberos
gyp ERR! node -v v4.4.5
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok

*Errors that seem to be fixed on install

Running npm run server returns ---->

◜ Starting a MongoDB deployment to test against...Error: Cannot find module 'parse/node'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object. (/home/daniel/Documents/todomvc-react-native-master/server/graphql/index.js:3:1)
at Module._compile (module.js:409:26)
at babelWatchLoader (/home/daniel/Documents/todomvc-react-native-master/node_modules/babel-watch/runner.js:47:13)
at Object.require.extensions.(anonymous function) as .js
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)

*Same error with npm run-server-without-mongo-runner

I do not believe I have another instance running, this was the first thing I did today on my computer lol. Let me know if I can help any further!

@DandroidDeveloper
Copy link
Author

ps -aux | grep mongo returns nothing as well (idk if that is how you find running processes with mongo however)

@callmephilip
Copy link
Member

Oh wow, that's new. Just added parse as explicit deps in package.json. Could you try rerunning latest master with prior npm install

@DandroidDeveloper
Copy link
Author

No errors on install now, testing...

@DandroidDeveloper
Copy link
Author

DandroidDeveloper commented Jun 28, 2016

ah I lied, same build errors

gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 3.19.0-64-generic
gyp ERR! command "/usr/bin/nodejs" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/daniel/Documents/todomvc-react-native-master/node_modules/mongodb-runner/node_modules/mongodb-tools/node_modules/kerberos
gyp ERR! node -v v4.4.6
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok

@DandroidDeveloper
Copy link
Author

firewall???

◡ Starting a MongoDB deployment to test against...parse-server-example running on port 8000
warn: Unable to ensure uniqueness for usernames: Error: connect ECONNREFUSED 127.0.0.1:27017
at Object.exports._errnoException (util.js:870:11)
at exports._exceptionWithHostPort (util.js:893:20)
at TCPConnectWrap.afterConnect as oncomplete
warn: Unabled to ensure uniqueness for user email addresses: Error: connect ECONNREFUSED 127.0.0.1:27017
at Object.exports._errnoException (util.js:870:11)
at exports._exceptionWithHostPort (util.js:893:20)
at TCPConnectWrap.afterConnect as oncomplete

@callmephilip
Copy link
Member

which command did you run to get the output above?

@DandroidDeveloper
Copy link
Author

npm run server

@DandroidDeveloper
Copy link
Author

parse dashboard works now!

@callmephilip
Copy link
Member

looks like Mongo is still not running. Did .mongo directory get created in the project root?

@DandroidDeveloper
Copy link
Author

no mongo directory : /

@callmephilip
Copy link
Member

@DandroidDeveloper: could you tell me what version of Linux you are running - I'll try set up a virtual machine to test these things out

@DandroidDeveloper
Copy link
Author

DandroidDeveloper commented Jun 28, 2016

Ubuntu 14.04 LTS

Thanks!

@callmephilip
Copy link
Member

@DandroidDeveloper : i think i got it to run on Linux box. Could you please try the following:

  • update package.json here by removing --dbpath ./.mongo
  • npm run server

@DandroidDeveloper
Copy link
Author

Operational! thanks for your help @callmephilip

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

2 participants