wejs / we-plugin-event

We.js plugin with event features
15 stars 3 forks source link

Bluebird error when trying to build #30

Closed SheaBelsky closed 8 years ago

SheaBelsky commented 8 years ago

I'm trying to build a wejs:events application. I'm running Windows 10, and I have the most recent version of MySQL server installed. I create a database with MySQL, use it, and connect to it. My other installation steps follow below:

  1. Run yo wejs:events test in an empty folder
  2. Go into the newly created folder
  3. Run npm install
  4. Configure my MySQL information in config/local.js
  5. Whenever I actually try to launch the application, I get the following error;
Unhandled rejection SequelizeValidationError: Validation error: auth.register.error.username.registered,
Validation error: auth.register.email.exists
    at C:\Users\sheab\Documents\scioly\Ezra\we-project-events-test2\node_modules\sequelize\lib\instance-validator.js:74:14
    at tryCatcher (C:\Users\sheab\Documents\scioly\Ezra\we-project-events-test2\node_modules\bluebird\js\release\util.js:16:23)
    at Promise._settlePromiseFromHandler (C:\Users\sheab\Documents\scioly\Ezra\we-project-events-test2\node_modules\bluebird\js\release\promise.js:503:31)
    at Promise._settlePromise (C:\Users\sheab\Documents\scioly\Ezra\we-project-events-test2\node_modules\bluebird\js\release\promise.js:560:18)
    at Promise._settlePromise0 (C:\Users\sheab\Documents\scioly\Ezra\we-project-events-test2\node_modules\bluebird\js\release\promise.js:605:10)
    at Promise._settlePromises (C:\Users\sheab\Documents\scioly\Ezra\we-project-events-test2\node_modules\bluebird\js\release\promise.js:684:18)
    at Promise._fulfill (C:\Users\sheab\Documents\scioly\Ezra\we-project-events-test2\node_modules\bluebird\js\release\promise.js:629:18)
    at PromiseArray._resolve (C:\Users\sheab\Documents\scioly\Ezra\we-project-events-test2\node_modules\bluebird\js\release\promise_array.js:125:19)
    at PromiseArray._promiseFulfilled (C:\Users\sheab\Documents\scioly\Ezra\we-project-events-test2\node_modules\bluebird\js\release\promise_array.js:143:14)
    at Promise._settlePromise (C:\Users\sheab\Documents\scioly\Ezra\we-project-events-test2\node_modules\bluebird\js\release\promise.js:565:26)
    at Promise._settlePromise0 (C:\Users\sheab\Documents\scioly\Ezra\we-project-events-test2\node_modules\bluebird\js\release\promise.js:605:10)
    at Promise._settlePromises (C:\Users\sheab\Documents\scioly\Ezra\we-project-events-test2\node_modules\bluebird\js\release\promise.js:684:18)
    at Promise._fulfill (C:\Users\sheab\Documents\scioly\Ezra\we-project-events-test2\node_modules\bluebird\js\release\promise.js:629:18)
    at Promise._resolveCallback (C:\Users\sheab\Documents\scioly\Ezra\we-project-events-test2\node_modules\bluebird\js\release\promise.js:424:57)
    at Promise._settlePromiseFromHandler (C:\Users\sheab\Documents\scioly\Ezra\we-project-events-test2\node_modules\bluebird\js\release\promise.js:515:17)
    at Promise._settlePromise (C:\Users\sheab\Documents\scioly\Ezra\we-project-events-test2\node_modules\bluebird\js\release\promise.js:560:18)

It seems to involve the bluebird plugin, but I have no idea how to fix it, or if it's even something I did.

Why might I be running into this error? How can I remedy this?

Thank you!

albertosouza commented 8 years ago

I will see ... but it looks like he's trying to recreate the user more than 1 time then it returns this error auth.register.email.exists

SheaBelsky commented 8 years ago

I noticed that; prior to that error, it successfully creates an entry in the database for the default user. This is the result for "SELECT * FROM users"

+----+---------------+---------------+----------+---------------------------------+--------+--------------------------+--------+----------+-------------+-------+---------+---------------+------+---------------------+---------------------+
| id | username      | displayName   | fullName | biography                       | gender | email                    | active | language | acceptTerms | roles | country | locationState | city | createdAt           | updatedAt           |
+----+---------------+---------------+----------+---------------------------------+--------+--------------------------+--------+----------+-------------+-------+---------+---------------+------+---------------------+---------------------+
|  1 | administrator | Administrator | NULL     | The administrator user account! | NULL   | contato@albertosouza.net |      1 | en-us    |           1 | NULL  | BR      | NULL          | NULL | 2016-04-12 14:06:56 | 2016-04-12 14:06:56 |
+----+---------------+---------------+----------+---------------------------------+--------+--------------------------+--------+----------+-------------+-------+---------+---------------+------+---------------------+---------------------+
1 row in set (0.00 sec)
albertosouza commented 8 years ago

The install have one error after this error:

2016-04-12T14:27:50.631Z - info: New User with id:  1
Unhandled rejection TypeError: Cannot read property 'find' of undefined
    at /home/a/projetos/testes/we-project-events-test/install.js:33:30
    at null.<anonymous> (/home/a/projetos/testes/we-project-events-test/node_modules/we-core/server/models/user.js:255:24)
    at tryCatcher (/home/a/projetos/testes/we-project-events-test/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/home/a/projetos/testes/we-project-events-test/node_modules/bluebird/js/release/promise.js:503:31)
    at Promise._settlePromise (/home/a/projetos/testes/we-project-events-test/node_modules/bluebird/js/release/promise.js:560:18)
    at Promise._settlePromise0 (/home/a/projetos/testes/we-project-events-test/node_modules/bluebird/js/release/promise.js:605:10)
    at Promise._settlePromises (/home/a/projetos/testes/we-project-events-test/node_modules/bluebird/js/release/promise.js:684:18)
    at Async._drainQueue (/home/a/projetos/testes/we-project-events-test/node_modules/bluebird/js/release/async.js:126:16)
    at Async._drainQueues (/home/a/projetos/testes/we-project-events-test/node_modules/bluebird/js/release/async.js:136:10)
    at Immediate.Async.drainQueues [as _onImmediate] (/home/a/projetos/testes/we-project-events-test/node_modules/bluebird/js/release/async.js:16:14)
    at processImmediate [as _immediateCallback] (timers.js:383:17)

May be version erros ... lets see ...

SheaBelsky commented 8 years ago

I got that error after an initial installation just after the project was created; the error in the original issue was presented after multiple wecommands had run and failed to complete.

albertosouza commented 8 years ago

Is related to we.js 1.2.x (released in the last week) new role settings. I will update the generator ...

albertosouza commented 8 years ago

Try to:

1- Update the generator to 1.0.7:

npm install -g generator-wejs

2- Reset the database

3- Re generate your project and run the npm install

OBS: Is possible to only update install.js and package.json but is easy to regenerate ...

@SHBelsky thanks for your feedback and please send other feedback if everything works or if you find other problem

SheaBelsky commented 8 years ago

Worked perfect! Thank you so much!

SheaBelsky commented 8 years ago

Another smaller bug; most of the labels are not actually rendered into their real names. It's just their variable names. Is that just another bug?

This is across the entire site too, not just on the event editing page.

albertosouza commented 8 years ago

run we loadLocales

see https://wejs.org/docs/we/getstarted.blog-project#for-load-default-locales-run-

SheaBelsky commented 8 years ago

That worked as well! Thank you!

albertosouza commented 8 years ago

And one last thing: ACL is disabled by default ... see docs

albertosouza commented 8 years ago

I will close this issue ... the generator is fixed