Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError displaying Network details #17

Closed
mcondarelli opened this issue Mar 8, 2019 · 3 comments
Closed

TypeError displaying Network details #17

mcondarelli opened this issue Mar 8, 2019 · 3 comments
Assignees

Comments

@mcondarelli
Copy link

Hi,
trying to access network details (e.g.: https://zt1:3001/controller/network/7122698ebdeb0534) I consistently get the following error:

TypeError: /home/mcon/Projects/ztncui/src/views/controller_layout.pug:21
    19|       .collapse.navbar-collapse(id='BarNav')
    20|         ul.nav.navbar-nav
  > 21|           li(class=(nav.active === 'controller_home'? 'active' : ''))
    22|             a(href='/controller') Home
    23|           li(class=(nav.active === 'users'? 'active' : ''))
    24|             a(href='/users') Users

Cannot read property 'active' of undefined
    at eval (eval at wrap (/home/mcon/Projects/ztncui/src/node_modules/pug-runtime/wrap.js:6:10), <anonymous>:53:73)
    at template (eval at wrap (/home/mcon/Projects/ztncui/src/node_modules/pug-runtime/wrap.js:6:10), <anonymous>:104:225)
    at Object.exports.renderFile (/home/mcon/Projects/ztncui/src/node_modules/pug/lib/index.js:427:38)
    at Object.exports.renderFile (/home/mcon/Projects/ztncui/src/node_modules/pug/lib/index.js:417:21)
    at View.exports.__express [as engine] (/home/mcon/Projects/ztncui/src/node_modules/pug/lib/index.js:464:11)
    at View.render (/home/mcon/Projects/ztncui/src/node_modules/express/lib/view.js:135:8)
    at tryRender (/home/mcon/Projects/ztncui/src/node_modules/express/lib/application.js:640:10)
    at Function.render (/home/mcon/Projects/ztncui/src/node_modules/express/lib/application.js:592:3)
    at ServerResponse.render (/home/mcon/Projects/ztncui/src/node_modules/express/lib/response.js:1008:7)
    at /home/mcon/Projects/ztncui/src/app.js:73:7

my javascript proficiency is way too low to attempt fixing, but I'm available for further testing, if directed.

If it matters: I am testing on a headless VirtualBox machine (Linux zt1 4.9.0-8-amd64 #1 SMP Debian 4.9.144-3.1 (2019-02-19) x86_64 GNU/Linux) with self-signed certificates (for testing) and accessing it over local LAN (actually from VBox host) with https://.

TiA!

@key-networks key-networks self-assigned this Mar 9, 2019
@key-networks
Copy link
Owner

Hi, it looks much like this issue... have you followed this ticket?
#7

@mcondarelli
Copy link
Author

Hi,
I had seen that, but:

  • I am not using docker at all.
  • I am using a plain headless VirtualBox debian client (Linux host).
  • Debian VM has bridged networking,
  • There is no reverse proxy; I connect directly to the exposed port (3001).
  • I am installing both Zerotier and ztncui from sources (github master).
  • The error is present every time I access Network details.
  • I also tried creating a new network and immediately thereafter to click on "detail"; same result.
  • I am accessing ztncui from the VM host, sitting on the same bridged net.
  • I can access ZT1 controller with no problem from local machine (this is exactly the same path displayed by fault page https://zt1:3001/controller/network/7122698ebdeb0534:
mcon@zt1:~$ curl -H "X-ZT1-Auth:$(sudo cat /var/lib/zerotier-one/authtoken.secret)" http://localhost:9993/controller/network/7122698ebdeb0534
{
 "authTokens": [
  null
 ],
 "capabilities": [],
 "creationTime": 1551951576417,
 "enableBroadcast": true,
 "id": "7122698ebdeb0534",
 "ipAssignmentPools": [
  {
   "ipRangeEnd": "192.168.200.253",
   "ipRangeStart": "192.168.200.2"
  }
 ],
 "mtu": 2800,
 "multicastLimit": 32,
 "name": "TestNet",
 "nwid": "7122698ebdeb0534",
 "objtype": "network",
 "private": true,
 "remoteTraceLevel": 0,
 "remoteTraceTarget": null,
 "revision": 5,
 "routes": [
  {
   "target": "192.168.200.0/24",
   "via": null
  }
 ],
 "rules": [
  {
   "type": "ACTION_ACCEPT"
  }
 ],
 "tags": [],
 "v4AssignMode": {
  "zt": false
 },
 "v6AssignMode": {
  "6plane": false,
  "rfc4193": false,
  "zt": false
 }
}mcon@zt1:~$ 
  • here is an excerpt of ztncui log:
GET /bscss/bootstrap.min.css 304 2.089 ms - -
GET /stylesheets/style.css 304 3.851 ms - -
GET /bsjs/bootstrap.min.js 304 4.286 ms - -
GET /images/key-logo.svg 304 0.659 ms - -
POST /controller/network/create 302 2.780 ms - 84
GET /controller/networks 200 28.175 ms - 2597
GET /bscss/bootstrap.min.css 304 1.838 ms - -
GET /stylesheets/style.css 304 1.117 ms - -
GET /bsjs/bootstrap.min.js 304 1.844 ms - -
GET /images/key-logo.svg 304 0.419 ms - -
TypeError: /home/mcon/Projects/ztncui/src/views/controller_layout.pug:21
    19|       .collapse.navbar-collapse(id='BarNav')
    20|         ul.nav.navbar-nav
  > 21|           li(class=(nav.active === 'controller_home'? 'active' : ''))
    22|             a(href='/controller') Home
    23|           li(class=(nav.active === 'users'? 'active' : ''))
    24|             a(href='/users') Users

Cannot read property 'active' of undefined
    at eval (eval at wrap (/home/mcon/Projects/ztncui/src/node_modules/pug-runtime/wrap.js:6:10), <anonymous>:53:73)
    at template (eval at wrap (/home/mcon/Projects/ztncui/src/node_modules/pug-runtime/wrap.js:6:10), <anonymous>:104:225)
    at Object.exports.renderFile (/home/mcon/Projects/ztncui/src/node_modules/pug/lib/index.js:427:38)
    at Object.exports.renderFile (/home/mcon/Projects/ztncui/src/node_modules/pug/lib/index.js:417:21)
    at View.exports.__express [as engine] (/home/mcon/Projects/ztncui/src/node_modules/pug/lib/index.js:464:11)
    at View.render (/home/mcon/Projects/ztncui/src/node_modules/express/lib/view.js:135:8)
    at tryRender (/home/mcon/Projects/ztncui/src/node_modules/express/lib/application.js:640:10)
    at Function.render (/home/mcon/Projects/ztncui/src/node_modules/express/lib/application.js:592:3)
    at ServerResponse.render (/home/mcon/Projects/ztncui/src/node_modules/express/lib/response.js:1008:7)
    at /home/mcon/Projects/ztncui/src/app.js:73:7
GET /controller/network/7122698ebd435c70 500 78.539 ms - 2019
  • I also installed elinks locally on VM running ztncui and accessed it locally, with identical results.
  • Of course ZT1 controller won't answer to external address, but locally it seems to work OK.

Are You suggesting I install from .deb?
I did not see any really useful advice in #7
I am available to perform any needed test.

Many Thanks in Advance

@key-networks
Copy link
Owner

Try Zerotier-one 1.2.12 installed as per https://zerotier.com/download.shtml and ztncui installed as per https://key-networks.com/ztncui/#installation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants