RoboCupDev / tournamenter

Tournament Manager
Apache License 2.0
2 stars 1 forks source link

Update to sails v.0.10.x? #23

Open TechnoX opened 9 years ago

TechnoX commented 9 years ago

I don't remember which version of Sails we was using, but now when I installed sails on my server I got 0.10.5

I got some errors, for example when creating a team:

Error: Invalid usage of publishCreate() :: Values must have an `id`, instead got ::
{ name: '[Team Name]',
  country: '?',
  category: 'default',
  createdAt: Fri Jan 02 2015 14:30:30 GMT+0000 (UTC),
  updatedAt: Fri Jan 02 2015 14:30:30 GMT+0000 (UTC) }
    at Object.publishCreate (/home/fredrik/tournamenter/node_modules/sails/lib/hooks/pubsub/index.js:232:12)
    at bound [as publishCreate] (/home/fredrik/tournamenter/node_modules/sails/node_modules/lodash/dist/lodash.js:491:21)
    at /home/fredrik/tournamenter/node_modules/sails/lib/hooks/controllers/controller.create.js:54:11
    at /home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/query/dql.js:123:11
    at /home/fredrik/tournamenter/node_modules/async/lib/async.js:139:25
    at /home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/query/dql.js:113:13
    at /home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/utils/schema.js:137:39
    at runner (/home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/query/dql.js:111:11)
    at iterate (/home/fredrik/tournamenter/node_modules/async/lib/async.js:131:13)
    at Object.async.eachSeries (/home/fredrik/tournamenter/node_modules/async/lib/async.js:147:9)

Should we update the code to works out of the box with newer Sails? Or is this a problem with something else not related to the version?

PS. I'm starting to port my map editor for Rescue :)

mrshu commented 9 years ago

Hey @TechnoX,

How did you install tournamenter? Just by running npm install? That should install sails with version 0.9.3 which is specified in package.json and everything should be working fine.

TechnoX commented 9 years ago

I already had sails installed before I ran npm install. I can try to uninstall sails and then redo the install command :)

But I think we should move forward asap and not be dependent on old (deprecated) software :)

mrshu commented 9 years ago

I already had sails installed before I ran npm install. I can try to uninstall sails and then redo the install command :)

Ok, well, I was under the impression that npm install installs everything into the node_modules/ directory and thus creates a separated environment but obviously, I was wrong.

What I'd suggest would be indeed uninstalling sails then.

But I think we should move forward asap and not be dependent on old (deprecated) software :)

Please do not get me wrong since I am the last one to talk about sails, but if they use any sensible versioning convention then this version is pre 1.0.0 and ton of stuff can change. Therefore I believe that it makes more sense to use that version we are sure works.

On the other hand, I totally understand what you are saying by not using/being dependent on old software. Although Node.JS community is very vibrant and alive I think that using a version that is 13 months old does not necessary mean depending on old software.

I also hope you will not need to install tournamenter anymore in the future if we manage to get #22 running.

Also, I am very much looking forward to the Map editor. Do let us know how we can help!

TechnoX commented 9 years ago

Reinstalled sails with "sudo npm install -g" and got v0.9.7 Are you sure I should have 0.9.3?

I still got an error (longer this time) when I press the "+ Create Team" button:

Error: Invalid usage of publishCreate() :: Values must have an `id`, instead got ::
{ name: '[Team Name]',
  country: '?',
  category: 'default',
  createdAt: Fri Jan 02 2015 15:55:02 GMT+0000 (UTC),
  updatedAt: Fri Jan 02 2015 15:55:02 GMT+0000 (UTC) }
    at Object.publishCreate (/home/fredrik/tournamenter/node_modules/sails/lib/hooks/pubsub/index.js:232:12)
    at bound [as publishCreate] (/home/fredrik/tournamenter/node_modules/sails/node_modules/lodash/dist/lodash.js:491:21)
    at /home/fredrik/tournamenter/node_modules/sails/lib/hooks/controllers/controller.create.js:54:11
    at /home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/query/dql.js:123:11
    at /home/fredrik/tournamenter/node_modules/async/lib/async.js:139:25
    at /home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/query/dql.js:113:13
    at /home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/utils/schema.js:137:39
    at runner (/home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/query/dql.js:111:11)
    at iterate (/home/fredrik/tournamenter/node_modules/async/lib/async.js:131:13)
    at Object.async.eachSeries (/home/fredrik/tournamenter/node_modules/async/lib/async.js:147:9)
    at /home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/query/dql.js:118:15
    at Object.module.exports.adapter.create (/home/fredrik/tournamenter/node_modules/sails-disk/index.js:285:4)
    at module.exports.create (/home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/adapter/dql.js:12:18)
    at /home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/query/dql.js:104:21
    at /home/fredrik/tournamenter/node_modules/async/lib/async.js:229:13
    at /home/fredrik/tournamenter/node_modules/async/lib/async.js:139:25
    at /home/fredrik/tournamenter/node_modules/async/lib/async.js:226:17
    at /home/fredrik/tournamenter/node_modules/async/lib/async.js:553:34
    at /home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/query/dql.js:86:11
    at /home/fredrik/tournamenter/node_modules/async/lib/async.js:139:25
    at /home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/query/dql.js:80:13
    at /home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/utils/schema.js:137:39
    at runner (/home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/query/dql.js:78:11)
    at iterate (/home/fredrik/tournamenter/node_modules/async/lib/async.js:131:13)
    at Object.async.eachSeries (/home/fredrik/tournamenter/node_modules/async/lib/async.js:147:9)
    at /home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/query/dql.js:84:15
    at /home/fredrik/tournamenter/node_modules/async/lib/async.js:548:21
    at /home/fredrik/tournamenter/node_modules/async/lib/async.js:224:13
    at iterate (/home/fredrik/tournamenter/node_modules/async/lib/async.js:131:13)
    at /home/fredrik/tournamenter/node_modules/async/lib/async.js:142:25
    at /home/fredrik/tournamenter/node_modules/async/lib/async.js:226:17
    at /home/fredrik/tournamenter/node_modules/async/lib/async.js:553:34
    at /home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/query/dql.js:71:11
    at /home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/query/validate.js:63:7
    at /home/fredrik/tournamenter/node_modules/async/lib/async.js:229:13
    at /home/fredrik/tournamenter/node_modules/async/lib/async.js:139:25
    at /home/fredrik/tournamenter/node_modules/async/lib/async.js:226:17
    at /home/fredrik/tournamenter/node_modules/async/lib/async.js:553:34
    at /home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/query/validate.js:57:11
    at /home/fredrik/tournamenter/node_modules/async/lib/async.js:139:25
    at /home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/query/validate.js:51:13
    at /home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/utils/schema.js:137:39
    at runner (/home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/query/validate.js:49:11)
    at iterate (/home/fredrik/tournamenter/node_modules/async/lib/async.js:131:13)
    at Object.async.eachSeries (/home/fredrik/tournamenter/node_modules/async/lib/async.js:147:9)
    at /home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/query/validate.js:55:15
    at /home/fredrik/tournamenter/node_modules/async/lib/async.js:548:21
    at /home/fredrik/tournamenter/node_modules/async/lib/async.js:224:13
    at iterate (/home/fredrik/tournamenter/node_modules/async/lib/async.js:131:13)
    at /home/fredrik/tournamenter/node_modules/async/lib/async.js:142:25
    at /home/fredrik/tournamenter/node_modules/async/lib/async.js:226:17
    at /home/fredrik/tournamenter/node_modules/async/lib/async.js:553:34
    at /home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/query/validate.js:42:11
    at /home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/core/validations.js:150:49
    at /home/fredrik/tournamenter/node_modules/async/lib/async.js:116:25
    at /home/fredrik/tournamenter/node_modules/async/lib/async.js:24:16
    at /home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/core/validations.js:140:25
    at /home/fredrik/tournamenter/node_modules/async/lib/async.js:116:25
    at /home/fredrik/tournamenter/node_modules/async/lib/async.js:24:16
    at /home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/core/validations.js:121:66
    at /home/fredrik/tournamenter/node_modules/async/lib/async.js:108:13
    at Array.forEach (native)
    at _each (/home/fredrik/tournamenter/node_modules/async/lib/async.js:32:24)
    at Object.async.each (/home/fredrik/tournamenter/node_modules/async/lib/async.js:107:9)
    at validate (/home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/core/validations.js:119:11)
    at /home/fredrik/tournamenter/node_modules/async/lib/async.js:108:13
    at Array.forEach (native)
    at _each (/home/fredrik/tournamenter/node_modules/async/lib/async.js:32:24)
    at Object.async.each (/home/fredrik/tournamenter/node_modules/async/lib/async.js:107:9)
    at Validator.validate (/home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/core/validations.js:149:9)
    at async.series.runner (/home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/query/validate.js:40:25)
    at /home/fredrik/tournamenter/node_modules/async/lib/async.js:548:21
    at /home/fredrik/tournamenter/node_modules/async/lib/async.js:224:13
    at iterate (/home/fredrik/tournamenter/node_modules/async/lib/async.js:131:13)
    at /home/fredrik/tournamenter/node_modules/async/lib/async.js:142:25
    at /home/fredrik/tournamenter/node_modules/async/lib/async.js:226:17
    at /home/fredrik/tournamenter/node_modules/async/lib/async.js:553:34
    at /home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/query/validate.js:34:11
    at /home/fredrik/tournamenter/node_modules/async/lib/async.js:139:25
    at /home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/query/validate.js:28:13
    at /home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/utils/schema.js:137:39
    at runner (/home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/query/validate.js:26:11)
    at iterate (/home/fredrik/tournamenter/node_modules/async/lib/async.js:131:13)
    at Object.async.eachSeries (/home/fredrik/tournamenter/node_modules/async/lib/async.js:147:9)
    at async.series.runner (/home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/query/validate.js:32:15)
    at /home/fredrik/tournamenter/node_modules/async/lib/async.js:548:21
    at /home/fredrik/tournamenter/node_modules/async/lib/async.js:224:13
    at iterate (/home/fredrik/tournamenter/node_modules/async/lib/async.js:131:13)
    at async.eachSeries (/home/fredrik/tournamenter/node_modules/async/lib/async.js:147:9)
    at _asyncMap (/home/fredrik/tournamenter/node_modules/async/lib/async.js:223:9)
    at Object.mapSeries (/home/fredrik/tournamenter/node_modules/async/lib/async.js:213:23)
    at Object.async.series (/home/fredrik/tournamenter/node_modules/async/lib/async.js:546:19)
    at module.exports.validate (/home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/query/validate.js:21:11)
    at async.series.runner (/home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/query/dql.js:69:14)
    at /home/fredrik/tournamenter/node_modules/async/lib/async.js:548:21
    at /home/fredrik/tournamenter/node_modules/async/lib/async.js:224:13
    at iterate (/home/fredrik/tournamenter/node_modules/async/lib/async.js:131:13)
    at async.eachSeries (/home/fredrik/tournamenter/node_modules/async/lib/async.js:147:9)
    at _asyncMap (/home/fredrik/tournamenter/node_modules/async/lib/async.js:223:9)
    at Object.mapSeries (/home/fredrik/tournamenter/node_modules/async/lib/async.js:213:23)
    at Object.async.series (/home/fredrik/tournamenter/node_modules/async/lib/async.js:546:19)
    at module.exports.create (/home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/query/dql.js:65:11)
    at create (/home/fredrik/tournamenter/node_modules/sails/lib/hooks/controllers/controller.create.js:44:9)
    at _bind.enhancedFn (/home/fredrik/tournamenter/node_modules/sails/lib/router/bind.js:375:4)
    at callbacks (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:164:37)
    at param (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:138:11)
    at pass (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:145:5)
    at nextRoute (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:100:7)
    at callbacks (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:167:11)
    at module.exports (/home/fredrik/tournamenter/api/policies/isAuthenticated.js:13:35)
    at _bind.enhancedFn (/home/fredrik/tournamenter/node_modules/sails/lib/router/bind.js:375:4)
    at callbacks (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:164:37)
    at param (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:138:11)
    at pass (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:145:5)
    at nextRoute (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:100:7)
    at callbacks (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:167:11)
    at wrapperFn (/home/fredrik/tournamenter/node_modules/sails/lib/hooks/controllers/index.js:293:4)
    at _bind.enhancedFn (/home/fredrik/tournamenter/node_modules/sails/lib/router/bind.js:375:4)
    at callbacks (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:164:37)
    at param (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:138:11)
    at pass (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:145:5)
    at nextRoute (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:100:7)
    at callbacks (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:167:11)
    at /home/fredrik/tournamenter/node_modules/sails/lib/hooks/i18n/index.js:27:13
    at Object.i18nInit [as init] (/home/fredrik/tournamenter/node_modules/sails/node_modules/i18n/i18n.js:80:5)
    at routes.before./* (/home/fredrik/tournamenter/node_modules/sails/lib/hooks/i18n/index.js:25:16)
    at _bind.enhancedFn (/home/fredrik/tournamenter/node_modules/sails/lib/router/bind.js:375:4)
    at callbacks (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:164:37)
    at param (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:138:11)
    at pass (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:145:5)
    at nextRoute (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:100:7)
    at callbacks (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:167:11)
    at routes.before./* (/home/fredrik/tournamenter/node_modules/sails/lib/hooks/csrf/index.js:35:6)
    at _bind.enhancedFn (/home/fredrik/tournamenter/node_modules/sails/lib/router/bind.js:375:4)
    at callbacks (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:164:37)
    at param (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:138:11)
    at pass (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:145:5)
    at nextRoute (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:100:7)
    at callbacks (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:167:11)
    at _addResViewMethod (/home/fredrik/tournamenter/node_modules/sails/lib/hooks/views/index.js:337:3)
    at _bind.enhancedFn (/home/fredrik/tournamenter/node_modules/sails/lib/router/bind.js:375:4)
    at callbacks (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:164:37)
    at param (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:138:11)
    at pass (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:145:5)
    at nextRoute (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:100:7)
    at callbacks (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:167:11)
    at addSugarMethods (/home/fredrik/tournamenter/node_modules/sails/lib/hooks/request/index.js:68:6)
    at _bind.enhancedFn (/home/fredrik/tournamenter/node_modules/sails/lib/router/bind.js:375:4)
    at callbacks (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:164:37)
    at param (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:138:11)
    at pass (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:145:5)
    at nextRoute (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:100:7)
    at callbacks (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:167:11)
    at /home/fredrik/tournamenter/node_modules/sails/node_modules/connect-flash/lib/flash.js:21:5
    at supportFlashMsgs (/home/fredrik/tournamenter/node_modules/sails/lib/hooks/request/index.js:45:32)
    at _bind.enhancedFn (/home/fredrik/tournamenter/node_modules/sails/lib/router/bind.js:375:4)
    at callbacks (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:164:37)
    at param (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:138:11)
    at pass (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:145:5)
    at Router._dispatch (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:173:5)
    at Object.router (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:33:10)
    at next (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/node_modules/connect/lib/proto.js:190:15)
    at Object.handle (/home/fredrik/tournamenter/node_modules/sails/lib/express/index.js:168:4)
    at next (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/node_modules/connect/lib/proto.js:190:15)
    at Object.handle (/home/fredrik/tournamenter/config/local.js:89:9)
    at next (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/node_modules/connect/lib/proto.js:190:15)
    at Object.handle (/home/fredrik/tournamenter/node_modules/express/node_modules/connect/lib/middleware/compress.js:145:5)
    at next (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/node_modules/connect/lib/proto.js:190:15)
    at Object.methodOverride [as handle] (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/node_modules/connect/lib/middleware/methodOverride.js:49:5)
    at next (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/node_modules/connect/lib/proto.js:190:15)
    at Object.retryBodyParser [as handle] (/home/fredrik/tournamenter/node_modules/sails/lib/express/bodyParserRetry.js:31:11)
    at next (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/node_modules/connect/lib/proto.js:190:15)
    at next (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/node_modules/connect/lib/proto.js:192:9)
    at multipart (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/node_modules/connect/lib/middleware/multipart.js:81:27)
    at /home/fredrik/tournamenter/node_modules/sails/node_modules/express/node_modules/connect/lib/middleware/bodyParser.js:57:9
    at urlencoded (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/node_modules/connect/lib/middleware/urlencoded.js:46:27)
    at /home/fredrik/tournamenter/node_modules/sails/node_modules/express/node_modules/connect/lib/middleware/bodyParser.js:55:7
    at IncomingMessage.<anonymous> (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/node_modules/connect/lib/middleware/json.js:72:9)
    at IncomingMessage.emit (events.js:92:17)
    at _stream_readable.js:944:16
    at process._tickDomainCallback (node.js:486:13)
ivanseidel commented 9 years ago

I don't remember pretty well, but there was some problems using the sails local db (the default one). Can you try using Mongo DB to see if the problem disapear? On Jan 2, 2015 2:02 PM, "Fredrik Lofgren" notifications@github.com wrote:

Reinstalled sails with "sudo npm install -g" and got v0.9.7 Are you sure I should have 0.9.3?

I still got an error (longer this time) when I press the "+ Create Team" button:

Error: Invalid usage of publishCreate() :: Values must have an id, instead got :: { name: '[Team Name]', country: '?', category: 'default', createdAt: Fri Jan 02 2015 15:55:02 GMT+0000 (UTC), updatedAt: Fri Jan 02 2015 15:55:02 GMT+0000 (UTC) } at Object.publishCreate (/home/fredrik/tournamenter/node_modules/sails/lib/hooks/pubsub/index.js:232:12) at bound as publishCreate at /home/fredrik/tournamenter/node_modules/sails/lib/hooks/controllers/controller.create.js:54:11 at /home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/query/dql.js:123:11 at /home/fredrik/tournamenter/node_modules/async/lib/async.js:139:25 at /home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/query/dql.js:113:13 at /home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/utils/schema.js:137:39 at runner (/home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/query/dql.js:111:11) at iterate (/home/fredrik/tournamenter/node_modules/async/lib/async.js:131:13) at Object.async.eachSeries (/home/fredrik/tournamenter/node_modules/async/lib/async.js:147:9) at /home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/query/dql.js:118:15 at Object.module.exports.adapter.create (/home/fredrik/tournamenter/node_modules/sails-disk/index.js:285:4) at module.exports.create (/home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/adapter/dql.js:12:18) at /home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/query/dql.js:104:21 at /home/fredrik/tournamenter/node_modules/async/lib/async.js:229:13 at /home/fredrik/tournamenter/node_modules/async/lib/async.js:139:25 at /home/fredrik/tournamenter/node_modules/async/lib/async.js:226:17 at /home/fredrik/tournamenter/node_modules/async/lib/async.js:553:34 at /home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/query/dql.js:86:11 at /home/fredrik/tournamenter/node_modules/async/lib/async.js:139:25 at /home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/query/dql.js:80:13 at /home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/utils/schema.js:137:39 at runner (/home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/query/dql.js:78:11) at iterate (/home/fredrik/tournamenter/node_modules/async/lib/async.js:131:13) at Object.async.eachSeries (/home/fredrik/tournamenter/node_modules/async/lib/async.js:147:9) at /home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/query/dql.js:84:15 at /home/fredrik/tournamenter/node_modules/async/lib/async.js:548:21 at /home/fredrik/tournamenter/node_modules/async/lib/async.js:224:13 at iterate (/home/fredrik/tournamenter/node_modules/async/lib/async.js:131:13) at /home/fredrik/tournamenter/node_modules/async/lib/async.js:142:25 at /home/fredrik/tournamenter/node_modules/async/lib/async.js:226:17 at /home/fredrik/tournamenter/node_modules/async/lib/async.js:553:34 at /home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/query/dql.js:71:11 at /home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/query/validate.js:63:7 at /home/fredrik/tournamenter/node_modules/async/lib/async.js:229:13 at /home/fredrik/tournamenter/node_modules/async/lib/async.js:139:25 at /home/fredrik/tournamenter/node_modules/async/lib/async.js:226:17 at /home/fredrik/tournamenter/node_modules/async/lib/async.js:553:34 at /home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/query/validate.js:57:11 at /home/fredrik/tournamenter/node_modules/async/lib/async.js:139:25 at /home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/query/validate.js:51:13 at /home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/utils/schema.js:137:39 at runner (/home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/query/validate.js:49:11) at iterate (/home/fredrik/tournamenter/node_modules/async/lib/async.js:131:13) at Object.async.eachSeries (/home/fredrik/tournamenter/node_modules/async/lib/async.js:147:9) at /home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/query/validate.js:55:15 at /home/fredrik/tournamenter/node_modules/async/lib/async.js:548:21 at /home/fredrik/tournamenter/node_modules/async/lib/async.js:224:13 at iterate (/home/fredrik/tournamenter/node_modules/async/lib/async.js:131:13) at /home/fredrik/tournamenter/node_modules/async/lib/async.js:142:25 at /home/fredrik/tournamenter/node_modules/async/lib/async.js:226:17 at /home/fredrik/tournamenter/node_modules/async/lib/async.js:553:34 at /home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/query/validate.js:42:11 at /home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/core/validations.js:150:49 at /home/fredrik/tournamenter/node_modules/async/lib/async.js:116:25 at /home/fredrik/tournamenter/node_modules/async/lib/async.js:24:16 at /home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/core/validations.js:140:25 at /home/fredrik/tournamenter/node_modules/async/lib/async.js:116:25 at /home/fredrik/tournamenter/node_modules/async/lib/async.js:24:16 at /home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/core/validations.js:121:66 at /home/fredrik/tournamenter/node_modules/async/lib/async.js:108:13 at Array.forEach (native) at _each (/home/fredrik/tournamenter/node_modules/async/lib/async.js:32:24) at Object.async.each (/home/fredrik/tournamenter/node_modules/async/lib/async.js:107:9) at validate (/home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/core/validations.js:119:11) at /home/fredrik/tournamenter/node_modules/async/lib/async.js:108:13 at Array.forEach (native) at _each (/home/fredrik/tournamenter/node_modules/async/lib/async.js:32:24) at Object.async.each (/home/fredrik/tournamenter/node_modules/async/lib/async.js:107:9) at Validator.validate (/home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/core/validations.js:149:9) at async.series.runner (/home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/query/validate.js:40:25) at /home/fredrik/tournamenter/node_modules/async/lib/async.js:548:21 at /home/fredrik/tournamenter/node_modules/async/lib/async.js:224:13 at iterate (/home/fredrik/tournamenter/node_modules/async/lib/async.js:131:13) at /home/fredrik/tournamenter/node_modules/async/lib/async.js:142:25 at /home/fredrik/tournamenter/node_modules/async/lib/async.js:226:17 at /home/fredrik/tournamenter/node_modules/async/lib/async.js:553:34 at /home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/query/validate.js:34:11 at /home/fredrik/tournamenter/node_modules/async/lib/async.js:139:25 at /home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/query/validate.js:28:13 at /home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/utils/schema.js:137:39 at runner (/home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/query/validate.js:26:11) at iterate (/home/fredrik/tournamenter/node_modules/async/lib/async.js:131:13) at Object.async.eachSeries (/home/fredrik/tournamenter/node_modules/async/lib/async.js:147:9) at async.series.runner (/home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/query/validate.js:32:15) at /home/fredrik/tournamenter/node_modules/async/lib/async.js:548:21 at /home/fredrik/tournamenter/node_modules/async/lib/async.js:224:13 at iterate (/home/fredrik/tournamenter/node_modules/async/lib/async.js:131:13) at async.eachSeries (/home/fredrik/tournamenter/node_modules/async/lib/async.js:147:9) at _asyncMap (/home/fredrik/tournamenter/node_modules/async/lib/async.js:223:9) at Object.mapSeries (/home/fredrik/tournamenter/node_modules/async/lib/async.js:213:23) at Object.async.series (/home/fredrik/tournamenter/node_modules/async/lib/async.js:546:19) at module.exports.validate (/home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/query/validate.js:21:11) at async.series.runner (/home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/query/dql.js:69:14) at /home/fredrik/tournamenter/node_modules/async/lib/async.js:548:21 at /home/fredrik/tournamenter/node_modules/async/lib/async.js:224:13 at iterate (/home/fredrik/tournamenter/node_modules/async/lib/async.js:131:13) at async.eachSeries (/home/fredrik/tournamenter/node_modules/async/lib/async.js:147:9) at _asyncMap (/home/fredrik/tournamenter/node_modules/async/lib/async.js:223:9) at Object.mapSeries (/home/fredrik/tournamenter/node_modules/async/lib/async.js:213:23) at Object.async.series (/home/fredrik/tournamenter/node_modules/async/lib/async.js:546:19) at module.exports.create (/home/fredrik/tournamenter/node_modules/sails/node_modules/waterline/lib/waterline/query/dql.js:65:11) at create (/home/fredrik/tournamenter/node_modules/sails/lib/hooks/controllers/controller.create.js:44:9) at _bind.enhancedFn (/home/fredrik/tournamenter/node_modules/sails/lib/router/bind.js:375:4) at callbacks (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:164:37) at param (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:138:11) at pass (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:145:5) at nextRoute (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:100:7) at callbacks (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:167:11) at module.exports (/home/fredrik/tournamenter/api/policies/isAuthenticated.js:13:35) at _bind.enhancedFn (/home/fredrik/tournamenter/node_modules/sails/lib/router/bind.js:375:4) at callbacks (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:164:37) at param (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:138:11) at pass (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:145:5) at nextRoute (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:100:7) at callbacks (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:167:11) at wrapperFn (/home/fredrik/tournamenter/node_modules/sails/lib/hooks/controllers/index.js:293:4) at _bind.enhancedFn (/home/fredrik/tournamenter/node_modules/sails/lib/router/bind.js:375:4) at callbacks (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:164:37) at param (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:138:11) at pass (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:145:5) at nextRoute (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:100:7) at callbacks (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:167:11) at /home/fredrik/tournamenter/node_modules/sails/lib/hooks/i18n/index.js:27:13 at Object.i18nInit as init at routes.before./* (/home/fredrik/tournamenter/node_modules/sails/lib/hooks/i18n/index.js:25:16) at _bind.enhancedFn (/home/fredrik/tournamenter/node_modules/sails/lib/router/bind.js:375:4) at callbacks (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:164:37) at param (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:138:11) at pass (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:145:5) at nextRoute (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:100:7) at callbacks (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:167:11) at routes.before./* (/home/fredrik/tournamenter/node_modules/sails/lib/hooks/csrf/index.js:35:6) at _bind.enhancedFn (/home/fredrik/tournamenter/node_modules/sails/lib/router/bind.js:375:4) at callbacks (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:164:37) at param (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:138:11) at pass (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:145:5) at nextRoute (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:100:7) at callbacks (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:167:11) at _addResViewMethod (/home/fredrik/tournamenter/node_modules/sails/lib/hooks/views/index.js:337:3) at _bind.enhancedFn (/home/fredrik/tournamenter/node_modules/sails/lib/router/bind.js:375:4) at callbacks (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:164:37) at param (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:138:11) at pass (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:145:5) at nextRoute (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:100:7) at callbacks (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:167:11) at addSugarMethods (/home/fredrik/tournamenter/node_modules/sails/lib/hooks/request/index.js:68:6) at _bind.enhancedFn (/home/fredrik/tournamenter/node_modules/sails/lib/router/bind.js:375:4) at callbacks (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:164:37) at param (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:138:11) at pass (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:145:5) at nextRoute (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:100:7) at callbacks (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:167:11) at /home/fredrik/tournamenter/node_modules/sails/node_modules/connect-flash/lib/flash.js:21:5 at supportFlashMsgs (/home/fredrik/tournamenter/node_modules/sails/lib/hooks/request/index.js:45:32) at _bind.enhancedFn (/home/fredrik/tournamenter/node_modules/sails/lib/router/bind.js:375:4) at callbacks (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:164:37) at param (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:138:11) at pass (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:145:5) at Router._dispatch (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:173:5) at Object.router (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/lib/router/index.js:33:10) at next (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/node_modules/connect/lib/proto.js:190:15) at Object.handle (/home/fredrik/tournamenter/node_modules/sails/lib/express/index.js:168:4) at next (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/node_modules/connect/lib/proto.js:190:15) at Object.handle (/home/fredrik/tournamenter/config/local.js:89:9) at next (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/node_modules/connect/lib/proto.js:190:15) at Object.handle (/home/fredrik/tournamenter/node_modules/express/node_modules/connect/lib/middleware/compress.js:145:5) at next (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/node_modules/connect/lib/proto.js:190:15) at Object.methodOverride as handle at next (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/node_modules/connect/lib/proto.js:190:15) at Object.retryBodyParser as handle at next (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/node_modules/connect/lib/proto.js:190:15) at next (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/node_modules/connect/lib/proto.js:192:9) at multipart (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/node_modules/connect/lib/middleware/multipart.js:81:27) at /home/fredrik/tournamenter/node_modules/sails/node_modules/express/node_modules/connect/lib/middleware/bodyParser.js:57:9 at urlencoded (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/node_modules/connect/lib/middleware/urlencoded.js:46:27) at /home/fredrik/tournamenter/node_modules/sails/node_modules/express/node_modules/connect/lib/middleware/bodyParser.js:55:7 at IncomingMessage. (/home/fredrik/tournamenter/node_modules/sails/node_modules/express/node_modules/connect/lib/middleware/json.js:72:9) at IncomingMessage.emit (events.js:92:17) at _stream_readable.js:944:16 at process._tickDomainCallback (node.js:486:13)

— Reply to this email directly or view it on GitHub https://github.com/RoboCupDev/tournamenter/issues/23#issuecomment-68537201 .

mrshu commented 9 years ago

@TechnoX this is spooky. @ivanseidel once told me not to do sudo npm install -g but rather npm install on its own so that everything gets installed there and things do not mess up.

ivanseidel commented 9 years ago

I'm getting home in a hour or two. Will look into it. Can you enter skype @TechnoX ?

Ivan Seidel Gomes http://TendaDigital.net http://GitHub.com/ivanseidel On Jan 2, 2015 2:17 PM, "Marek Šuppa" notifications@github.com wrote:

@TechnoX https://github.com/TechnoX this is spooky. @ivanseidel https://github.com/ivanseidel once told me not to do sudo npm install -g but rather npm install on its own so that everything gets installed there and things do not mess up.

— Reply to this email directly or view it on GitHub https://github.com/RoboCupDev/tournamenter/issues/23#issuecomment-68538365 .

TechnoX commented 9 years ago

I tried without -g before, but had some problems that I didn't remember.

@ivanseidel : Sure, I'll log in to Skype now :) In the mean time I will try to use mongoDB.

TechnoX commented 9 years ago

Btw, when I have the server up you can reach it here: http://80.217.114.236:8888/

TechnoX commented 9 years ago

I can't connect to the mongodb .... [Error: failed to connect to [localhost:27017]], I have tried with 80.217.114.236 and open 27017 in the router, as well as 192.168.0.4 and 127.0.0.1 instead of localhost, but without success...

Do I need to setup anything before connecting to the mongodb? :)

ivanseidel commented 9 years ago

Well @TechnoX and @mrshu . It's not documented yet, but we have a bunch of options for starting the server. Here a few with lots of customisations that I personally use:

node app --port=8090 --adapter.module sails-mongo --adapter.url mongodb://localhost:27017/obr_nacional --backup.interval 10 --backup.path /Users/ivanseidel/Desktop/Backups/ --backup.prefix obr_nacional_ --env.NAME obr_nacional --env.APP_NAME "Nacional OBR"

node app --port=8090 --adapter.module sails-mongo --adapter.url mongodb://localhost:27017/sesi_epitacio_2 --backup.interval 10 --backup.path /Users/ivanseidel/Desktop/Backups/ --backup.prefix sesi_epitacio_2_ --env.NAME sesi_epitacio_2 --env.APP_NAME "Epitácio 2"

As you can see, I'm not using sails to lift the server, because it needs to use the script inside the app.js to initialize a few things before lifting.

I guess you need to assign the adapter's module and url...

TechnoX commented 9 years ago

But it should be the same when I set the default adapter module and url in the adapters.js file, right? I have set

'default': 'localMongo',

and

localMongo: {
  module: 'sails-mongo',
  url: 'mongodb://127.0.0.1:27017/test'
},

Call me when you have time ;)

mrshu commented 9 years ago

@TechnoX that should indeed work, the problem seems to be elsewhere. Version 0.9.7 of sails is indeed in the package.json file. Did you try running node app.js? That works for me on my local machine, but only with sails-disk.

@ivanseidel I am out of steam here but I bet you will figure this out in 5 minutes. Based on @TechnoX's output it looks like the code never reached a state in which it would actually save something, either via sails-mongo or sails-disk.

TechnoX commented 9 years ago

I've talked to Ivan for 50 minutes and fixed the problem, he has pushed the code to github already :)

The problem was that sails-disk was saving the id as an string and couldn't auto-increment the value and therefore skipped the id-value. We changed the datatype to integer and now it works like a charm :)

We can close this issue, thanks! :)

mrshu commented 9 years ago

Cool, thanks a lot @TechnoX and @ivanseidel!

ivanseidel commented 9 years ago

;) On Jan 2, 2015 6:14 PM, "Marek Šuppa" notifications@github.com wrote:

Cool, thanks a lot @TechnoX https://github.com/TechnoX and @ivanseidel https://github.com/ivanseidel!

— Reply to this email directly or view it on GitHub https://github.com/RoboCupDev/tournamenter/issues/23#issuecomment-68558207 .

TechnoX commented 9 years ago

Nah, something is still wrong. I can create teams, but when I try to edit their nationality or name I get this error

POST (106ms)    /teams
error: Server Error (500)
error: { ValidationError: { id: [ [Object] ] } }
PATCH (63ms)    /teams/1

I think the id should be 1 instead of [ [Object] ]

TechnoX commented 9 years ago

Okay, I don't know what Ivan pushed before, because in api/models/Team.js the id is still an string.

It works when I change it to an integer, see below:

    attributes: {
            id: {
                    type: 'integer', // BUGFIX: This need to be an integer :) 
                    autoIncrement: true,
            },
            name: {
                    type: 'string',
                    defaultsTo: '[Team Name]'
            },
            country: {
                    type: 'string',
                    defaultsTo: '?'
            },
mrshu commented 9 years ago

@TechnoX cool, thanks a lot for this. Can you please send a pull request? Do let me know if I can be of any help there. If you do not have time for that/don't want to do that I can do it too.

TechnoX commented 9 years ago

I've never done pull requests before, but I think it was quite straight forward :+1:

Let me know if I did anything wrong ;)

mrshu commented 9 years ago

@TechnoX you did a very fine job, thanks a ton!