thatmattlove / hyperglass

hyperglass is the network looking glass that tries to make the internet better.
https://hyperglass.dev
BSD 3-Clause Clear License
642 stars 99 forks source link

SyntaxError: /tmp/hyperglass_XXX.json: Unexpected end of JSON input #152

Closed ethamitc closed 5 months ago

ethamitc commented 3 years ago

Bug Description

Whenever I try to build the ui with hyperglass build-ui it errors out giving the error SyntaxError: /tmp/hyperglass_XXX.json: Unexpected end of JSON input

Expected behavior

I expect it to build the UI without any issue.

Steps to Reproduce

Local Configurations

devices.yaml

routers:
  - name: rtr.fra.vtr.as211167.net
    address: REDACTED
    network:
      name: production
      display_name: AS211167
    credential:
      username: REDACTED
      password: REDACTED
    port: 22
    nos: vyos
    vrfs:
      - name: global
        default: true
        ipv4:
          source_address: REDACTED

Logs

❌ Error building UI:
Messages:

Errors:
> Build error occurred
SyntaxError: /tmp/hyperglass_7ounc0yp.json: Unexpected end of JSON input
    at parse (<anonymous>)
    at Object.Module._extensions..json (internal/modules/cjs/loader.js:1128:22)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:14)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at require (internal/modules/cjs/helpers.js:92:18)
    at Object.<anonymous> (/usr/local/lib/python3.7/dist-packages/hyperglass/ui/next.config.js:3:16)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)

Possible Solution

Environment

Debian 10 LXC container 2GB/2C

Server

❕ Please copy & paste this table in your bug report:

Metric Value
hyperglass Version 1.0.3
hyperglass Path /etc/hyperglass
Python Version 3.7.3
Platform Info Linux-5.4.119-1-pve-x86_64-with-debian-10.10
CPU Info AMD Ryzen 5 3600 6-Core Processor
Logical Cores 2
Physical Cores 6
Processor Speed 3.6014085GHz
Total Memory 2.15 GB
Memory Utilization 5.2%
Total Disk Space 17.18 GB
Disk Utilization 11.8%

Client

ethamitc commented 3 years ago

Update: I managed to find one of the JSON files and an online validator said its an issue with this line;

"content":"\nhyperglass accepts the following `AS_PATH` regular expression patterns:\n\n| Expression           | Match                                         |\n| :------------------- | :-------------------------------------------- |\n| `_65000$`            | Originated by 65000
              |\n| `^65000_`            | Received from 65000                           |\n| `_65000_`            | Via 65000                                     |\n| `_65000_65001_`      | Via 65000 and 65001                           |\n| `_65000(_.+_)65001$` | Anything from 65001 that passed through 65000 |\n",

image

Full:

{"_HYPERGLASS_CONFIG_": {"debug": true, "developer_mode": true, "primary_asn": "211167", "org_name": "Cyberri Solutions", "site_title": "hyperglass", "site_description": "Cyberri Solutions Network Looking Glass", "site_keywords": ["Cyberri Solutions", "bgp", "communities", "community", "hyperglass", "internet service provider", "ip", "ipv4", "ipv6", "isp", "lg", "looking glass", "network", "peer", "peering", "routing", "transit"], "request_timeout": 90, "google_analytics": null, "cache": {"timeout": 120, "show_text": true}, "messages": {"no_input": "{field} must be specified.", "acl_denied": "{target} is a member of {denied_network}, which is not allowed.", "acl_not_allowed": "{target} is not allowed.", "feature_not_enabled": "{feature} is not enabled.", "invalid_input": "{target} is not a valid {query_type} target.", "invalid_field": "{input} is an invalid {field}.", "general": "Something went wrong.", "request_timeout": "Request timed out.", "connection_error": "Error connecting to {device_name}: {error}", "authentication_error": "Authentication error occurred.", "no_response": "No response.", "vrf_not_associated": "VRF {vrf_name} is not associated with {device_name}.", "vrf_not_found": "VRF {vrf_name} is not defined.", "no_output": "The query completed, but no matching results were found.", "parsing_error": "An error occurred while parsing the query output."}, "web": {"credit": {"enable": true}, "dns_provider": {"name": "cloudflare", "url": "https://cloudflare-dns.com/dns-query"}, "links": [{"title": "PeeringDB", "url": "https://www.peeringdb.com/asn/{primary_asn}", "show_icon": true, "side": "left", "order": 0}], "menus": [{"title": "Terms", "content": "\nBy using {site_title}, you agree to be bound by the following terms of use:\n\nAll queries executed on this page are logged for analysis and troubleshooting. Users are prohibited from automating queries, or attempting to process queries in bulk. This service is provided on a best effort basis, and {org_name} makes no availability or performance warranties or guarantees whatsoever.\n", "side": "left", "order": 0}, {"title": "Help", "content": "\n##### BGP Route\n\nPerforms BGP table lookup based on IPv4/IPv6 prefix.\n\n---\n\n##### BGP Community\n\nPerforms BGP table lookup based on [Extended](https://tools.ietf.org/html/rfc4360) or [Large](https://tools.ietf.org/html/rfc8195) community value.\n\n---\n\n##### BGP AS Path\n\nPerforms BGP table lookup based on `AS_PATH` regular expression.\n\n---\n\n##### Ping\n\nSends 5 ICMP echo requests to the target.\n\n---\n\n##### Traceroute\n\nPerforms UDP Based traceroute to the target.\n\nFor information about how to interpret traceroute results, [click here](https://hyperglass.dev/traceroute_nanog.pdf).\n", "side": "left", "order": 0}], "greeting": {"enable": false, "file": null, "title": "Welcome", "button": "Continue", "required": false}, "logo": {"light": "/usr/local/lib/python3.7/dist-packages/hyperglass/images/hyperglass-light.svg", "dark": "/usr/local/lib/python3.7/dist-packages/hyperglass/images/hyperglass-dark.svg", "favicon": "/usr/local/lib/python3.7/dist-packages/hyperglass/images/hyperglass-icon.svg", "width": "100%", "height": null, "light_format": ".svg", "dark_format": ".svg"}, "opengraph": {"image": "/usr/local/lib/python3.7/dist-packages/hyperglass/images/hyperglass-opengraph.jpg"}, "text": {"title_mode": "logo_only", "title": "hyperglass", "subtitle": "Network Looking Glass", "query_location": "Location", "query_type": "Query Type", "query_target": "Target", "query_vrf": "Routing Table", "fqdn_tooltip": "Use {protocol}", "fqdn_message": "Your browser has resolved {fqdn} to", "fqdn_error": "Unable to resolve {fqdn}", "fqdn_error_button": "Try Again", "cache_prefix": "Results cached for ", "cache_icon": "Cached from {time} UTC", "complete_time": "Completed in {seconds}", "rpki_invalid": "Invalid", "rpki_valid": "Valid", "rpki_unknown": "No ROAs Exist", "rpki_unverified": "Not Verified", "no_communities": "No Communities"}, "theme": {"colors": {"black": "#000", "white": "#fff", "dark": "#010101", "light": "#f5f6f7", "gray": "#c1c7cc", "red": "#d84b4b", "orange": "#ff6b35", "yellow": "#edae49", "green": "#35b246", "blue": "#314cb6", "teal": "#35b299", "cyan": "#118ab2", "pink": "#f2607d", "purple": "#8d30b5", "primary": "#118ab2", "secondary": "#314cb6", "success": "#35b246", "warning": "#edae49", "error": "#ff6b35", "danger": "#d84b4b"}, "default_color_mode": null, "fonts": {"body": "Nunito", "mono": "Fira Code"}}}, "hyperglass_version": "1.0.3", "queries": {"bgp_route": {"name": "bgp_route", "enable": true, "display_name": "BGP Route"}, "bgp_community": {"name": "bgp_community", "enable": true, "display_name": "BGP Community", "mode": "input", "communities": []}, "bgp_aspath": {"name": "bgp_aspath", "enable": true, "display_name": "BGP AS Path"}, "ping": {"name": "ping", "enable": true, "display_name": "Ping"}, "traceroute": {"name": "traceroute", "enable": true, "display_name": "Traceroute"}, "list": [{"name": "bgp_route", "display_name": "BGP Route", "enable": true}, {"name": "bgp_community", "display_name": "BGP Community", "enable": true}, {"name": "bgp_aspath", "display_name": "BGP AS Path", "enable": true}, {"name": "ping", "display_name": "Ping", "enable": true}, {"name": "traceroute", "display_name": "Traceroute", "enable": true}]}, "networks": [{"display_name": "AS211167", "locations": [{"_id": "rtrfravtras211167net", "name": "rtr.fra.vtr.as211167.net", "network": "AS211167", "vrfs": [{"_id": "global", "display_name": "Global", "default": true, "ipv4": true, "ipv6": false}]}]}], "parsed_data_fields": [["Prefix", "prefix", "left"], ["Active", "active", null], ["RPKI State", "rpki_state", "center"], ["AS Path", "as_path", "left"], ["Next Hop", "next_hop", "left"], ["Origin", "source_as", null], ["Weight", "weight", "center"], ["Local Preference", "local_preference", "center"], ["MED", "med", "center"], ["Communities", "communities", "center"], ["Originator", "source_rid", "right"], ["Peer", "peer_rid", "right"], ["Age", "age", "right"]], "content": {"credit": "\nPowered by [**hyperglass**](https://hyperglass.dev) version 1.0.3. Source code licensed [_BSD 3-Clause Clear_](https://hyperglass.dev/docs/license/).\n", "vrf": {"global": {"bgp_route": {"content": "\nPerforms BGP table lookup based on IPv4/IPv6 prefix.\n", "enable": true, "params": {"primary_asn": "211167", "org_name": "Cyberri Solutions", "site_title": "hyperglass", "site_description": "Cyberri Solutions Network Looking Glass", "title": "Global: BGP Route"}}, "bgp_community": {"content": "\nhyperglass makes use of the following BGP communities:\n\n| Community | Description |\n| :-------- | :---------- |\n| `65000:1` | Example 1   |\n| `65000:2` | Example 2   |\n| `65000:3` | Example 3   |\n", "enable": true, "params": {"primary_asn": "211167", "org_name": "Cyberri Solutions", "site_title": "hyperglass", "site_description": "Cyberri Solutions Network Looking Glass", "title": "Global: BGP Community"}}, "bgp_aspath": {"content": "\nhyperglass accepts the following `AS_PATH` regular expression patterns:\n\n| Expression           | Match                                         |\n| :------------------- | :-------------------------------------------- |\n| `_65000$`            | Originated by 65000
              |\n| `^65000_`            | Received from 65000                           |\n| `_65000_`            | Via 65000                                     |\n| `_65000_65001_`      | Via 65000 and 65001                           |\n| `_65000(_.+_)65001$` | Anything from 65001 that passed through 65000 |\n", "enable": true, "params": {"primary_asn": "211167", "org_name": "Cyberri Solutions", "site_title": "hyperglass", "site_description": "Cyberri Solutions Network Looking Glass", "title": "Global: BGP AS Path"}}, "ping": {"content": "\nSends 5 ICMP echo requests to the target.\n", "enable": true, "params": {"primary_asn": "211167", "org_name": "Cyberri Solutions", "site_title": "hyperglass", "site_description": "Cyberri Solutions Network Looking Glass", "title": "Global: Ping"}}, "traceroute": {"content": "\nPerforms UDP Based traceroute to the target. For information about how to interpret traceroute results, [click here](https://hyperglass.dev/traceroute_nanog.pdf).\n", "enable": true, "params": {"primary_asn": "211167", "org_name": "Cyberri Solutions", "site_title": "hyperglass", "site_description": "Cyberri Solutions Network Looking Glass", "title": "Global: Traceroute"}}}}, "greeting": ""}}, "_HYPERGLASS_VERSION_": "1.0.3", "_HYPERGLASS_PACKAGE_JSON_": {"name": "ui", "version": "1.0.0", "description": "UI for hyperglass, the modern network looking glass", "author": "Matt Love", "license": "BSD-3-Clause-Clear", "private": true, "scripts": {"lint": "eslint . --ext .ts --ext .tsx", "dev": "node nextdev", "start": "next start", "typecheck": "tsc --noEmit", "format": "prettier -c .", "clean": "rimraf --no-glob ./.next ./out", "check:es:export": "es-check es5 './out/**/*.js' -v", "check:es:build": "es-check es5 './.next/static/**/*.js' -v", "build": "next build && next export -o ../hyperglass/static/ui"}, "browserslist": "> 0.25%, not dead", "dependencies": {"@chakra-ui/react": "^1.6.3", "@emotion/react": "^11.4.0", "@emotion/styled": "^11.3.0", "@hookform/devtools": "^3.1.0", "@hookform/resolvers": "^2.5.1", "@hookstate/core": "^3.0.7", "@hookstate/persistence": "^3.0.0", "@meronex/icons": "^4.0.0", "dagre": "^0.8.5", "dayjs": "^1.10.4", "framer-motion": "^4.1.17", "lodash": "^4.17.21", "next": "^10.2.3", "palette-by-numbers": "^0.1.5", "react": "^17.0.2", "react-countdown": "^2.2.1", "react-device-detect": "^1.15.0", "react-dom": "^17.0.2", "react-fast-compare": "^3.2.0", "react-flow-renderer": "^9.6.0", "react-ga": "^3.3.0", "react-hook-form": "^7.7.0", "react-markdown": "^5.0.3", "react-query": "^3.16.0", "react-select": "^4.3.1", "react-table": "^7.7.0", "remark-gfm": "^1.0.0", "string-format": "^2.0.0", "vest": "^3.2.3"}, "devDependencies": {"@hookstate/devtools": "^3.0.0", "@types/dagre": "^0.7.44", "@types/node": "^14.14.41", "@types/react": "^17.0.3", "@types/react-select": "^4.0.15", "@types/react-table": "^7.7.1", "@types/string-format": "^2.0.0", "@typescript-eslint/eslint-plugin": "^4.11.1", "@typescript-eslint/parser": "^4.11.1", "@upstatement/eslint-config": "^0.4.3", "@upstatement/prettier-config": "^0.3.0", "babel-eslint": "^10.1.0", "eslint": "^6.8.0", "eslint-config-prettier": "^7.1.0", "eslint-config-react-app": "^5.2.0", "eslint-import-resolver-typescript": "^2.3.0", "eslint-plugin-import": "^2.22.1", "eslint-plugin-jest": "^24.1.3", "eslint-plugin-json": "^2.1.2", "eslint-plugin-jsx-a11y": "^6.2.3", "eslint-plugin-prettier": "^3.3.0", "eslint-plugin-react": "^7.22.0", "eslint-plugin-react-hooks": "^4.2.0", "express": "^4.17.1", "http-proxy-middleware": "0.20.0", "onchange": "^7.1.0", "prettier": "^2.2.1", "prettier-eslint": "^12.0.0", "typescript": "^4.3.2"}}, "_HYPERGLASS_APP_PATH_": "/etc/hyperglass", "NODE_ENV": "development", "_HYPERGLASS_URL_": "http://localhost:8001/", "_HYPERGLASS_FAVICONS_": [{"image_format": "ico", "dimensions": [64, 64], "prefix": "favicon", "rel": null}, {"image_format": "png", "dimensions": [16, 16], "prefix": "favicon", "rel": "icon"}, {"image_format": "png", "dimensions": [32, 32], "prefix": "favicon", "rel": "icon"}, {"image_format": "png", "dimensions": [64, 64], "prefix": "favicon", "rel": "icon"}, {"image_format": "png", "dimensions": [96, 96], "prefix": "favicon", "rel": "icon"}, {"image_format": "png", "dimensions": [180, 180], "prefix": "favicon", "rel": "icon"}, {"image_format": "png", "dimensions": [57, 57], "prefix": "apple-touch-icon", "rel": "apple-touch-icon"}, {"image_format": "png", "dimensions": [60, 60], "prefix": "apple-touch-icon", "rel": "apple-touch-icon"}, {"image_format": "png", "dimensions": [72, 72], "prefix": "apple-touch-icon", "rel": "apple-touch-icon"}, {"image_format": "png", "dimensions": [76, 76], "prefix": "apple-touch-icon", "rel": "apple-touch-icon"}, {"image_format": "png", "dimensions": [114, 114], "prefix": "apple-touch-icon", "rel": "apple-touch-icon"}, {"image_format": "png", "dimensions": [120, 120], "prefix": "apple-touch-icon", "rel": "apple-touch-icon"}, {"image_format": "png", "dimensions": [144, 144], "prefix": "apple-touch-icon", "rel": "apple-touch-icon"}, {"image_format": "png", "dimensions": [152, 152], "prefix": "apple-touch-icon", "rel": "apple-touch-icon"}, {"image_format": "png", "dimensions": [167, 167], "prefix": "apple-touch-icon", "rel": "apple-touch-icon"}, {"image_format": "png", "dimensions": [180, 180], "prefix": "apple-touch-icon", "rel": "apple-touch-icon"}, {"image_format": "png", "dimensions": [70, 70], "prefix": "mstile", "rel": null}, {"image_format": "png", "dimensions": [270, 270], "prefix": "mstile", "rel": null}, {"image_format": "png", "dimensions": [310, 310], "prefix": "mstile", "rel": null}, {"image_format": "png", "dimensions": [310, 150], "prefix": "mstile", "rel": null}, {"image_format": "png", "dimensions": [196, 196], "prefix": "favicon", "rel": "shortcut icon"}]}
thatmattlove commented 3 years ago

Hi,

I can't seem to reproduce this issue locally, and if this was something in the hyperglass code I'm fairly certain CI builds would fail and they're not. I'm curious, what version of Node are you running? You can find it by running node --version.

ethamitc commented 3 years ago

Hi,

I can't seem to reproduce this issue locally, and if this was something in the hyperglass code I'm fairly certain CI builds would fail and they're not. I'm curious, what version of Node are you running? You can find it by running node --version.

I'm running Node v14.17.2.

ethamitc commented 3 years ago

Update: I did a full reinstall of the system and I'm still having the exact same issue. hyperglass build-ui Logs: https://termbin.com/82uw /tmp/hyperglass_9j4na9rp.json: https://termbin.com/9jqx

System info: Metric Value
hyperglass Version 1.0.4
hyperglass Path /root/hyperglass
Python Version 3.7.3
Node Version 14.17.2
Platform Info Linux-5.4.119-1-pve-x86_64-with-debian-10.10
CPU Info AMD Ryzen 5 3600 6-Core Processor
Logical Cores 2
Physical Cores 6
Processor Speed 3.5745385GHz
Total Memory 2.15 GB
Memory Utilization 4.9%
Total Disk Space 17.18 GB
Disk Utilization 10.4%
thatmattlove commented 3 years ago

I just did a fresh install of a Debian 10.10 VM and followed the manual installation process (not the automatic). I assigned the VM 2GB RAM initially, but when running hyperglass build-ui for the first time received some interesting Node-related errors. Not the same errors as yours, but here they are nonetheless:

[ERROR] 20210704 15:47:25 | hyperglass.util.frontend:157 | build_ui →
Messages:
info  - Using webpack 5. Reason: future.webpack5 option enabled https://nextjs.org/docs/messages/webpack5
Attention: Next.js now collects completely anonymous telemetry regarding usage.
This information is used to shape Next.js' roadmap and prioritize features.
You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
https://nextjs.org/telemetry

info  - Checking validity of types...
info  - Creating an optimized production build...
Errors:
<--- Last few GCs --->

[14030:0x4eb88c0]    75671 ms: Mark-sweep (reduce) 978.4 (987.4) -> 977.3 (989.2) MB, 1315.4 / 0.0 ms  (average mu = 0.229, current mu = 0.204) allocation failure scavenge might not succeed
[14030:0x4eb88c0]    77226 ms: Mark-sweep (reduce) 978.4 (990.7) -> 977.8 (991.2) MB, 1487.6 / 0.0 ms  (average mu = 0.141, current mu = 0.044) allocation failure scavenge might not succeed

<--- JS stacktrace --->

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
 1: 0xa24ed0 node::Abort() [node]
 2: 0x966115 node::FatalError(char const*, char const*) [node]
 3: 0xb9acde v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]
 4: 0xb9b057 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]
 5: 0xd56ea5  [node]
 6: 0xd57a2f  [node]
 7: 0xd65abb v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
 8: 0xd6967c v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]
 9: 0xd37d2b v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType, v8::internal::AllocationOrigin) [node]
10: 0x108035f v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [node]
11: 0x1427079  [node]
Aborted
[ERROR] 20210704 15:47:25 | hyperglass.util.frontend:401 | build_frontend →
Messages:
info  - Using webpack 5. Reason: future.webpack5 option enabled https://nextjs.org/docs/messages/webpack5
Attention: Next.js now collects completely anonymous telemetry regarding usage.
This information is used to shape Next.js' roadmap and prioritize features.
You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
https://nextjs.org/telemetry

info  - Checking validity of types...
info  - Creating an optimized production build...
Errors:
<--- Last few GCs --->

[14030:0x4eb88c0]    75671 ms: Mark-sweep (reduce) 978.4 (987.4) -> 977.3 (989.2) MB, 1315.4 / 0.0 ms  (average mu = 0.229, current mu = 0.204) allocation failure scavenge might not succeed
[14030:0x4eb88c0]    77226 ms: Mark-sweep (reduce) 978.4 (990.7) -> 977.8 (991.2) MB, 1487.6 / 0.0 ms  (average mu = 0.141, current mu = 0.044) allocation failure scavenge might not succeed

<--- JS stacktrace --->

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
 1: 0xa24ed0 node::Abort() [node]
 2: 0x966115 node::FatalError(char const*, char const*) [node]
 3: 0xb9acde v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]
 4: 0xb9b057 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]
 5: 0xd56ea5  [node]
 6: 0xd57a2f  [node]
 7: 0xd65abb v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
 8: 0xd6967c v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]
 9: 0xd37d2b v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType, v8::internal::AllocationOrigin) [node]
10: 0x108035f v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [node]
11: 0x1427079  [node]
Aborted
❌ Error building UI:
Messages:
info  - Using webpack 5. Reason: future.webpack5 option enabled https://nextjs.org/docs/messages/webpack5
Attention: Next.js now collects completely anonymous telemetry regarding usage.
This information is used to shape Next.js' roadmap and prioritize features.
You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
https://nextjs.org/telemetry

info  - Checking validity of types...
info  - Creating an optimized production build...
Errors:
<--- Last few GCs --->

[14030:0x4eb88c0]    75671 ms: Mark-sweep (reduce) 978.4 (987.4) -> 977.3 (989.2) MB, 1315.4 / 0.0 ms  (average mu = 0.229, current mu = 0.204) allocation failure scavenge might not succeed
[14030:0x4eb88c0]    77226 ms: Mark-sweep (reduce) 978.4 (990.7) -> 977.8 (991.2) MB, 1487.6 / 0.0 ms  (average mu = 0.141, current mu = 0.044) allocation failure scavenge might not succeed

<--- JS stacktrace --->

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
 1: 0xa24ed0 node::Abort() [node]
 2: 0x966115 node::FatalError(char const*, char const*) [node]
 3: 0xb9acde v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]
 4: 0xb9b057 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]
 5: 0xd56ea5  [node]
 6: 0xd57a2f  [node]
 7: 0xd65abb v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
 8: 0xd6967c v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]
 9: 0xd37d2b v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType, v8::internal::AllocationOrigin) [node]
10: 0x108035f v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [node]
11: 0x1427079  [node]
Aborted

Since these errors pointed to a memory issue, I increased the VM's RAM to 4GB, ran hyperglass build-ui again and the UI built successfully. Also ran hyperglass start and saw hyperglass start up properly (and verified I could see the UI).

Other than your environment running in an LXC, I'm not sure what else is different here. Even though your errors are not memory related, could you try increasing the RAM to 4GB and try again?

ethamitc commented 3 years ago
@thatmattlove I've bumped the system to 4GB of ram and still no luck. I first saw this issue on vultr aswell so I'm not sure if I'm doing something wrong or what's happening. Metric Value
hyperglass Version 1.0.4
hyperglass Path /root/hyperglass
Python Version 3.7.3
Node Version 14.17.2
Platform Info Linux-5.4.119-1-pve-x86_64-with-debian-10.10
CPU Info AMD Ryzen 5 3600 6-Core Processor
Logical Cores 2
Physical Cores 6
Processor Speed 3.905169GHz
Total Memory 4.31 GB
Memory Utilization 1.4%
Total Disk Space 17.18 GB
Disk Utilization 10.4%
thatmattlove commented 3 years ago

I spent a couple bucks to try this out on Vultr, as it's not the first time I've heard of issues getting hyperglass installed on their platform. Unfortunately, the results were the same as my local VM testing. I did have to upgrade RAM to 4GB for the same reason as I posted above, but after doing so hyperglass build-ui ran successfully as did hyperglass start. Here's my hyperglass system-info output:

Metric Value
hyperglass Version 1.0.4
hyperglass Path /etc/hyperglass
Python Version 3.7.3
Node Version 14.17.2
Platform Info Linux-4.19.0-17-amd64-x86_64-with-debian-10.10
CPU Info Intel Xeon Processor (Cascadelake)
Logical Cores 2
Physical Cores 1
Processor Speed 2.992966GHz
Total Memory 4.14 GB
Memory Utilization 8.9%
Total Disk Space 80.62 GB
Disk Utilization 5.4%

As far as I can tell, the only major difference is AMD vs. Intel, but I don't see why that would matter. Here's one more thing to try out, as a test:

let test = require("<copied hyperglass JSON file>");
console.log(test);

For me, this runs and prints the JSON. But from your errors, I assume you're going to get an error when running that first line. But, I'm curious what you'll see.

ethamitc commented 3 years ago

Hi @thatmattlove, sorry for the long delay ive been on vacation. I return home at the end of this week and will try this.

ethamitc commented 3 years ago

@thatmattlove Here is the output of the above node test. https://hastebin.com/osuxecamad.typescript

edofullin commented 3 years ago

Same issue here, I'm using LXC on Debian 11 as well.

Node 14.17.6

Metric Value
hyperglass Version 1.0.4
hyperglass Path /etc/hyperglass
Python Version 3.9.2
Node Version 14.17.6
Platform Info Linux-5.11.22-3-pve-x86_64-with-glibc2.31
CPU Info Intel(R) Xeon(R) CPU E5-2660 0 @ 2.20GHz
Logical Cores 4
Physical Cores 16
Processor Speed 1.1979597499999999GHz
Total Memory 2.15 GB
Memory Utilization 12.4%
Total Disk Space 21.47 GB
Disk Utilization 8.7%

JSON File: https://hastebin.com/huwedicezu.less

thatmattlove commented 2 years ago

I'm marking this as fixed-in-next-release, as I've completely done away with the /tmp/hyperglass.env.json file/concept in v2.0. I'll leave this open until that release is available, in case others come across the same issue.

ssh-sysadmin commented 2 years ago
Am getting this same issue. Output of /tmp/hyperglass_xxxxxxxx.json using node commands above: https://www.toptal.com/developers/hastebin/ogayakaset.less Metric Value
hyperglass Version 1.0.4
hyperglass Path /etc/hyperglass
Python Version 3.8.10
Node Version 14.19.0
Platform Info Linux-5.4.124-1-pve-x86_64-with-glibc2.29
CPU Info Intel(R) Xeon(R) CPU E5-2690 v2 @ 3.00GHz
Logical Cores 6
Physical Cores 20
Processor Speed 3.006451825GHz
Total Memory 4.29 GB
Memory Utilization 3.6%
Total Disk Space 53.69 GB
Disk Utilization 4.4%

Running in Ubuntu 20.04.3 LXC within Proxmox.