Closed 0xgeert closed 10 years ago
I went a bit too far. Some of the built-in models such as ACL lost the DB config. It should be fixed now in master.
yup, that solve it. Thanks!
I'm getting it suddenly...
message: "Cannot call AccessToken.findById(). The findById method has not been setup. The PersistedModel has not been correctly attached to a DataSource!" stack: "Error: Cannot call AccessToken.findById(). The findById method has not been setup. The PersistedModel has not been correctly attached to a DataSource!↵ at throwNotAttached (/Users/malixsys/Source/zoof/node_modules/loopback/lib/models/persisted-model.js:56:9)↵ at Function.find [as findById] (/Users/malixsys/Source/zoof/node_modules/loopback/lib/models/persisted-model.js:139:3)↵ at Function.AccessToken.findForRequest (/Users/malixsys/Source/zoof/node_modules/loopback/lib/models/access-token.js:126:10)↵ at /Users/malixsys/Source/zoof/node_modules/loopback/lib/middleware/token.js:53:16↵ at Layer.handle [as handle_request] (/Users/malixsys/Source/zoof/node_modules/loopback/node_modules/express/lib/router/layer.js:76:5)↵ at trim_prefix (/Users/malixsys/Source/zoof/node_modules/loopback/node_modules/express/lib/router/index.js:263:13)↵ at /Users/malixsys/Source/zoof/node_modules/loopback/node_modules/express/lib/router/index.js:230:9↵ at Function.proto.process_params (/Users/malixsys/Source/zoof/node_modules/loopback/node_modules/express/lib/router/index.js:305:12)↵ at /Users/malixsys/Source/zoof/node_modules/loopback/node_modules/express/lib/router/index.js:221:12↵ at Function.match_layer (/Users/malixsys/Source/zoof/node_modules/loopback/node_modules/express/lib/router/index.js:288:3)"
I am getting this error. Using Loopback 3
Error: Cannot call ACL.find(). The find method has not been setup. The PersistedModel has not been correctly attached to a DataSource!
I am getting this error for programmatically defined models but not for models created using the generator.
Hi, please check your model-config.json
file. I realised I had mistakenly removed the ACL
part of it so please make sure that it is there like so...
"ACL": {
"dataSource": "db",
"public": false
},
Just testing out of the box.
When trying any of the methods through localhost:3000/explorer I'm getting:
I was expecting to get
401
instead.I tried to check what the problem could be, but
User
etc are connected to datasourcedb
which is correctly configured afaik. (I changed nothing atmodel-config.json
anddatasources.json
)btw: client-secrets, etc. are configured correctly and the webapp appears to function correctly as well.
Anyone knows that's up?
loopback : 2.1.4 loopback-example-passport: 2.0.0