F8app: npm run import-data is error

Created on 15 Mar 2017  路  10Comments  路  Source: fbsamples/f8app

Macbook:f8app lxl$ npm run import-data

[email protected] import-data /Users/lxl/Documents/reactnative/f8app
babel-node ./scripts/import-data-from-parse.js

Loading Speakers
SyntaxError: Unexpected token P in JSON at position 0
at JSON.parse ()
at /Users/lxl/Documents/reactnative/f8app/node_modules/node-fetch/lib/body.js:43:15
at process._tickDomainCallback (internal/process/next_tick.js:129:7)

Most helpful comment

  1. install mongodb

  2. download https://github.com/ReactWindows/f8app/blob/data/mongodb/db.zip

  3. Just unzip it.

  4. open terminal and give command

mongod --dbpath unzip-folder-path

All 10 comments

see #149

  1. install mongodb

  2. download https://github.com/ReactWindows/f8app/blob/data/mongodb/db.zip

  3. Just unzip it.

  4. open terminal and give command

mongod --dbpath unzip-folder-path

@hari-mohan-choudhary So I downloaded the zip, and unzip it in f8app/ folder. Run mongod --dbpath /db and then npm run import-data.

Still got that error? Any suggestion? Thanks.

@haohcraft you have already import-data. not require command

npm run inport-data

please start your npm

npm start

then start your development

i pulled the db.zip file down extracted it into a folder called db and put it into docker image.

Dockerfile:

FROM mongo

ADD db /f8db

CMD mongod --dbpath /f8db

I get this error on start:

2017-04-04T13:49:03.716+0000 I -        [initandlisten] Detected data files in /f8db created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
2017-04-04T13:49:03.716+0000 I STORAGE  [initandlisten] wiredtiger_open config: create,cache_size=1463M,session_max=20000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),checkpoint=(wait=60,log_size=2GB),statistics_log=(wait=0),
2017-04-04T13:49:03.720+0000 E STORAGE  [initandlisten] WiredTiger error (0) [1491313743:720159][6:0x7fe33f492cc0], file:WiredTiger.wt, connection: read checksum error for 4096B block at offset 36864: block header checksum of 31477178 doesn't match expected checksum of 3763190414
2017-04-04T13:49:03.720+0000 E STORAGE  [initandlisten] WiredTiger error (0) [1491313743:720207][6:0x7fe33f492cc0], file:WiredTiger.wt, connection: WiredTiger.wt: encountered an illegal file format or internal value
2017-04-04T13:49:03.720+0000 E STORAGE  [initandlisten] WiredTiger error (-31804) [1491313743:720260][6:0x7fe33f492cc0], file:WiredTiger.wt, connection: the process must exit and restart: WT_PANIC: WiredTiger library panic
2017-04-04T13:49:03.720+0000 I -        [initandlisten] Fatal Assertion 28558 at src/mongo/db/storage/wiredtiger/wiredtiger_util.cpp 361
2017-04-04T13:49:03.720+0000 I -        [initandlisten]

***aborting after fassert() failure

@hari-mohan-choudhary have you successfully gotten mongod to launch with that data?
if you have what version/platform of mongo was that db.zip pulled from?

I wonder if that's the issue.

Is there a way that someone who has successfully connected to the data to use mongoexport to export data to json, zip that up and then we can use mongoimport to pull the data in in a portable way?

I was able to get mongodb 3.2.5 running on a windows machine and have it load the file in the linked issue. I ran:
mongoexport -d dev --archive ... to generate the linked file:

http://personal.drop.s3.amazonaws.com/f8app.archive

and
mongorestore --archive=f8app.archive --drop
to import the file into a new mongo instance.

Here is the dockerfile i used to create an image of mongo with the data pre-loaded:

FROM mongo:3.2

ADD f8app.archive /f8db/f8app.archive

RUN mongod --fork --logpath /dev/null --pidfilepath /mongod.pid && \  
  mongorestore -vvvv --archive=/f8db/f8app.archive --drop && \
  kill -INT `cat /mongod.pid`  

and here is a link to the docker image for a mongodb with the f8 data loaded:

https://hub.docker.com/r/jonnolen/f8app/

you can get it running locally with:

docker run --name f8app-mongo -p 27017:27017 -d jonnolen/f8app

i'm on mac os x using the dinghy docker machine so my database environment command looks like this while running with docker:

export DATABASE_URI=mongodb://$(dinghy ip):27017/dev

The only thing that is missing is the map files... they were hosted on files.parsetfss.com and that got mothballed on 2017-01-01. Anyone have copies?

after unzip the db.zip file, and all the other steps mentioned above, I successful run my app.
but I can't login with my Facebook account.
alert:
Invalid key hash. The key hash mYosll.... not match any stored key hashes. Configure your app key hashes at https://developers.facebook.com/apps/6190....

anyone help ?

I have downloaded that zip and I get a slightly different WiredTiger related error:

2017-04-24T16:39:38.492+1000 I -        [initandlisten] Detected data files in /data/db created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
2017-04-24T16:39:38.492+1000 I STORAGE  [initandlisten] wiredtiger_open config: create,cache_size=7680M,session_max=20000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),checkpoint=(wait=60,log_size=2GB),statistics_log=(wait=0),
2017-04-24T16:39:39.009+1000 E STORAGE  [initandlisten] WiredTiger error (-31803) [1493015979:9448][22766:0x7fffd27953c0], txn-recover: Recovery failed: WT_NOTFOUND: item not found
2017-04-24T16:39:39.046+1000 I -        [initandlisten] Assertion: 28595:-31803: WT_NOTFOUND: item not found src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp 267
2017-04-24T16:39:39.046+1000 I STORAGE  [initandlisten] exception in initAndListen: 28595 -31803: WT_NOTFOUND: item not found, terminating
Was this page helpful?
0 / 5 - 0 ratings