Code Monkey home page Code Monkey logo

mage-server's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mage-server's Issues

4.5.2 npm run migrate

on 4.5.2

[root@ip-172-31-0-105 mage-server-4.5.2]# npm run build --allow-root option

[email protected] build /apps/mage/mage-server-4.5.2
bower install --config.cwd=public --config.interactive=false && grunt build option

bower ESUDO Cannot be run with sudo

Additional error details:
Since bower is a user command, there is no need to execute it with superuser permissions.
If you're having permission errors when using bower without sudo, please spend a few minutes learning more about how your system should work and make any necessary repairs.

http://www.joyent.com/blog/installing-node-and-npm
https://gist.github.com/isaacs/579814

You can however run a command with sudo using --allow-root option

npm ERR! Linux 4.9.62-21.56.amzn1.x86_64
npm ERR! argv "/root/.nvm/versions/node/v0.12.2/bin/node" "/root/.nvm/versions/node/v0.12.2/bin/npm" "run" "build" "--allow-root" "option"
npm ERR! node v0.12.2
npm ERR! npm v2.7.4
npm ERR! code ELIFECYCLE
npm ERR! [email protected] build: bower install --config.cwd=public --config.interactive=false && grunt build option
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script 'bower install --config.cwd=public --config.interactive=false && grunt build option'.
npm ERR! This is most likely a problem with the MAGE package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! bower install --config.cwd=public --config.interactive=false && grunt build option
npm ERR! You can get their info via:
npm ERR! npm owner ls MAGE
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /apps/mage/mage-server-4.5.2/npm-debug.log

Error downloading attachment from observation

Single download results in this stack trace:

2020-01-29T21:26:28.682Z - error: Cast to ObjectId failed for value "5e31e38bec49c214c6999032.zip" at path "_id" for model "observations2"
2020-01-29T21:26:28.683Z - error: CastError: Cast to ObjectId failed for value "5e31e38bec49c214c6999032.zip" at path "_id" for model "observations2"
at new CastError (/.../mage-server/node_modules/mongoose/lib/error/cast.js:27:11)
at ObjectId.cast (/.../mage-server/node_modules/mongoose/lib/schema/objectid.js:158:13)
at ObjectId.SchemaType._castForQuery (/.../mage-server/node_modules/mongoose/lib/schematype.js:1088:15)
at ObjectId.castForQuery (/.../mage-server/node_modules/mongoose/lib/schema/objectid.js:198:15)
at ObjectId.SchemaType.castForQueryWrapper (/.../mage-server/node_modules/mongoose/lib/schematype.js:1045:15)
at cast (/.../mage-server/node_modules/mongoose/lib/cast.js:269:32)
at model.Query.Query.cast (/.../mage-server/node_modules/mongoose/lib/query.js:3305:12)
at model.Query.Query._castConditions (/.../mage-server/node_modules/mongoose/lib/query.js:1295:10)
at model.Query.Query._findOne (/.../mage-server/node_modules/mongoose/lib/query.js:1507:8)
at /.../mage-server/node_modules/kareem/index.js:250:8
at /.../mage-server/node_modules/kareem/index.js:23:7
at _combinedTickCallback (internal/process/next_tick.js:132:7)
at process._tickCallback (internal/process/next_tick.js:181:9)

The server version is 5.3.3 and this is a new attachment, uploaded after we upgraded to this version. The URL in question is: https://.../api/events/2/observations/5e31e38bec49c214c6999032.zip?access_token=...

Force user logout

Allow an admin on the web to force a user to logout without deleting their account or device.

Install problems

I'm sure this is user error but I'm trying to install mage on my own digital ocean server.
After following all the steps I can go to my IP and see the MAGE logo but nothing else. Can any one give me any hints on where to look.

I do see this in the NPM debug log
17 error Linux 4.15.0-52-generic
18 error argv "/usr/bin/node" "/usr/bin/npm" "run" "build"
19 error node v8.10.0
20 error npm v3.5.2
21 error code ELIFECYCLE
22 error [email protected] build: bower install --config.cwd=public --config.interactive=false && grunt build
22 error Exit status 1
23 error Failed at the [email protected] build script 'bower install --config.cwd=public --config.interactive=false && grunt build'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the MAGE package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error bower install --config.cwd=public --config.interactive=false && grunt build
23 error You can get information on how to open an issue for this project with:
23 error npm bugs MAGE
23 error Or if that isn't available, you can get their info via:
23 error npm owner ls MAGE
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]

Issue with site load

Has anyone seen this?
image

I used nvm 14, npm latest, ubuntu 20. Using forever to load the site with the site listening on 4242 but no luck loading its contents.

Vagrant or Docker support?

Is there any interest in building out a build system that would allow a development environment to be spun up with one command? I'm thinking about Vagrant or Docker specifically. Spinning up the dev environment was not too difficult to do manually, but reducing it to one command might lower the barrier to entry for other developers. It would also be nice to keep the dependencies 'contained'. Just a thought. I would be happy to work on building out such a set of scripts if there is interest in doing so.

Npm run build errors & app setup errors

Hello
I am struggling to set up Mage i run the NPM run build and it returns this error:

> [email protected] build /opt/mage
> npm --prefix public install && npm --prefix public run build

npm ERR! code 128
npm ERR! Command failed: git submodule update -q --init --recursive
npm ERR! fatal: No url found for submodule path 'gh-pages' in .gitmodules
npm ERR! 

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/mage/.npm/_logs/2020-03-03T13_48_16_079Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `npm --prefix public install && npm --prefix public run build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/mage/.npm/_logs/2020-03-03T13_48_16_232Z-debug.log

I check the logs and it says the exact same thing. If I act like this has succeeded and go to run the server I am then hit with this error. I have followed the steps in #54 and use the Mage Cookie command before node app.js and this is the result:

2020-03-03T13:55:43.791Z - error: error initializing database: Error: Cannot find module 'http-proxy-middleware'
Require stack:
- /opt/mage/plugins/mage-geoserver/index.js
- /opt/mage/plugins/index.js
- /opt/mage/app.js

I am then unable to access the local host url.

Use MAGE with custom SSO?

Me again. We are using MAGE with SSO. Basically we sync user account from our system to MAGE. Then, when a user is heading to MAGE, they go through single-sign-on which logs them in behind the scenes and then sets the resulting mage-session and mage-session.sig cookies. We then redirect to MAGE.

Once the user is redirected, they are still being prompted to login. I have verified that the two cookies exist. But I am not sure how to also set the token which results from our behind-the-scenes call to auth/local/authorize. Can it be set as a cookie as well, or can I include it in the URL we redirect to, or is there another way for the UI to pick up the token after we redirect?

PS: The response to GET /api/settings/banner, after the redirect, is 401 with the header www-authenticate: Bearer realm="Users", error="invalid_token" -- which is accurate since we haven't set the token.

NODEJS

I'm having issues downloading Node.js on Ubuntu 16, I've tried curl, wget and even apt-get install with no luck. Are you experiencing any issues with a fresh install?

/api/users returns password hash information

GET /api/users/myself 
POST /api/users/<USERID>/events/1/recent

These two user endpoints return the hashed password data along with the result of the user information. Password hash data should be kept private and not be returned along with the rest of the data set; Even though it is hashed it should be kept secret.

I also recommend the README.md be updated to contain contact information for security issues found in this project. I didn't think this particular issue warranted private disclosure (since this is a new project), but future issues may need to be disclosed privately.

Migrations/001-create-device.js never exits

I'm trying to run the database migrations from scratch and I'm never seeing the second migration. Here is an example of the I/O I see/enter:

$ migrate
  up : migrations/001-create-device.js

Creating intial device uid...
Please enter a uid, this is what you will use to login to the web: admin
Please enter a description (Initial device for web console):  test

The second migration is never triggered.

intial is also a misspelling.

Add observations favorites

Users should be able to favorite observations.

  • Favorite is per observation per user
  • Users should be able to filter on favorites.

Swagger Docs unable to load - console error

In the web client, I clicked on About Mage and then clicked on the link to view the swagger docs. The docs did not display - the window is blank. There is an error in the console:

Error: [$injector:unpr] Unknown provider: class Bi{constructor(e){this.el=e}ngAfterViewInit(){Pi()({url:"/api/docs/openapi.yaml",domNode:this.el.nativeElement.querySelector(".swagger-container"),deepLinking:!1,plugins:[Ui,qi]})}}DirectiveProvider <- class Bi{constructor(e){this.el=e}ngAfterViewInit(){Pi()({url:"/api/docs/openapi.yaml",domNode:this.el.nativeElement.querySelector(".swagger-container"),deepLinking:!1,plugins:[Ui,qi]})}}Directive
http://errors.angularjs.org/1.5.11/$injector/unpr?p0=class%20Bi%7Bconstructor(e)%7Bthis.el%3De%7DngAfterViewInit()%7BPi()(%7Burl%3A%22%2Fapi%2Fdocs%2Fopenapi.yaml%22%2CdomNode%3Athis.el.nativeElement.querySelector(%22.swagger-container%22)%2CdeepLinking%3A!1%2Cplugins%3A%5BUi%2Cqi%5D%7D)%7D%7DDirectiveProvider%20%3C-%20class%20Bi%7Bconstructor(e)%7Bthis.el%3De%7DngAfterViewInit()%7BPi()(%7Burl%3A%22%2Fapi%2Fdocs%2Fopenapi.yaml%22%2CdomNode%3Athis.el.nativeElement.querySelector(%22.swagger-container%22)%2CdeepLinking%3A!1%2Cplugins%3A%5BUi%2Cqi%5D%7D)%7D%7DDirective
at https://www-mage.censored/main.0424f4ee4bb0fd8d918d.js:1:4655925
at https://www-mage.censored/main.0424f4ee4bb0fd8d918d.js:1:4677684
at Object.s [as get] (https://www-mage.censored/main.0424f4ee4bb0fd8d918d.js:1:4679193)
at https://www-mage.censored/main.0424f4ee4bb0fd8d918d.js:1:4677771
at Object.s [as get] (https://www-mage.censored/main.0424f4ee4bb0fd8d918d.js:1:4679193)
at https://www-mage.censored/main.0424f4ee4bb0fd8d918d.js:1:1102598
at e.makeComponentTemplate (https://www-mage.censored/main.0424f4ee4bb0fd8d918d.js:1:1102723)
at e.getTemplate (https://www-mage.censored/main.0424f4ee4bb0fd8d918d.js:1:1100437)
at Object. (https://www-mage.censored/main.0424f4ee4bb0fd8d918d.js:1:1111185)
at https://www-mage.censored/main.0424f4ee4bb0fd8d918d.js:1:4662389

npm run migrate issue?

Having an issue with the initial setup and configuration of the MAGE server. I'm able to get all of the dependencies installed and if I skip the npm run migrate and go straight to npm build run and then node app.js I get the setup page to establish an initial account (although this part does fail).

I've attached the npm-debug.log file here.

npm-debug.log

can't install server on Google Cloud

npm run migrate
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /home/mage/package.json
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open '/home/mage/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! /home/mage/.npm/_logs/2020-03-30T22_07_32_818Z-debug.log
mage@mage:~$ node app.js
internal/modules/cjs/loader.js:985
throw err;
^
Error: Cannot find module '/home/magec/app.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:982:15)
at Function.Module._load (internal/modules/cjs/loader.js:864:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
at internal/main/run_main_module.js:18:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}

Permission error when running with Docker

After installing with docker:

docker-compose up -d

The service containers exits right away after the installation is complete. Logs from the mage-server and mage-db:

docker-compose logs mage-server

F CONTROL  [main] Failed global initialization: FileNotOpen: Failed to open "/var/log/mongodb/mongod.log"

docker-compose logs mage-server

- error: error connecting to mongodb database at mongodb://mage-db:27017/magedb; please make sure mongodb is running: MongoError: failed to connect to server [mage-db:27017] on first connect [MongoError: getaddrinfo ENOTFOUND mage-db mage-db:27017]
error: Could not create directory to store MAGE media attachments. Error: EACCES: permission denied, mkdir '/var/lib/mage/attachments'
Error: EACCES: permission denied, mkdir '/var/lib/mage/attachments'

I am running on ubunutu 18.04, docker 20.10.8, configured with a docker group as recommended in the post installation steps, and docker-compose 1.29.2. I am new to docker so any pointers for how to fix this would be much appreciated.

Not install server

/opt/mage$ npm install
npm WARN deprecated [email protected]: request has been deprecated, see request/request#3142
npm WARN deprecated [email protected]: Package no longer supported. Contact [email protected] for more info.
npm WARN deprecated [email protected]: Fixed a critical issue with BSON serialization documented in CVE-2019-2391, see https://bit.ly/2KcpXdo for more details
npm WARN deprecated [email protected]: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm ERR! Linux 5.3.0-46-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! node v8.10.0
npm ERR! npm v3.5.2
npm ERR! code EMISSINGARG

npm ERR! typeerror Error: Missing required argument #1
npm ERR! typeerror at andLogAndFinish (/usr/share/npm/lib/fetch-package-metadata.js:31:3)
npm ERR! typeerror at fetchPackageMetadata (/usr/share/npm/lib/fetch-package-metadata.js:51:22)
npm ERR! typeerror at resolveWithNewModule (/usr/share/npm/lib/install/deps.js:456:12)
npm ERR! typeerror at /usr/share/npm/lib/install/deps.js:457:7
npm ERR! typeerror at /usr/share/npm/node_modules/iferr/index.js:13:50
npm ERR! typeerror at /usr/share/npm/lib/fetch-package-metadata.js:37:12
npm ERR! typeerror at addRequestedAndFinish (/usr/share/npm/lib/fetch-package-metadata.js:82:5)
npm ERR! typeerror at returnAndAddMetadata (/usr/share/npm/lib/fetch-package-metadata.js:117:7)
npm ERR! typeerror at pickVersionFromRegistryDocument (/usr/share/npm/lib/fetch-package-metadata.js:134:20)
npm ERR! typeerror at /usr/share/npm/node_modules/iferr/index.js:13:50
npm ERR! typeerror This is an error with npm itself. Please report this error at:
npm ERR! typeerror http://github.com/npm/npm/issues

npm ERR! Please include the following file with any support request:
npm ERR! /opt/mage/npm-debug.log

User active vs. enabled?

What's the difference between the active and enabled field on a user? Hope you don't mind me asking questions here. Thanks!

Edit: Specifically, when I try to disable a user I was trying to send false for both fields but the user is still coming back as active=true and enabled=true. I see the web UI, when disabling a user, is PUTing to users/{id} and setting active=true and enabled=false. I tried to not send active at all, and set enabled to false, but it does not appear to take.

Web Application Error

92% chunk asset optimization TerserPluginKilled
npm ERR! code ELIFECYCLE
npm ERR! errno 137
npm ERR! @ngageoint/[email protected] build: ng build --prod=true
npm ERR! Exit status 137
npm ERR!
npm ERR! Failed at the @ngageoint/[email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/mage/.npm/_logs/2020-04-30T05_34_26_072Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 137
npm ERR! [email protected] build-web: npm --prefix web-app install && npm --prefix web-app run build
npm ERR! Exit status 137
npm ERR!
npm ERR! Failed at the [email protected] build-web script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/mage/.npm/_logs/2020-04-30T05_34_26_443Z-debug.log
mage@ubuntu:/opt/mage$

[Documentation] How to configure db connection

I see a cloudfoundry environment configuration and a local configuration, how would I configure this to use a different cloud provider?

For example, my database uri is provided as an environment variable, how can I tell mage what this is?

Add multiselect support

When picking a dropdown field, form creator should have ability to mark that field as a multi select field.

  • Add multi select field option in schema
  • Add support for multi select in view/edit on web

Unauthorized Error after Login

So I am trying to login to my MAGE server via Curl and I got as far as logging in. I understand that I need to get an authorization token but when trying to POST my uid at the "auth/local/authorize" end point I keep getting an error saying "unauthorized".

Setup broken on master

FYI setup seems to be broken on master. I accidentally grabbed master instead of 5.2.5, and noticed that during first run / setup, after entering the initial device id/uid, I get a 401.


Unfortunately I am having the same issue with 5.2.5 -- fresh install on a fresh Mongo v3.4.20 instance. Here is the log:

2019-06-15T02:28:53.618Z - info: Starting MAGE Server ...
2019-06-15T02:28:54.126Z - info: setting up provision uid
2019-06-15T02:28:54.836Z - info: Using '/var/lib/mage/attachments' as base directory for feature attachments.
2019-06-15T02:28:54.836Z - info: Using '/var/lib/mage/icons' as base directory for MAGE icons.
2019-06-15T02:28:54.845Z - info: intializing database models ...
2019-06-15T02:28:54.845Z - info: intializing database model cappedLocation ...
2019-06-15T02:28:54.845Z - info: intializing database model counter ...
2019-06-15T02:28:54.845Z - info: intializing database model device ...
2019-06-15T02:28:54.845Z - info: intializing database model event ...
2019-06-15T02:28:54.845Z - info: intializing database model feature ...
2019-06-15T02:28:54.846Z - info: intializing database model icon ...
2019-06-15T02:28:54.846Z - info: intializing database model layer ...
2019-06-15T02:28:54.846Z - info: intializing database model location ...
2019-06-15T02:28:54.846Z - info: intializing database model login ...
2019-06-15T02:28:54.846Z - info: intializing database model observation ...
2019-06-15T02:28:54.846Z - info: intializing database model permission ...
2019-06-15T02:28:54.846Z - info: intializing database model role ...
2019-06-15T02:28:54.846Z - info: intializing database model setting ...
2019-06-15T02:28:54.846Z - info: intializing database model team ...
2019-06-15T02:28:54.846Z - info: intializing database model token ...
2019-06-15T02:28:54.846Z - info: intializing database model user ...
2019-06-15T02:28:54.846Z - info: running database migrations in directory /opt/mage/mage-server/migrations ...
2019-06-15T02:28:54.862Z - mongoose: settings.ensureIndex({ type: 1 }, { unique: true, background: true }, )
2019-06-15T02:28:54.867Z - mongoose: tokens.ensureIndex({ expirationDate: 1 }, { expireAfterSeconds: 0, background: true }, )
2019-06-15T02:28:54.867Z - mongoose: logins.ensureIndex({ userId: 1 }, { background: true }, )
2019-06-15T02:28:54.868Z - mongoose: locations.ensureIndex({ userId: 1 }, { sparse: true, background: true }, )
2019-06-15T02:28:54.868Z - mongoose: cappedlocations.ensureIndex({ userId: 1 }, { sparse: true, background: true }, )
2019-06-15T02:28:54.868Z - mongoose: users.ensureIndex({ username: 1 }, { unique: true, background: true }, )
2019-06-15T02:28:54.869Z - mongoose: devices.ensureIndex({ uid: 1 }, { unique: true, background: true }, )
2019-06-15T02:28:54.869Z - mongoose: layers.ensureIndex({ _id: 1 }, { unique: true, background: true }, )
2019-06-15T02:28:54.869Z - mongoose: layers.ensureIndex({ _id: 1 }, { unique: true, background: true }, )
2019-06-15T02:28:54.869Z - mongoose: layers.ensureIndex({ _id: 1 }, { unique: true, background: true }, )
2019-06-15T02:28:54.870Z - mongoose: layers.ensureIndex({ _id: 1 }, { unique: true, background: true }, )
2019-06-15T02:28:54.870Z - mongoose: roles.ensureIndex({ name: 1 }, { unique: true, background: true }, )
2019-06-15T02:28:54.878Z - mongoose: logins.ensureIndex({ deviceId: 1 }, { background: true }, )
2019-06-15T02:28:54.885Z - mongoose: locations.ensureIndex({ eventId: 1 }, { sparse: true, background: true }, )
2019-06-15T02:28:54.892Z - mongoose: users.ensureIndex({ status: 1 }, { background: true }, )
2019-06-15T02:28:54.900Z - mongoose: cappedlocations.ensureIndex({ eventId: 1 }, { sparse: true, background: true }, )
2019-06-15T02:28:54.902Z - mongoose: locations.ensureIndex({ geometry: '2dsphere' }, { background: true }, )
2019-06-15T02:28:54.903Z - mongoose: logins.ensureIndex({ userId: 1, deviceId: 1 }, { background: true }, )
2019-06-15T02:28:54.904Z - mongoose: cappedlocations.ensureIndex({ 'locations.userId': 1 }, { sparse: true, background: true }, )
2019-06-15T02:28:54.908Z - info: Migration 'create-initial-user-role': skip (migration already ran)
2019-06-15T02:28:54.908Z - info: Migration 'create-initial-admin-role': skip (migration already ran)
2019-06-15T02:28:54.908Z - info: Migration 'create-initial-osm-layer': skip (migration already ran)
2019-06-15T02:28:54.908Z - info: Migration '006-event-teams': skip (migration already ran)
2019-06-15T02:28:54.908Z - info: Migration '007-user-icon': skip (migration already ran)
2019-06-15T02:28:54.909Z - info: Migration 'create-user-no-edit-role': skip (migration already ran)
2019-06-15T02:28:54.909Z - info: Migration 'create-manager-role': skip (migration already ran)
2019-06-15T02:28:54.909Z - info: Migration 'add-user-device-manager-role': skip (migration already ran)
2019-06-15T02:28:54.909Z - info: Migration 'multiple-forms': skip (migration already ran)
2019-06-15T02:28:54.909Z - info: Migration 'user-role-remove-delete': skip (migration already ran)
2019-06-15T02:28:54.909Z - info: Migration 'ensure-event-indexes': skip (migration already ran)
2019-06-15T02:28:54.909Z - info: Migration 'add-role-update-delete': skip (migration already ran)
2019-06-15T02:28:54.909Z - info: Migration 'manager-role-add-user-create': skip (migration already ran)
2019-06-15T02:28:54.910Z - info: database initialized; loading plugins ...
2019-06-15T02:28:54.916Z - info: opening app for connections ...
2019-06-15T02:28:54.920Z - info: MAGE Server: listening at address 0.0.0.0 on port 4242
2019-06-15T02:28:54.921Z - mongoose: locations.ensureIndex({ 'properties.timestamp': 1 }, { background: true }, )
2019-06-15T02:28:54.922Z - mongoose: logins.ensureIndex({ _id: 1, userId: 1, deviceId: 1 }, { background: true }, )
2019-06-15T02:28:54.924Z - mongoose: cappedlocations.ensureIndex({ 'locations.eventId': 1 }, { sparse: true, background: true }, )
2019-06-15T02:28:54.925Z - mongoose: locations.ensureIndex({ 'properties.timestamp': 1, _id: 1 }, { background: true }, )
2019-06-15T02:28:54.926Z - mongoose: cappedlocations.ensureIndex({ 'locations.geometry': '2dsphere' }, { background: true }, )
2019-06-15T02:28:54.926Z - mongoose: locations.ensureIndex({ userId: 1 }, { background: true }, )
2019-06-15T02:28:54.927Z - mongoose: cappedlocations.ensureIndex({ 'locations.properties.timestamp': 1 }, { background: true }, )
2019-06-15T02:28:54.928Z - mongoose: locations.ensureIndex({ 'properties.user': 1, 'properties.timestamp': 1 }, { background: true }, )
2019-06-15T02:28:54.929Z - mongoose: cappedlocations.ensureIndex({ 'locations.properties.timestamp': 1, 'locations._id': 1 }, { background: true }, )
2019-06-15T02:28:54.929Z - mongoose: cappedlocations.ensureIndex({ 'locations.userId': 1 }, { background: true }, )
2019-06-15T02:28:54.931Z - mongoose: cappedlocations.ensureIndex({ 'locations.properties.user': 1, 'locations.properties.timestamp': 1 }, { background: true }, )
2019-06-15T02:28:54.932Z - mongoose: cappedlocations.ensureIndex({ eventId: 1 }, { background: true }, )
2019-06-15T02:28:54.932Z - mongoose: cappedlocations.ensureIndex({ 'locations.properties.timestamp': 1 }, { background: true }, )
2019-06-15T02:28:54.933Z - mongoose: cappedlocations.ensureIndex({ 'locations.properties.timestamp': 1, eventId: 1 }, { background: true }, )
2019-06-15T02:29:02.378Z - mongoose: tokens.findOne({ token: 'null' }, { fields: {} }, )
2019-06-15T02:29:02.393Z - mongoose: users.count({}, {}, )
2019-06-15T02:29:02.394Z - mongoose: settings.findOne({ type: 'disclaimer' }, { fields: {} }, )
2019-06-15T02:29:02.488Z - mongoose: tokens.findOne({ token: 'null' }, { fields: {} }, )
2019-06-15T02:29:02.598Z - mongoose: tokens.findOne({ token: 'null' }, { fields: {} }, )
2019-06-15T02:29:10.848Z - mongoose: users.count({}, {}, )
2019-06-15T02:29:10.859Z - mongoose: roles.findOne({ name: 'ADMIN_ROLE' }, { fields: {} }, )
2019-06-15T02:29:10.875Z - mongoose: users.findOne({ username: 'admin' }, { fields: {} }, )
2019-06-15T02:29:10.878Z - mongoose: users.findOne({ _id: ObjectId("5d0457f6a124f7519093c5b0") }, { fields: {} }, )
2019-06-15T02:29:10.995Z - mongoose: users.insert({ lastUpdated: new Date("Sat, 15 Jun 2019 02:29:10 GMT"), createdAt: new Date("Sat, 15 Jun 2019 02:29:10 GMT"), username: 'admin', displayName: 'admin', active: true, roleId: ObjectId("5d04579ae0f2145143661ee6"), _id: ObjectId("5d0457f6a124f7519093c5b0"), authentication: { type: 'local', password: '...', security: { numberOfTimesLocked: 0, invalidLoginAttempts: 0 } }, recentEventIds: [], enabled: true, icon: { type: 'none' }, phones: [] }, , )
2019-06-15T02:29:11.007Z - mongoose: roles.find({ _id: { '$in': [ ObjectId("5d04579ae0f2145143661ee6") ] } }, { fields: {} }, )
2019-06-15T02:29:11.017Z - mongoose: devices.findAndModify({ uid: 'mydevice' }, [], { '$set': { description: undefined, userId: undefined, userAgent: undefined, appVersion: undefined, registered: true } })
2019-06-15T02:29:11.235Z - mongoose: users.findOne({ username: 'admin' }, { fields: {} }, )
2019-06-15T02:29:11.237Z - mongoose: roles.find({ _id: { '$in': [ ObjectId("5d04579ae0f2145143661ee6") ] } }, { fields: {} }, )
2019-06-15T02:29:11.358Z - mongoose: users.findOne({ username: 'admin' }, { fields: {} }, )
2019-06-15T02:29:11.360Z - mongoose: users.update({ _id: ObjectId("5d0457f6a124f7519093c5b0") }, { '$set': { 'authentication.security': {}, lastUpdated: new Date("Sat, 15 Jun 2019 02:29:11 GMT") } }, )

Can't connect to server

at Object.<anonymous> (/opt/mage/utilities/geopackage.js:4:25)
at Module._compile (internal/modules/cjs/loader.js:1158:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
at Module.load (internal/modules/cjs/loader.js:1002:32)
at Function.Module._load (internal/modules/cjs/loader.js:901:14)
at Module.require (internal/modules/cjs/loader.js:1044:19)
at require (internal/modules/cjs/helpers.js:77:18)
at module.exports (/opt/mage/routes/layers.js:14:20)
at /opt/mage/routes/index.js:54:26
at Array.forEach (<anonymous>)
at module.exports (/opt/mage/routes/index.js:51:29)
at Object.<anonymous> (/opt/mage/express.js:84:20)
at Module._compile (internal/modules/cjs/loader.js:1158:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
at Module.load (internal/modules/cjs/loader.js:1002:32)
at Function.Module._load (internal/modules/cjs/loader.js:901:14)
at Module.require (internal/modules/cjs/loader.js:1044:19)
at require (internal/modules/cjs/helpers.js:77:18) {

code: 'MODULE_NOT_FOUND',
requireStack: [
'/opt/mage/utilities/geopackage.js',
'/opt/mage/routes/layers.js',
'/opt/mage/routes/index.js',
'/opt/mage/express.js',
'/opt/mage/app.js'
]
}

npm run migrate issue

on 4.5.1

root@ip-172-31-0-105 mage-server-4.5.1]# npm run migrate

[email protected] migrate /apps/mage/mage-server-4.5.1
mm --config=migrations/mm-config.js

info: using mongodb connection from: mongodb://localhost:27017/magedb?ssl=undefined
the server/replset/mongos options are deprecated, all their options are supported at the top level of the options object [poolSize,ssl,sslValidate,sslCA,sslCert,sslKey,sslPass,sslCRL,autoReconnect,noDelay,keepAlive,connectTimeoutMS,family,socketTimeoutMS,reconnectTries,reconnectInterval,ha,haInterval,replicaSet,secondaryAcceptableLatencyMS,acceptableLatencyMS,connectWithNoPrimary,authSource,w,wtimeout,j,forceServerObjectId,serializeFunctions,ignoreUndefined,raw,bufferMaxEntries,readPreference,pkFactory,promiseLibrary,readConcern,maxStalenessSeconds,loggerLevel,logger,promoteValues,promoteBuffers,promoteLongs,domainsEnabled,keepAliveInitialDelay,checkServerIdentity,validateOptions,appname,auth]
the server/replset/mongos options are deprecated, all their options are supported at the top level of the options object [poolSize,ssl,sslValidate,sslCA,sslCert,sslKey,sslPass,sslCRL,autoReconnect,noDelay,keepAlive,connectTimeoutMS,family,socketTimeoutMS,reconnectTries,reconnectInterval,ha,haInterval,replicaSet,secondaryAcceptableLatencyMS,acceptableLatencyMS,connectWithNoPrimary,authSource,w,wtimeout,j,forceServerObjectId,serializeFunctions,ignoreUndefined,raw,bufferMaxEntries,readPreference,pkFactory,promiseLibrary,readConcern,maxStalenessSeconds,loggerLevel,logger,promoteValues,promoteBuffers,promoteLongs,domainsEnabled,keepAliveInitialDelay,checkServerIdentity,validateOptions,appname,auth]
the server/replset/mongos options are deprecated, all their options are supported at the top level of the options object [poolSize,ssl,sslValidate,sslCA,sslCert,sslKey,sslPass,sslCRL,autoReconnect,noDelay,keepAlive,connectTimeoutMS,family,socketTimeoutMS,reconnectTries,reconnectInterval,ha,haInterval,replicaSet,secondaryAcceptableLatencyMS,acceptableLatencyMS,connectWithNoPrimary,authSource,w,wtimeout,j,forceServerObjectId,serializeFunctions,ignoreUndefined,raw,bufferMaxEntries,readPreference,pkFactory,promiseLibrary,readConcern,maxStalenessSeconds,loggerLevel,logger,promoteValues,promoteBuffers,promoteLongs,domainsEnabled,keepAliveInitialDelay,checkServerIdentity,validateOptions,appname,auth]
the server/replset/mongos options are deprecated, all their options are supported at the top level of the options object [poolSize,ssl,sslValidate,sslCA,sslCert,sslKey,sslPass,sslCRL,autoReconnect,noDelay,keepAlive,connectTimeoutMS,family,socketTimeoutMS,reconnectTries,reconnectInterval,ha,haInterval,replicaSet,secondaryAcceptableLatencyMS,acceptableLatencyMS,connectWithNoPrimary,authSource,w,wtimeout,j,forceServerObjectId,serializeFunctions,ignoreUndefined,raw,bufferMaxEntries,readPreference,pkFactory,promiseLibrary,readConcern,maxStalenessSeconds,loggerLevel,logger,promoteValues,promoteBuffers,promoteLongs,domainsEnabled,keepAliveInitialDelay,checkServerIdentity,validateOptions,appname,auth]
/apps/mage/mage-server-4.5.1/node_modules/mongodb-migrations/node_modules/mongodb/node_modules/mongodb-core/lib/auth/scram.js:128
username = username.replace('=', "=3D").replace(',', '=2C');
^
TypeError: Cannot read property 'replace' of undefined
at executeScram (/apps/mage/mage-server-4.5.1/node_modules/mongodb-migrations/node_modules/mongodb/node_modules/mongodb-core/lib/auth/scram.js:128:24)
at /apps/mage/mage-server-4.5.1/node_modules/mongodb-migrations/node_modules/mongodb/node_modules/mongodb-core/lib/auth/scram.js:277:7
at process._tickCallback (node.js:355:11)

npm ERR! Linux 4.9.62-21.56.amzn1.x86_64
npm ERR! argv "/root/.nvm/versions/node/v0.12.2/bin/node" "/root/.nvm/versions/node/v0.12.2/bin/npm" "run" "migrate"
npm ERR! node v0.12.2
npm ERR! npm v2.7.4
npm ERR! code ELIFECYCLE
npm ERR! [email protected] migrate: mm --config=migrations/mm-config.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] migrate script 'mm --config=migrations/mm-config.js'.
npm ERR! This is most likely a problem with the MAGE package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! mm --config=migrations/mm-config.js
npm ERR! You can get their info via:
npm ERR! npm owner ls MAGE
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /apps/mage/mage-server-4.5.1/npm-debug.log

API docs appear to be out of date / inaccurate?

Haven't looked into this too much yet, honestly, just trying to work through it and get to the end of my task.

It appears that the API docs (/api/swagger) are out of date. Things I've noticed:

  • missing (new?) auth endpoints, e.g. auth/local/signin, auth/local/authorize
  • incorrect return type for api/users/{id}, e.g. docs indicate far, far smaller payload than what's actually returned

Do I need to re-gen the docs? I assumed they would be auto-gen'd at startup/build time?

Not install server

/opt/mage$ npm install
npm WARN deprecated [email protected]: request has been deprecated, see request/request#3142
npm WARN deprecated [email protected]: Package no longer supported. Contact [email protected] for more info.
npm WARN deprecated [email protected]: Fixed a critical issue with BSON serialization documented in CVE-2019-2391, see https://bit.ly/2KcpXdo for more details
npm WARN deprecated [email protected]: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm ERR! Linux 5.3.0-46-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! node v8.10.0
npm ERR! npm v3.5.2
npm ERR! code EMISSINGARG

npm ERR! typeerror Error: Missing required argument #1
npm ERR! typeerror at andLogAndFinish (/usr/share/npm/lib/fetch-package-metadata.js:31:3)
npm ERR! typeerror at fetchPackageMetadata (/usr/share/npm/lib/fetch-package-metadata.js:51:22)
npm ERR! typeerror at resolveWithNewModule (/usr/share/npm/lib/install/deps.js:456:12)
npm ERR! typeerror at /usr/share/npm/lib/install/deps.js:457:7
npm ERR! typeerror at /usr/share/npm/node_modules/iferr/index.js:13:50
npm ERR! typeerror at /usr/share/npm/lib/fetch-package-metadata.js:37:12
npm ERR! typeerror at addRequestedAndFinish (/usr/share/npm/lib/fetch-package-metadata.js:82:5)
npm ERR! typeerror at returnAndAddMetadata (/usr/share/npm/lib/fetch-package-metadata.js:117:7)
npm ERR! typeerror at pickVersionFromRegistryDocument (/usr/share/npm/lib/fetch-package-metadata.js:134:20)
npm ERR! typeerror at /usr/share/npm/node_modules/iferr/index.js:13:50
npm ERR! typeerror This is an error with npm itself. Please report this error at:
npm ERR! typeerror http://github.com/npm/npm/issues

npm ERR! Please include the following file with any support request:
npm ERR! /opt/mage/npm-debug.log

npm install for Mage

When I run
npm install
inside the Mage root dir...
I receive an error...

colombia@colombia-desktop:/opt/mage$ sudo npm install
npm WARN deprecated [email protected]: request has been deprecated, see request/request#3142
npm WARN deprecated [email protected]: Package no longer supported. Contact [email protected] for more info.
npm WARN deprecated [email protected]: Fixed a critical issue with BSON serialization documented in CVE-2019-2391, see https://bit.ly/2KcpXdo for more details
npm WARN deprecated [email protected]: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm ERR! Linux 4.15.0-101-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! node v8.10.0
npm ERR! npm v3.5.2
npm ERR! code EMISSINGARG

npm ERR! typeerror Error: Missing required argument #1
npm ERR! typeerror at andLogAndFinish (/usr/share/npm/lib/fetch-package-metadata.js:31:3)
npm ERR! typeerror at fetchPackageMetadata (/usr/share/npm/lib/fetch-package-metadata.js:51:22)
npm ERR! typeerror at resolveWithNewModule (/usr/share/npm/lib/install/deps.js:456:12)
npm ERR! typeerror at /usr/share/npm/lib/install/deps.js:457:7
npm ERR! typeerror at /usr/share/npm/node_modules/iferr/index.js:13:50
npm ERR! typeerror at /usr/share/npm/lib/fetch-package-metadata.js:37:12
npm ERR! typeerror at addRequestedAndFinish (/usr/share/npm/lib/fetch-package-metadata.js:82:5)
npm ERR! typeerror at returnAndAddMetadata (/usr/share/npm/lib/fetch-package-metadata.js:117:7)
npm ERR! typeerror at pickVersionFromRegistryDocument (/usr/share/npm/lib/fetch-package-metadata.js:134:20)
npm ERR! typeerror at /usr/share/npm/node_modules/iferr/index.js:13:50
npm ERR! typeerror This is an error with npm itself. Please report this error at:
npm ERR! typeerror http://github.com/npm/npm/issues

npm ERR! Please include the following file with any support request:
npm ERR! /opt/mage/npm-debug.log

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.