Skip to content
This repository has been archived by the owner on Aug 26, 2021. It is now read-only.

Page not loading, "Oops... Something went wrong" #43

Closed
tscibilia opened this issue Jun 21, 2017 · 7 comments
Closed

Page not loading, "Oops... Something went wrong" #43

tscibilia opened this issue Jun 21, 2017 · 7 comments
Labels

Comments

@tscibilia
Copy link

I appear to be having the same issue (or similar) as the OP (agreenfield1) did here. Any advise or assist based on the data below (PS I aready tried changing the http://es:9200 to the actual ip address but it didn't help?

./ambar.py start

______           ____     ______  ____
/\  _  \  /'\_/`\/\  _`\  /\  _  \/\  _`\
\ \ \L\ \/\      \ \ \L\ \ \ \L\ \ \ \L\ \
 \ \  __ \ \ \__\ \ \  _ <'\ \  __ \ \ ,  /
  \ \ \/\ \ \ \_/\ \ \ \L\ \ \ \/\ \ \ \ \
   \ \_\ \_\ \_\ \_\ \____/ \ \_\ \_\ \_\ \_\
    \/_/\/_/\/_/ \/_/\/___/   \/_/\/_/\/_/\/ /



Docker version 17.03.1-ce, build c6d412e
docker-compose version 1.13.0, build 1719ceb
sysctl: setting key "vm.max_map_count": Read-only file system
net.ipv4.ip_local_port_range = 15000 61000
net.core.somaxconn = 1024
ambar_proxy_1 is up-to-date
ambar_db_1 is up-to-date
Starting ambar_rabbit_1 ...
ambar_es_1 is up-to-date
Starting ambar_rabbit_1
Starting ambar_rabbit_1 ... done
ambar_webapi_1 is up-to-date
ambar_frontend_1 is up-to-date
Waiting for Ambar to start...
Ambar is running on http://192.168.5.122:80

http://192.168.5.122:80/_cat/indices
Just returns a blank page

website console errors

Failed to load resource: the server responded with a status of 502 (Bad Gateway)
     _/api/_
Failed to start. Error: SyntaxError: Unexpected token < in JSON at position 0                
     _app.5800ae896ed146f4e02a.js:3_ 
SyntaxError: Unexpected token < in JSON at position 0
     _app.5800ae896ed146f4e02a.js:3_
Failed to load resource: the server responded with a status of 502 (Bad Gateway)
     _/api/users/check_
js:6 Failed to auth. Error: [object Response]
     _app.5800ae896ed146f4e02a_

docker logs ambar_webapi_1

2017/06/21 02:11:12 Waiting for host:
2017/06/21 02:11:12 Waiting for host: 192.168.5.122:9200
2017/06/21 02:11:12 Connected to unix:///var/run/docker.sock
2017/06/21 02:32:25 Waiting for host:
2017/06/21 02:32:25 Waiting for host: 192.168.5.122:9200
2017/06/21 02:32:25 Connected to unix:///var/run/docker.sock
2017/06/21 02:37:25 Timeout after 5m0s waiting on dependencies to become available: [unix:///var/run/docker.sock http://192.168.5.122:9200]
2017/06/21 02:37:25 Waiting for host:
2017/06/21 02:37:25 Waiting for host: 192.168.5.122:9200
2017/06/21 02:37:25 Connected to unix:///var/run/docker.sock

docker logs ambar_es_1

[2017-06-21T02:50:42,752][INFO ][o.e.n.Node               ] [] initializing ...
[2017-06-21T02:50:42,855][INFO ][o.e.e.NodeEnvironment    ] [Co7MJEJ] using [1] data paths, mounts [[/ (/dev/mapper/pve-vm--210--disk--1)]], net usable_space [7.1gb], net total_space [58.9gb], spins? [possibly], types [ext4]
[2017-06-21T02:50:42,855][INFO ][o.e.e.NodeEnvironment    ] [Co7MJEJ] heap size [989.8mb], compressed ordinary object pointers [true]
[2017-06-21T02:50:42,857][INFO ][o.e.n.Node               ] node name [Co7MJEJ] derived from node ID [Co7MJEJKRxu9qhWVmwm8OQ]; set [node.name] to override
[2017-06-21T02:50:42,857][INFO ][o.e.n.Node               ] version[5.3.2], pid[1], build[3068195/2017-04-24T16:15:59.481Z], OS[Linux/4.4.62-1-pve/amd64], JVM[Oracle Corporation/OpenJDK 64-Bit Server VM/1.8.0_121/25.121-b13]
[2017-06-21T02:50:46,938][INFO ][o.e.p.PluginsService     ] [Co7MJEJ] loaded module [aggs-matrix-stats]
[2017-06-21T02:50:46,940][INFO ][o.e.p.PluginsService     ] [Co7MJEJ] loaded module [ingest-common]
[2017-06-21T02:50:46,940][INFO ][o.e.p.PluginsService     ] [Co7MJEJ] loaded module [lang-expression]
[2017-06-21T02:50:46,940][INFO ][o.e.p.PluginsService     ] [Co7MJEJ] loaded module [lang-groovy]
[2017-06-21T02:50:46,940][INFO ][o.e.p.PluginsService     ] [Co7MJEJ] loaded module [lang-mustache]
[2017-06-21T02:50:46,940][INFO ][o.e.p.PluginsService     ] [Co7MJEJ] loaded module [lang-painless]
[2017-06-21T02:50:46,941][INFO ][o.e.p.PluginsService     ] [Co7MJEJ] loaded module [percolator]
[2017-06-21T02:50:46,941][INFO ][o.e.p.PluginsService     ] [Co7MJEJ] loaded module [reindex]
[2017-06-21T02:50:46,941][INFO ][o.e.p.PluginsService     ] [Co7MJEJ] loaded module [transport-netty3]
[2017-06-21T02:50:46,941][INFO ][o.e.p.PluginsService     ] [Co7MJEJ] loaded module [transport-netty4]
[2017-06-21T02:50:46,954][INFO ][o.e.p.PluginsService     ] [Co7MJEJ] loaded plugin [analysis-morphology]
[2017-06-21T02:50:46,954][INFO ][o.e.p.PluginsService     ] [Co7MJEJ] loaded plugin [analysis-smartcn]
[2017-06-21T02:50:46,955][INFO ][o.e.p.PluginsService     ] [Co7MJEJ] loaded plugin [analysis-stempel]
[2017-06-21T02:50:53,487][INFO ][o.e.n.Node               ] initialized
[2017-06-21T02:50:53,497][INFO ][o.e.n.Node               ] [Co7MJEJ] starting ...
[2017-06-21T02:50:53,741][WARN ][i.n.u.i.MacAddressUtil   ] Failed to find a usable hardware address from the network interfaces; using random bytes: f8:d1:3f:ba:9a:40:6b:8e
[2017-06-21T02:50:53,935][INFO ][o.e.t.TransportService   ] [Co7MJEJ] publish_address {172.18.0.5:9300}, bound_addresses {[::]:9300}
[2017-06-21T02:50:53,946][INFO ][o.e.b.BootstrapChecks    ] [Co7MJEJ] bound or publishing to a non-loopback or non-link-local address, enforcing bootstrap checks
ERROR: bootstrap checks failed
max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
[2017-06-21T02:50:53,982][INFO ][o.e.n.Node               ] [Co7MJEJ] stopping ...
[2017-06-21T02:50:54,789][INFO ][o.e.n.Node               ] [Co7MJEJ] stopped
[2017-06-21T02:50:54,789][INFO ][o.e.n.Node               ] [Co7MJEJ] closing ...
[2017-06-21T02:50:54,805][INFO ][o.e.n.Node               ] [Co7MJEJ] closed

File: config.json

{
    "dataPath": "/opt/ambar",
    "dropbox": {
        "clientId": "",
        "redirectUri": ""
    },
    "es": {
        "containerSize": "2g",
        "heapSize": "1g"
    },
    "ocr": {
        "pdfMaxPageCount": 5000,
        "pdfSymbolsPerPageThreshold": 100
    },
    "dockerComposeTemplate": "https://static.ambar.cloud/docker-compose.template.yml",
    "db": {
        "cacheSizeGb": 2
    },
    "fe": {
        "external": {
            "host": "192.168.5.122",
            "port": "80",
            "protocol": "http"
        }
    },
    "dockerRepo": "ambar",
    "api": {
        "auth": "basic",
        "external": {
            "host": "192.168.5.122",
            "port": "80",
            "protocol": "http"
        },
        "defaultLangAnalyzer": "ambar_en",
        "analyticsToken": "cda4b0bb11a1f32aed7564b08c455992",
        "mode": "ce",
        "crawlerCount": 1,
        "cacheSize": "1g",
        "pipelineCount": 1,
        "showFilePreview": "false"
    }
}

File: docker-compose.yml

version: "2"
networks:
  internal_network:
services:
  webapi:
    restart: always
    networks:
      - internal_network
    image: ambar/ambar-webapi:latest
    expose:
      - "8080"
    environment:
      - db=mongodb://db:27017/ambar_data
      - fe=http://192.168.5.122:80
      - api=http://webapi:8080
      - es=http://192.168.5.122:9200
      - redis=webapi-cache
      - rabbit=amqp://rabbit
      - mode=ce
      - pipelineCount=1
      - crawlerCount=1
      - dropboxClientId=
      - dropboxRedirectUri=
      - defaultLangAnalyzer=ambar_en
      - analyticsToken=cda4b0bb11a1f32aed7564b08c455992
      - auth=basic
      - ocrPdfMaxPageCount=5000
      - ocrPdfSymbolsPerPageThreshold=100
      - showFilePreview=false
    depends_on:
      - db
      - es
      - webapi-cache
      - proxy
      - rabbit
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
  webapi-cache:
    restart: always
    image: redis:alpine   
    networks:
      - internal_network    
    expose:
      - "6379"
    ports:
      - "6379:6379" 
    mem_limit: 1g 
  proxy:
    image: ambar/ambar-proxy:latest
    networks:
      - internal_network
    restart: always
    environment:
      - API_EXT_PORT=80
      - FE_EXT_PORT=80
    expose:
      - 80
      
    ports:
      - "80:80"
      
  frontend:
    image: ambar/ambar-frontend:latest
    networks:
      - internal_network
    depends_on:
      - webapi
    expose:
      - "80"
    restart: always
    environment:
      - api=http://192.168.5.122:80
  db:
    restart: always
    image: ambar/ambar-mongodb:latest
    networks:
      - internal_network
    environment:
      - cacheSizeGB=2
    volumes:
      - /opt/ambar/db:/data/db
    expose:
      - "27017"
    ports:
      - "27017:27017"
  es:
    image: ambar/ambar-es:latest
    networks:
      - internal_network
    restart: always
    expose:
      - "9200"
    ports:
      - "9200:9200"
    environment:
      - cluster.name=ambar-es
      - bootstrap.memory_lock=true
      - xpack.security.enabled=false
      - security.manager.enabled=false
      - "ES_JAVA_OPTS=-Xms1g -Xmx1g"
    ulimits:
      memlock:
        soft: -1
        hard: -1  
      nofile:
        soft: 65536
        hard: 65536
    mem_limit: 2g
    cap_add:
      - IPC_LOCK
    volumes:
      - /opt/ambar/es:/usr/share/elasticsearch/data
  rabbit:
    image: ambar/ambar-rabbit:latest
    networks:
      - internal_network
    hostname: rabbit
    expose:
      - "15672"
      - "5672"
    ports:
      - "15672:15672"
      - "5672:5672"
    volumes:
      - /opt/ambar/rabbit:/var/lib/rabbitmq
@sochix sochix added the bug label Jun 22, 2017
@tscibilia
Copy link
Author

Thanks for looking into this, I must say that I'm the same guy who posted this issue. So just a reminder, I'm running this (Ubuntu 16.04 with 4Gb ram and 60Gb Drive) as an lxc container on proxmox.

@isido993
Copy link
Member

isido993 commented Jul 4, 2017

Hello,

The problem is max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144].

Run sysctl -w vm.max_map_count=262144 before starting Ambar.
Also you can add this into your /etc/sysctl.conf file.

@tscibilia
Copy link
Author

Thanks for that info, I found out that on Proxmox (running LXC containers) this setting needs to be done at the host level (when I did it within the ubuntu container it said read-only).

I'm glad that is resolved but still having trouble starting ambar. Now when I check the docker logs ambar_es_1 it tells me...

[2017-07-05T20:38:10,859][INFO ][o.e.n.Node               ] [] initializing ...
[2017-07-05T20:38:11,004][INFO ][o.e.e.NodeEnvironment    ] [Co7MJEJ] using [1] data paths, mounts [[/ (/dev/mapper/pve-vm--210--disk--1)]], net usable_space [3.3gb], net total_space [62.8gb], spins? [possibly], types [ext4]
[2017-07-05T20:38:11,004][INFO ][o.e.e.NodeEnvironment    ] [Co7MJEJ] heap size [989.8mb], compressed ordinary object pointers [true]
[2017-07-05T20:38:11,035][INFO ][o.e.n.Node               ] node name [Co7MJEJ] derived from node ID [Co7MJEJKRxu9qhWVmwm8OQ]; set [node.name] to override
[2017-07-05T20:38:11,035][INFO ][o.e.n.Node               ] version[5.3.2], pid[1], build[3068195/2017-04-24T16:15:59.481Z], OS[Linux/4.4.62-1-pve/amd64], JVM[Oracle Corporation/OpenJDK 64-Bit Server VM/1.8.0_121/25.121-b13]
[2017-07-05T20:38:13,658][INFO ][o.e.p.PluginsService     ] [Co7MJEJ] loaded module [aggs-matrix-stats]
[2017-07-05T20:38:13,658][INFO ][o.e.p.PluginsService     ] [Co7MJEJ] loaded module [ingest-common]
[2017-07-05T20:38:13,659][INFO ][o.e.p.PluginsService     ] [Co7MJEJ] loaded module [lang-expression]
[2017-07-05T20:38:13,659][INFO ][o.e.p.PluginsService     ] [Co7MJEJ] loaded module [lang-groovy]
[2017-07-05T20:38:13,659][INFO ][o.e.p.PluginsService     ] [Co7MJEJ] loaded module [lang-mustache]
[2017-07-05T20:38:13,659][INFO ][o.e.p.PluginsService     ] [Co7MJEJ] loaded module [lang-painless]
[2017-07-05T20:38:13,659][INFO ][o.e.p.PluginsService     ] [Co7MJEJ] loaded module [percolator]
[2017-07-05T20:38:13,659][INFO ][o.e.p.PluginsService     ] [Co7MJEJ] loaded module [reindex]
[2017-07-05T20:38:13,660][INFO ][o.e.p.PluginsService     ] [Co7MJEJ] loaded module [transport-netty3]
[2017-07-05T20:38:13,660][INFO ][o.e.p.PluginsService     ] [Co7MJEJ] loaded module [transport-netty4]
[2017-07-05T20:38:13,661][INFO ][o.e.p.PluginsService     ] [Co7MJEJ] loaded plugin [analysis-morphology]
[2017-07-05T20:38:13,661][INFO ][o.e.p.PluginsService     ] [Co7MJEJ] loaded plugin [analysis-smartcn]
[2017-07-05T20:38:13,661][INFO ][o.e.p.PluginsService     ] [Co7MJEJ] loaded plugin [analysis-stempel]
[2017-07-05T20:38:15,984][INFO ][o.e.n.Node               ] initialized
[2017-07-05T20:38:15,985][INFO ][o.e.n.Node               ] [Co7MJEJ] starting ...
[2017-07-05T20:38:16,146][WARN ][i.n.u.i.MacAddressUtil   ] Failed to find a usable hardware address from the network interfaces; using random bytes: 4d:24:43:a8:ba:ff:45:d6
[2017-07-05T20:38:16,209][INFO ][o.e.t.TransportService   ] [Co7MJEJ] publish_address {172.18.0.3:9300}, bound_addresses {0.0.0.0:9300}
[2017-07-05T20:38:16,216][INFO ][o.e.b.BootstrapChecks    ] [Co7MJEJ] bound or publishing to a non-loopback or non-link-local address, enforcing bootstrap checks
[2017-07-05T20:38:19,259][INFO ][o.e.c.s.ClusterService   ] [Co7MJEJ] new_master {Co7MJEJ}{Co7MJEJKRxu9qhWVmwm8OQ}{VCd0INS7SG-SW7fkEhvRuw}{172.18.0.3}{172.18.0.3:9300}, reason: zen-disco-elected-as-master ([0] nodes joined)
[2017-07-05T20:38:19,299][INFO ][o.e.h.n.Netty4HttpServerTransport] [Co7MJEJ] publish_address {172.18.0.3:9200}, bound_addresses {0.0.0.0:9200}
[2017-07-05T20:38:19,308][INFO ][o.e.n.Node               ] [Co7MJEJ] started
[2017-07-05T20:38:19,768][INFO ][o.e.g.GatewayService     ] [Co7MJEJ] recovered [2] indices into cluster_state
[2017-07-05T20:38:20,568][INFO ][o.e.c.r.a.AllocationService] [Co7MJEJ] Cluster health status changed from [RED] to [YELLOW] (reason: [shards started [[ambar_log_record_data][4]] ...]).
[2017-07-05T20:38:49,314][WARN ][o.e.c.r.a.DiskThresholdMonitor] [Co7MJEJ] high disk watermark [90%] exceeded on [Co7MJEJKRxu9qhWVmwm8OQ][Co7MJEJ][/usr/share/elasticsearch/data/nodes/0] free: 3.3gb[5.3%], shards will be relocated away from this node
[2017-07-05T20:38:49,315][INFO ][o.e.c.r.a.DiskThresholdMonitor] [Co7MJEJ] rerouting shards: [high disk watermark exceeded on one or more nodes]

On the front end chrome dev tools tells me it's still having trouble connecting to the /api/

@sochix
Copy link
Member

sochix commented Jul 24, 2017

@tscibilia I don't see any problems in logs, update to latest version and try again

@sochix
Copy link
Member

sochix commented Aug 4, 2017

@tscibilia any news?

@sochix
Copy link
Member

sochix commented Aug 18, 2017

No response for 2 weeks

@sochix sochix closed this as completed Aug 18, 2017
@tscibilia
Copy link
Author

Sorry about not responding, I gave up on it. however, I just noticed there was a new web api commit today v1.2.0

So I did ./ambar.py uninstall and then reinstalled everything. Now it works!
I literally have no idea why, but it does work now.

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

No branches or pull requests

3 participants