Picture of Tommy C
vagrant install problem
by Tommy C - Tuesday, 30 August 2016, 11:28 PM
 

 

I try install at centos system by use vagrant and I want remote login by use other PC in same network.

When I try to get login page(http://192.168.1.1:5000/), I get this error:

Error: Script error for: adaptbuilder/js/origin.js?20160830213146157
http://requirejs.org/docs/errors.html#scripterror

 

At vagrant@vagrant-ubuntu-trusty-32, I can see 5000 port is LISTEN

vagrant@vagrant-ubuntu-trusty-32:~$ netstat -tulnp
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      -
tcp        0      0 127.0.0.1:27017         0.0.0.0:*               LISTEN      -
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      -
tcp        0      0 127.0.0.1:28017         0.0.0.0:*               LISTEN      -
tcp        0      0 0.0.0.0:42354           0.0.0.0:*               LISTEN      -
tcp6       0      0 :::22                   :::*                    LISTEN      -
tcp6       0      0 :::59194                :::*                    LISTEN      -
tcp6       0      0 :::5000                 :::*                    LISTEN      17126/server.js
tcp6       0      0 :::111                  :::*                    LISTEN      -
udp        0      0 127.0.0.1:773           0.0.0.0:*                           -
udp        0      0 0.0.0.0:68              0.0.0.0:*                           -
udp        0      0 0.0.0.0:111             0.0.0.0:*                           -
udp        0      0 0.0.0.0:61045           0.0.0.0:*                           -
udp        0      0 0.0.0.0:658             0.0.0.0:*                           -
udp        0      0 0.0.0.0:53207           0.0.0.0:*                           -
udp6       0      0 :::50278                :::*                                -
udp6       0      0 :::111                  :::*                                -
udp6       0      0 :::658                  :::*                                -
udp6       0      0 :::40642                :::*                                -

I can see mongodb is up:

 

Tue Aug 30 12:22:24.200 [conn9] end connection 127.0.0.1:44038 (4 connections now open)
Tue Aug 30 12:22:24.204 [conn8] end connection 127.0.0.1:44037 (3 connections now open)
Tue Aug 30 12:22:24.208 [conn7] end connection 127.0.0.1:44036 (3 connections now open)
Tue Aug 30 12:22:24.212 [conn6] end connection 127.0.0.1:44035 (2 connections now open)
Tue Aug 30 12:22:24.214 [conn10] end connection 127.0.0.1:44039 (4 connections now open)
Tue Aug 30 12:31:36.505 [initandlisten] connection accepted from 127.0.0.1:44103 #11 (1 connection now open)
Tue Aug 30 12:31:36.518 [initandlisten] connection accepted from 127.0.0.1:44104 #12 (2 connections now open)
Tue Aug 30 12:31:36.520 [initandlisten] connection accepted from 127.0.0.1:44105 #13 (3 connections now open)
Tue Aug 30 12:31:36.534 [initandlisten] connection accepted from 127.0.0.1:44106 #14 (4 connections now open)
Tue Aug 30 12:31:36.536 [initandlisten] connection accepted from 127.0.0.1:44107 #15 (5 connections now open)
Tue Aug 30 12:32:47.309 [conn15] query adapt-tenant-master.roles query: { name: "Authenticated User" } ntoreturn:1 ntoskip:0 nscanned:1 keyUpdates:0 locks(micros) r:316322 nreturned:1 reslen:746 338ms
Tue Aug 30 12:32:47.326 [conn13] query adapt-tenant-master.roles query: { name: "Super Admin" } ntoreturn:1 ntoskip:0 nscanned:1 keyUpdates:0 locks(micros) r:363294 nreturned:1 reslen:260 378ms
Tue Aug 30 12:32:47.337 [conn11] query adapt-tenant-master.roles query: { name: "Course Creator" } ntoreturn:1 ntoskip:0 nscanned:1 keyUpdates:0 locks(micros) r:312466 nreturned:1 reslen:1880 312ms
Tue Aug 30 12:32:47.410 [conn12] query adapt-tenant-master.roles query: { name: "Product Manager" } ntoreturn:1 ntoskip:0 nscanned:1 keyUpdates:0 locks(micros) r:300762 nreturned:1 reslen:287 300ms
Tue Aug 30 12:32:52.396 [conn12] update adapt-tenant-master.roles query: { _id: ObjectId('57c55d921f4561383add585f'), __v: 1 } update: { $set: { statement: [ { effect: "allow", action: [ "create" ], resource: "urn:x-adapt:{{tenantid}}/api/content/*", condition: {} }, { effect: "allow", action: [ "create", "read" ], resource: "urn:x-adapt:{{tenantid}}/api/shared/*", condition: {} }, { effect: "allow", action: [ "create", "read" ], resource: "urn:x-adapt:{{tenantid}}/api/subscribed/*", condition: {} }, { effect: "allow", action: [ "create", "read", "update" ], resource: "urn:x-adapt:{{tenantid}}/api/asset/*", condition: {} }, { effect: "allow", action: [ "read", "update" ], resource: "urn:x-adapt:{{tenantid}}/api/user/me", condition: {} }, { effect: "allow", action: [ "read" ], resource: "urn:x-adapt:{{tenantid}}/api/output/*", condition: {} }, { effect: "allow", action: [ "read" ], resource: "urn:x-adapt:{{tenantid}}/api/extensiontype/*", condition: {} }, { effect: "allow", action: [ "read" ], resource: "urn:x-adapt:{{tenantid}}/api/componenttype/*", condition: {} }, { effect: "allow", action: [ "update", "read" ], resource: "urn:x-adapt:{{tenantid}}/api/themetype/*", condition: {} }, { effect: "allow", action: [ "update", "read" ], resource: "urn:x-adapt:{{tenantid}}/api/menutype/*", condition: {} }, { effect: "allow", action: [ "create", "update", "read" ], resource: "urn:x-adapt:{{tenantid}}/api/theme/*", condition: {} }, { effect: "allow", action: [ "create", "update", "read" ], resource: "urn:x-adapt:{{tenantid}}/api/menu/*", condition: {} }, { effect: "allow", action: [ "create", "update", "read" ], resource: "urn:x-adapt:{{tenantid}}/api/extension/*", condition: {} } ], version: "0.0.1" }, $inc: { __v: 1 } } nscanned:1 nupdated:1 fastmod:1 keyUpdates:0 locks(micros) w:453005 572ms
Tue Aug 30 13:45:02.915 [PeriodicTask::Runner] task: WriteBackManager::cleaner took: 74ms
Tue Aug 30 14:03:03.042 [PeriodicTask::Runner] task: DBConnectionPool-cleaner took: 4ms
Tue Aug 30 14:44:03.185 [PeriodicTask::Runner] task: WriteBackManager::cleaner took: 5ms
Tue Aug 30 15:08:00.170 [TTLMonitor] query local.system.indexes query: { expireAfterSeconds: { $exists: true } } ntoreturn:0 ntoskip:0 nscanned:0 keyUpdates:0 locks(micros) r:179733 nreturned:0 reslen:20 178ms
Tue Aug 30 15:23:03.324 [PeriodicTask::Runner] task: DBConnectionPool-cleaner took: 6ms
Tue Aug 30 17:00:03.551 [PeriodicTask::Runner] task: WriteBackManager::cleaner took: 5ms
Tue Aug 30 17:16:03.654 [PeriodicTask::Runner] task: DBConnectionPool-cleaner took: 8ms
Tue Aug 30 20:21:04.184 [PeriodicTask::Runner] task: WriteBackManager::cleaner took: 9ms
Tue Aug 30 20:57:04.312 [PeriodicTask::Runner] task: WriteBackManager::cleaner took: 7ms
Tue Aug 30 21:17:26.056 [conn15] update adapt-tenant-master.sessions query: { _id: "sLBPfO0X_102G7WGGsK_TA5lbBFvQWTE" } update: { _id: "sLBPfO0X_102G7WGGsK_TA5lbBFvQWTE", session: "{"cookie":{"originalMaxAge":null,"expires":null,"httpOnly":true,"path":"/"},"passport":{}}", expires: new Date(1473801445437) } idhack:1 nupdated:1 upsert:1 keyUpdates:0 locks(micros) w:95517 114ms
Tue Aug 30 21:17:27.365 [conn15] query adapt-tenant-master.sessions query: { _id: "sLBPfO0X_102G7WGGsK_TA5lbBFvQWTE", $or: [ { expires: { $exists: false } }, { expires: { $gt: new Date(1472591847168) } } ] } ntoreturn:1 ntoskip:0 nscanned:3 keyUpdates:0 locks(micros) r:170461 nreturned:1 reslen:188 170ms
Tue Aug 30 21:17:27.368 [conn13] query adapt-tenant-master.sessions query: { _id: "sLBPfO0X_102G7WGGsK_TA5lbBFvQWTE", $or: [ { expires: { $exists: false } }, { expires: { $gt: new Date(1472591847122) } } ] } ntoreturn:1 ntoskip:0 nscanned:3 keyUpdates:0 locks(micros) r:184140 nreturned:1 reslen:188 184ms
Tue Aug 30 21:17:27.386 [conn11] query adapt-tenant-master.sessions query: { _id: "sLBPfO0X_102G7WGGsK_TA5lbBFvQWTE", $or: [ { expires: { $exists: false } }, { expires: { $gt: new Date(1472591847186) } } ] } ntoreturn:1 ntoskip:0 nscanned:3 keyUpdates:0 locks(micros) r:152226 nreturned:1 reslen:188 152ms
Tue Aug 30 21:17:27.368 [conn14] query adapt-tenant-master.sessions query: { _id: "sLBPfO0X_102G7WGGsK_TA5lbBFvQWTE", $or: [ { expires: { $exists: false } }, { expires: { $gt: new Date(1472591847137) } } ] } ntoreturn:1 ntoskip:0 nscanned:3 keyUpdates:0 locks(micros) r:202781 nreturned:1 reslen:188 202ms
Tue Aug 30 21:28:04.429 [PeriodicTask::Runner] task: WriteBackManager::cleaner took: 7ms
Tue Aug 30 21:45:19.915 [TTLMonitor] query local.system.indexes query: { expireAfterSeconds: { $exists: true } } ntoreturn:0 ntoskip:0 nscanned:0 keyUpdates:0 locks(micros) r:118588 nreturned:0 reslen:20 119ms
Tue Aug 30 22:31:04.632 [PeriodicTask::Runner] task: WriteBackManager::cleaner took: 7ms
Tue Aug 30 22:47:04.689 [PeriodicTask::Runner] task: DBConnectionPool-cleaner took: 4ms
Tue Aug 30 23:09:04.769 [PeriodicTask::Runner] task: DBConnectionPool-cleaner took: 9ms

my  / directory:

drwxr-xr-x  1 vagrant vagrant       4096 Aug 30 08:59 vagrant/

vagrant@vagrant-ubuntu-trusty-32:/$ cd vagrant/
vagrant@vagrant-ubuntu-trusty-32:/vagrant$
vagrant@vagrant-ubuntu-trusty-32:/vagrant$
vagrant@vagrant-ubuntu-trusty-32:/vagrant$ ll
total 3964
drwxr-xr-x  1 vagrant vagrant    4096 Aug 30 08:59 ./
drwxr-xr-x 22 root    root       4096 Aug 30 04:35 ../
drwxr-xr-x  1 vagrant vagrant    4096 Aug 30 06:12 adapt_framework/
-rw-r--r--  1 vagrant vagrant   10325 Aug 25 21:54 CHANGELOG.md
drwxr-xr-x  1 vagrant vagrant    4096 Aug 30 22:47 conf/
-rw-r--r--  1 vagrant vagrant    1946 Aug 25 21:54 config.js
-rw-r--r--  1 vagrant vagrant    2514 Aug 25 21:54 CONTRIBUTING.md
-rw-r--r--  1 vagrant vagrant 3811984 Aug 30 12:23 debug_log_20160830
-rw-r--r--  1 vagrant vagrant     200 Aug 25 21:54 .editorconfig
-rw-r--r--  1 vagrant vagrant     367 Aug 30 10:18 .env
drwxr-xr-x  1 vagrant vagrant    4096 Aug 25 21:54 frontend/
drwxr-xr-x  1 vagrant vagrant    4096 Aug 30 12:27 .git/
-rw-r--r--  1 vagrant vagrant     736 Aug 25 21:54 .gitignore
-rw-r--r--  1 vagrant vagrant   10413 Aug 25 21:54 Gruntfile.js
-rw-r--r--  1 vagrant vagrant     154 Aug 25 21:54 index.js
-rw-r--r--  1 vagrant vagrant   16991 Aug 25 21:54 install.js
-rw-r--r--  1 vagrant vagrant    5118 Aug 25 21:54 INSTALL.md
-rw-r--r--  1 vagrant vagrant    1062 Aug 25 21:54 .jscsrc
drwxr-xr-x  1 vagrant vagrant    4096 Aug 25 21:54 lib/
-rw-r--r--  1 vagrant vagrant   35140 Aug 25 21:54 LICENSE
-rw-r--r--  1 vagrant vagrant     233 Aug 25 21:54 log_defaults.sh
-rw-r--r--  1 vagrant vagrant     921 Aug 25 21:54 Makefile
-rw-r--r--  1 vagrant vagrant       0 Aug 25 21:54 metadata.rb
drwxr-xr-x  1 vagrant vagrant    4096 Aug 30 05:17 node_modules/
-rw-r--r--  1 vagrant vagrant    3453 Aug 25 21:54 package.json
drwxr-xr-x  1 vagrant vagrant    4096 Aug 25 21:54 plugins/
-rw-r--r--  1 vagrant vagrant     103 Aug 25 21:54 pm2_start.sh
-rw-r--r--  1 vagrant vagrant     108 Aug 25 21:54 pm2_start_win.sh
-rw-r--r--  1 vagrant vagrant     257 Aug 25 21:54 processes.json
-rw-r--r--  1 vagrant vagrant      19 Aug 25 21:54 Procfile
-rw-r--r--  1 vagrant vagrant    2802 Aug 25 21:54 README.md
drwxr-xr-x  1 vagrant vagrant    4096 Aug 25 21:54 routes/
-rw-r--r--  1 vagrant vagrant     157 Aug 25 21:54 server.js
drwxr-xr-x  1 vagrant vagrant    4096 Aug 30 08:59 temp/
drwxr-xr-x  1 vagrant vagrant    4096 Aug 25 21:54 test/
drwxr-xr-x  1 vagrant vagrant    4096 Aug 25 21:54 test_frontend/
-rw-r--r--  1 vagrant vagrant     623 Aug 25 21:54 .travis.yml
-rw-r--r--  1 vagrant vagrant   10526 Aug 25 21:54 upgrade.js
drwxr-xr-x  1 vagrant vagrant    4096 Aug 25 21:59 .vagrant/
-rw-r--r--  1 vagrant vagrant    1565 Aug 25 21:54 Vagrantfile
-rw-r--r--  1 vagrant vagrant    1357 Aug 25 21:54 vagrant_setup.sh
-rw-r--r--  1 vagrant vagrant    1645 Aug 25 21:54 vagrant_setup_win.sh
-rw-r--r--  1 vagrant vagrant      69 Aug 30 12:12 version.json

my config file:

vagrant@vagrant-ubuntu-trusty-32:/vagrant/conf$ ll
total 16
drwxr-xr-x 1 vagrant vagrant 4096 Aug 30 22:47 ./
drwxr-xr-x 1 vagrant vagrant 4096 Aug 30 08:59 ../
-rw-r--r-- 1 vagrant vagrant  534 Aug 30 10:39 config.json
-rw-r--r-- 1 vagrant vagrant  330 Aug 25 21:54 config-sample.json

vagrant@vagrant-ubuntu-trusty-32:/vagrant/conf$ cat config.json
{
  "root": "/vagrant",
  "serverPort": 5000,
  "serverName": "localhost",
  "dbHost": "localhost",
  "dbName": "adapt-tenant-master",
  "dbPort": 27017,
  "dataRoot": "data",
  "sessionSecret": "your-session-secret",
  "useffmpeg": "Y",
  "smtpService": "dummy",
  "smtpUsername": "smtpUser",
  "smtpPassword": "smtpPass",
  "fromAddress": "you@example.com",
  "outputPlugin": "adapt",
  "dbType": "mongoose",
  "auth": "local",
  "masterTenantName": "master",
  "masterTenantID": "123123********123123",
  "isProduction": true

my pm2 info:

vagrant@vagrant-ubuntu-trusty-32:/vagrant$ pm2 list

│ App name │ id │ mode │ pid   │ status │ restart │ uptime │ memory      │ watching │

│ adapt    │ 0  │ fork │ 17126 │ online │ 0       │ 10h    │ 51.215 MB   │  enabled │

vagrant@vagrant-ubuntu-trusty-32:/vagrant$ pm2 show adapt
 Describing process with id 0 - name adapt
┌───────────────────┬───────────────────────────────────────────â”
│ status            │ online                                    │
│ name              │ adapt                                     │
│ restarts          │ 0                                         │
│ uptime            │ 10h                                       │
│ script path       │ /vagrant/server.js                        │
│ script args       │ N/A                                       │
│ error log path    │ /home/vagrant/.pm2/logs/adapt-error-0.log │
│ out log path      │ /home/vagrant/.pm2/logs/adapt-out-0.log   │
│ pid path          │ /home/vagrant/.pm2/pids/adapt-0.pid       │
│ interpreter       │ node                                      │
│ interpreter args  │ N/A                                       │
│ script id         │ 0                                         │
│ exec cwd          │ /vagrant                                  │
│ exec mode         │ fork_mode                                 │
│ node.js version   │ 4.5.0                                     │
│ watch & reload    │ ✔                                         │
│ unstable restarts │ 0                                         │
│ created at        │ 2016-08-30T12:22:54.987Z                  │

 Code metrics value
│ Loop delay │ 17.65ms │

-----------------------------------------------------------

I try turn on pm2 log and restart the login page, but get nothing:

vagrant@vagrant-ubuntu-trusty-32:/vagrant$ pm2 logs adapt


[PM2] Tailing last 20 lines for [adapt] process

adapt-0 (out): info: [30 Aug 2016 12:29:48 +00:00] configuration loaded from /vagrant/conf/config.json
adapt-0 (out): info: [30 Aug 2016 12:29:50 +00:00] Supporting the following authentication types:
adapt-0 (out): info: [30 Aug 2016 12:29:50 +00:00] - local
adapt-0 (out): info: [30 Aug 2016 12:30:22 +00:00] Adapt authoring tool v0.2.1
adapt-0 (out): info: [30 Aug 2016 12:30:22 +00:00] Adapt Framework v2.0.12
adapt-0 (out): info: [30 Aug 2016 12:31:36 +00:00] Connection established: adapt-tenant-master
adapt-0 (out): info: [30 Aug 2016 12:32:44 +00:00] Server started listening on port 5000

[PM2] Streaming realtime logs for [adapt] process
-----------------------------------

And at login page I still get same error:

Error: Script error for: adaptbuilder/js/origin.js?20160830232016589
http://requirejs.org/docs/errors.html#scripterror

------------------------------------------------------------

At centos 7, firewall has been turn off and SELinux is disabled

[root@centos7~]# iptables -nL
Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

 

[root@centos7 ~]# setenforce 0
setenforce: SELinux is disabled

[root@centos7~]# netstat -tulnp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:5000            0.0.0.0:*               LISTEN      14810/VBoxHeadless
tcp        0      0 127.0.0.1:2222          0.0.0.0:*               LISTEN      14810/VBoxHeadless
tcp        0      0 0.0.0.0:27027           0.0.0.0:*               LISTEN      14810/VBoxHeadless
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      3699/sshd
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      1396/master
tcp        0      0 0.0.0.0:5858            0.0.0.0:*               LISTEN      14810/VBoxHeadless
tcp6       0      0 :::22                   :::*                    LISTEN      3699/sshd
tcp6       0      0 ::1:25                  :::*                    LISTEN      1396/master
udp        0      0 0.0.0.0:45197           0.0.0.0:*                           1006/dhclient
udp        0      0 0.0.0.0:68              0.0.0.0:*                           1006/dhclient
udp        0      0 192.168.1.1:123      0.0.0.0:*                           429/ntpd
udp        0      0 127.0.0.1:123           0.0.0.0:*                           429/ntpd
udp        0      0 0.0.0.0:123             0.0.0.0:*                           429/ntpd

Can anyone help me with that? Thanks