mobimeo / teamchatviz

#teamchatviz
https://moovel.github.io/teamchatviz
Other
144 stars 24 forks source link

Error with users #55

Closed jaxxstorm closed 8 years ago

jaxxstorm commented 8 years ago
error: relation "users" does not exist
      at [object Object].Connection.parseE (/Users/Lee/github/teamchatviz/node_modules/pg-promise/node_modules/pg/lib/connection.js:539:11)
      at [object Object].Connection.parseMessage (/Users/Lee/github/teamchatviz/node_modules/pg-promise/node_modules/pg/lib/connection.js:366:17)
      at Socket.<anonymous> (/Users/Lee/github/teamchatviz/node_modules/pg-promise/node_modules/pg/lib/connection.js:105:22)
      at emitOne (events.js:90:13)
      at Socket.emit (events.js:182:7)
      at readableAddChunk (_stream_readable.js:147:16)
      at Socket.Readable.push (_stream_readable.js:111:10)
      at TCP.onread (net.js:523:20)
OrKoN commented 8 years ago

@jaxxstorm have you executed db migrations? i.e. npm run up

jaxxstorm commented 8 years ago

Ah, no, let me try that.

jaxxstorm commented 8 years ago

After running npm run up

QueryResultError: 0
      at QueryResultError.Error (native)
      at new QueryResultError (/Users/Lee/github/teamchatviz/node_modules/pg-promise/lib/errors/queryResult.js:125:22)
      at [object Object].<anonymous> (/Users/Lee/github/teamchatviz/node_modules/pg-promise/lib/query.js:172:41)
      at [object Object].Query.handleReadyForQuery (/Users/Lee/github/teamchatviz/node_modules/pg-promise/node_modules/pg/lib/query.js:106:10)
      at [object Object].<anonymous> (/Users/Lee/github/teamchatviz/node_modules/pg-promise/node_modules/pg/lib/client.js:163:19)
      at emitOne (events.js:95:20)
      at [object Object].emit (events.js:182:7)
      at Socket.<anonymous> (/Users/Lee/github/teamchatviz/node_modules/pg-promise/node_modules/pg/lib/connection.js:109:12)
      at emitOne (events.js:90:13)
      at Socket.emit (events.js:182:7)
      at readableAddChunk (_stream_readable.js:147:16)
      at Socket.Readable.push (_stream_readable.js:111:10)
      at TCP.onread (net.js:523:20)
OrKoN commented 8 years ago

@jaxxstorm does the error happen when your run migrations? or after the migrations were successfully executed? What are your steps exactly to get this error?

jaxxstorm commented 8 years ago

This happens after npm start

I'm running postgres in a docker container and then trying to connect to localhost:5432. All the DB perms seem to be setup correctly.

OrKoN commented 8 years ago

Which version of Postgres are your running? And npm run up was without errors? I will try with docker tomorrow. Can you give me the exact command you use to start the Postgresql container?

vitaly-t commented 8 years ago

QueryResultError is only thrown when the returned result doesn't match the method called :wink:

OrKoN commented 8 years ago

@vitaly-t thanks, that is the reason.

@jaxxstorm I have checked out a project anew and it was fine for me. Here is what I do:

1) npm run up 2) npm start 3) open http://localhost:3333/ 4) click Add to Slack button and wait till the data is imported (the data import is not reflected in the UI) 5) explore the charts

I have got the following .env config here:

PORT=3333
SLACK_CLIENT_ID="realId"
SLACK_CLIENT_SECRET="realSecret"
DATABASE_URL="postgres://teamchatviz2:teamchatviz@localhost/teamchatviz2"
PUBLIC="false"
ANONYMIZE="true"
SESSION_SECRET="secret"

But I also think I found what error you have. You probably run it with PUBLIC=true which will turn your installation into a demo instance where you cannot import the data and cannot log in. There if the database is empty you will get an error message because there is no user in it to play the role of the demo user. Generally you should turn on PUBLIC only after your imported your demo data with ANONYMIZE=true. For internal use ANONYMIZE=false and PUBLIC=false should be used.

I will add more explanation to this and handle that error better.