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

startup problem with TypeError: Cannot read property 'contexts' of undefined #2024

Closed
whisere opened this issue Oct 17, 2018 · 4 comments
Closed

Comments

@whisere
Copy link

whisere commented Oct 17, 2018

Hello, I run into the following error with 'yarn run-production'

uncaught exception or unhandled rejection, Node process finished !!
TypeError: Cannot read property 'contexts' of undefined
at model.get.then.languages (/home/greekmyth_user/uwazi/uwazi/app/api/i18n/translations.js:125:39)
at
at process._tickCallback (internal/process/next_tick.js:188:7)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

In 'yarn install'
it reported the following, not sure if it is related:

yarn install
yarn install v1.10.1
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@1.2.4: The platform "linux" is incompatible with this module.
info "fsevents@1.2.4" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents@1.1.3: The platform "linux" is incompatible with this module.
info "fsevents@1.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning " > react-datepicker@0.46.0" has incorrect peer dependency "react@^0.14.0 || ^15.0.0".
warning " > react-datepicker@0.46.0" has incorrect peer dependency "react-dom@^0.14.0 || ^15.0.0".
warning " > react-dnd@2.5.1" has incorrect peer dependency "react@^0.14.0 || ^15.0.0-0".
warning " > react-flags@0.1.12" has incorrect peer dependency "react@0.13 - 15.x".
warning "react-redux-form > shallow-compare@1.2.1" has incorrect peer dependency "react@15.x".
warning " > react-router@3.0.5" has incorrect peer dependency "react@^0.14.0 || ^15.0.0".
warning " > react-widgets@4.0.0-rc.16" has incorrect peer dependency "react@^0.14.0 || ^15.0.0".
warning " > react-widgets@4.0.0-rc.16" has incorrect peer dependency "react-dom@^0.14.0 || ^15.0.0".
[4/4] Building fresh packages...
success Saved lockfile.
$ node -e "process.env.NODE_ENV != 'production' && process.exit(1)" || npm run download-mongo-prebuilt

Uwazi@1.1.1 download-mongo-prebuilt /home/greekmyth_user/uwazi/uwazi
node ./database/download_mongo_prebuilt.js

Unknown linux distro Red Hat Linux, falling back to legacy MongoDB build
Downloading: https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.4.4.tgz
Downloading: https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.4.4.tgz.md5
Done in 47.41s.

I also changed the DATABASE_NAME and INDEX_NAME from the default value in Environment variables

But when I run 'yarn blank-state'

It doesn't seem to be connecting and creating the specific database name?
printenv shows the correct DATABASE_NAME etc

Deleting uwazi_development database
MongoDB shell version v3.4.17
connecting to: mongodb://127.0.0.1:27017/uwazi_development
MongoDB server version: 3.4.17
{ "dropped" : "uwazi_development", "ok" : 1 }

Any idea much appreciated!

@whisere
Copy link
Author

whisere commented Oct 17, 2018

I have tried to change the DATABASE_NAME to default uwazi_development
It starts successfully this time.
It seems this env setting: export DATABASE_NAME=otherdatabasename
doesn't work ? Is there other extra step we need to do to change the database name? Thanks!

@txau
Copy link
Collaborator

txau commented Oct 17, 2018

@whisere just in case, I assume you ran "yarn production-build" first? Is it building properly?

BTW, I just updated the Master branch to version 1.3.2, so probably you want to run:

$ cd uwazi
$ git pull
$ yarn install
$ yarn migrate
$ yarn production-build
$ yarn run-production

Please let me know if you run into any issues updating and building.

Regarding the ENV vars, that is what we are using in our production servers. I think the problem is more related to setting up the blank state since yarn is not passing the cli params. So try this:

$ cd uwazi/database/
$ ./blank_state.sh db_name
$ yarn reindex
$ export DATABASE_NAME=db_name
$ yarn run-production

@whisere
Copy link
Author

whisere commented Oct 17, 2018

@txau Many thanks for the above! Yes I did run "yarn production-build" and didn't see any errors.
I have run the lines above.
git pull said everything is up to date,
./blank_state.sh db_name has created the database
and "yarn run-production" start up without problem now. Thanks again!

@txau
Copy link
Collaborator

txau commented Oct 18, 2018

@whisere awesome!

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