Gilbert Comeau
Gilbert Comeau

Reputation: 33

Loopback Mysql Connection issue

I am trying to connect loopback to an existing mysql database I have setup and I am receiving the following error even though my database information is correctly configured in datasources.json.

"error": { "statusCode": 401, "name": "Error", "message": "Authorization Required", "code": "AUTHORIZATION_REQUIRED", "stack": "Error: Authorization Required\n at /home/gil/loopback/loopback-getting-started/node_modules/loopback/lib/application.js:399:21\n at /home/gil/loopback/loopback-getting-started/node_modules/loopback/lib/model.js:349:7\n at /home/gil/loopback/loopback-getting-started/node_modules/loopback/common/models/acl.js:472:23\n at /home/gil/loopback/loopback-getting-started/node_modules/async/dist/async.js:3824:9\n at /home/gil/loopback/loopback-getting-started/node_modules/async/dist/async.js:460:16\n at iteratorCallback (/home/gil/loopback/loopback-getting-started/node_modules/async/dist/async.js:1034:13)\n at /home/gil/loopback/loopback-getting-started/node_modules/async/dist/async.js:944:16\n at /home/gil/loopback/loopback-getting-started/node_modules/async/dist/async.js:3821:13\n at apply (/home/gil/loopback/loopback-getting-started/node_modules/async/dist/async.js:21:25)\n at /home/gil/loopback/loopback-getting-started/node_modules/async/dist/async.js:56:12\n at /home/gil/loopback/loopback-getting-started/node_modules/loopback/common/models/acl.js:454:17\n at /home/gil/loopback/loopback-getting-started/node_modules/loopback/common/models/role.js:273:21\n at _combinedTickCallback (internal/process/next_tick.js:73:7)\n at process._tickDomainCallback (internal/process/next_tick.js:128:9)" }

Can anyone point me in the right direction?

Upvotes: 0

Views: 189

Answers (1)

Undrium
Undrium

Reputation: 2678

That is not related to MySQL, seems like you have trouble with your ACL on your endpoints. Make sure your endpoint has the right ACL, the model you are trying to access should have a json-file with an ACL-entry. If you want it to allow everyone just clear it out.

Upvotes: 1

Related Questions