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

Not working analytics when use docker image (0.12.0) #284

Closed
shaliko opened this issue Aug 10, 2016 · 10 comments
Closed

Not working analytics when use docker image (0.12.0) #284

shaliko opened this issue Aug 10, 2016 · 10 comments
Milestone

Comments

@shaliko
Copy link
Contributor

shaliko commented Aug 10, 2016

When I start project as Docker container using instructions from http://api-umbrella.readthedocs.io/en/latest/getting-started.html#running-with-docker, the "Analytics" have empty charts. API works OK, but all charts empty. I not found any issue in logs.

My api-umbrella.yml file:

services:
  - general_db
  - log_db
  - router
  - web
web:
  admin:
    initial_superusers:
      - [email protected]
    auth_strategies:
      enabled:
        - github
        - google
        - persona
      github:
        client_id: xxx
        client_secret: xxx
      google:
        client_id:
        client_secret:
elasticsearch:
  hosts:
    - http://127.0.0.1:14002
mongodb:
  url: mongodb://127.0.0.1:14001/api_umbrella
nginx:
  workers: 4
gatekeeper:
  workers: 4
hosts:
  - hostname: apinf.usubov.com
    default: true

I can test my backend:

$ curl --insecure "https://apinf.usubov.com/maps/api/geocode/json?api_key=hwBrTpoJhHwMszx904lDOjKZgDoD1oAX5aTJNVEr&address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&key=AIzaSyDc97a13NBkefRoq6e5v2FpIyjEBS1rkl0"

Empty charts:
api_umbrella_admin_and_heiaheia_ -bash _127x34

I can test that Elasticsearch works:

root@c5378d2bcfc9:/# curl http://127.0.0.1:14002                         
{
  "status" : 200,
  "name" : "Lady Mastermind",
  "cluster_name" : "api-umbrella",
  "version" : {
    "number" : "1.7.5",
    "build_hash" : "00f95f4ffca6de89d68b7ccaf80d148f1f70e4d4",
    "build_timestamp" : "2016-02-02T09:55:30Z",
    "build_snapshot" : false,
    "lucene_version" : "4.10.4"
  },
  "tagline" : "You Know, for Search"
}

Any advice where I should find issue?

@brylie
Copy link
Contributor

brylie commented Aug 18, 2016

Ping @GUI. We need a bit of support here, to figure out what to do.

Ping @bajiat, this issue is related to our analytics not working recently.

@shaliko
Copy link
Contributor Author

shaliko commented Aug 18, 2016

@GUI I added debug code to Lua scripts, found that we successfully log data here https://github.com/NREL/api-umbrella/blob/master/src/api-umbrella/proxy/hooks/log_initial_proxy.lua#L276

But If I get ElasticSearch stats:

curl -XGET http://localhost:14002/_stats?pretty=true

     "api-umbrella-logs-v1-2016-08" : {
      "primaries" : {
        "docs" : {
          "count" : 0,
          "deleted" : 0
        },
        "store" : {
          "size_in_bytes" : 432,
          "throttle_time_in_millis" : 0
        },
        "indexing" : {
          "index_total" : 0,
          "index_time_in_millis" : 0,
          "index_current" : 0,
          "delete_total" : 0,
          "delete_time_in_millis" : 0,
          "delete_current" : 0,
          "noop_update_total" : 0,
          "is_throttled" : false,
          "throttle_time_in_millis" : 0
        },
        "get" : {
          "total" : 0,
          "time_in_millis" : 0,
          "exists_total" : 0,
          "exists_time_in_millis" : 0,
          "missing_total" : 0,
          "missing_time_in_millis" : 0,
          "current" : 0
        },
        "search" : {
          "open_contexts" : 0,
          "query_total" : 144,
          "query_time_in_millis" : 272,
          "query_current" : 0,
          "fetch_total" : 0,
          "fetch_time_in_millis" : 0,
          "fetch_current" : 0
        },
        "merges" : {
          "current" : 0,
          "current_docs" : 0,
          "current_size_in_bytes" : 0,
          "total" : 0,
          "total_time_in_millis" : 0,
          "total_docs" : 0,
          "total_size_in_bytes" : 0
        },
        "refresh" : {
          "total" : 3,
          "total_time_in_millis" : 0
        },
        "flush" : {
          "total" : 6,
          "total_time_in_millis" : 23
        },
        "warmer" : {
          "current" : 0,
          "total" : 6,
          "total_time_in_millis" : 15
        },
        "filter_cache" : {
          "memory_size_in_bytes" : 0,
          "evictions" : 0
        },
        "id_cache" : {
          "memory_size_in_bytes" : 0
        },
        "fielddata" : {
          "memory_size_in_bytes" : 0,
          "evictions" : 0
        },
        "percolate" : {
          "total" : 0,
          "time_in_millis" : 0,
          "current" : 0,
          "memory_size_in_bytes" : -1,
          "memory_size" : "-1b",
          "queries" : 0
        },
        "completion" : {
          "size_in_bytes" : 0
        },
        "segments" : {
          "count" : 0,
          "memory_in_bytes" : 0,
          "index_writer_memory_in_bytes" : 0,
          "index_writer_max_memory_in_bytes" : 1536000,
          "version_map_memory_in_bytes" : 0,
          "fixed_bit_set_memory_in_bytes" : 0
        },
        "translog" : {
          "operations" : 0,
          "size_in_bytes" : 17
        },
        "suggest" : {
          "total" : 0,
          "time_in_millis" : 0,
          "current" : 0
        },
        "query_cache" : {
          "memory_size_in_bytes" : 0,
          "evictions" : 0,
          "hit_count" : 0,
          "miss_count" : 0
        },
        "recovery" : {
          "current_as_source" : 0,
          "current_as_target" : 0,
          "throttle_time_in_millis" : 0
        }
      },
      "total" : {
        "docs" : {
          "count" : 0,
          "deleted" : 0
        },
        "store" : {
          "size_in_bytes" : 432,
          "throttle_time_in_millis" : 0
        },
        "indexing" : {
          "index_total" : 0,
          "index_time_in_millis" : 0,
          "index_current" : 0,
          "delete_total" : 0,
          "delete_time_in_millis" : 0,
          "delete_current" : 0,
          "noop_update_total" : 0,
          "is_throttled" : false,
          "throttle_time_in_millis" : 0
        },
        "get" : {
          "total" : 0,
          "time_in_millis" : 0,
          "exists_total" : 0,
          "exists_time_in_millis" : 0,
          "missing_total" : 0,
          "missing_time_in_millis" : 0,
          "current" : 0
        },
        "search" : {
          "open_contexts" : 0,
          "query_total" : 144,
          "query_time_in_millis" : 272,
          "query_current" : 0,
          "fetch_total" : 0,
          "fetch_time_in_millis" : 0,
          "fetch_current" : 0
        },
        "merges" : {
          "current" : 0,
          "current_docs" : 0,
          "current_size_in_bytes" : 0,
          "total" : 0,
          "total_time_in_millis" : 0,
          "total_docs" : 0,
          "total_size_in_bytes" : 0
        },
        "refresh" : {
          "total" : 3,
          "total_time_in_millis" : 0
        },
        "flush" : {
          "total" : 6,
          "total_time_in_millis" : 23
        },
        "warmer" : {
          "current" : 0,
          "total" : 6,
          "total_time_in_millis" : 15
        },
        "filter_cache" : {
          "memory_size_in_bytes" : 0,
          "evictions" : 0
        },
        "id_cache" : {
          "memory_size_in_bytes" : 0
        },
        "fielddata" : {
          "memory_size_in_bytes" : 0,
          "evictions" : 0
        },
        "percolate" : {
          "total" : 0,
          "time_in_millis" : 0,
          "current" : 0,
          "memory_size_in_bytes" : -1,
          "memory_size" : "-1b",
          "queries" : 0
        },
        "completion" : {
          "size_in_bytes" : 0
        },
        "segments" : {
          "count" : 0,
          "memory_in_bytes" : 0,
          "index_writer_memory_in_bytes" : 0,
          "index_writer_max_memory_in_bytes" : 1536000,
          "version_map_memory_in_bytes" : 0,
          "fixed_bit_set_memory_in_bytes" : 0
        },
        "translog" : {
          "operations" : 0,
          "size_in_bytes" : 17
        },
        "suggest" : {
          "total" : 0,
          "time_in_millis" : 0,
          "current" : 0
        },
        "query_cache" : {
          "memory_size_in_bytes" : 0,
          "evictions" : 0,
          "hit_count" : 0,
          "miss_count" : 0
        },
        "recovery" : {
          "current_as_source" : 0,
          "current_as_target" : 0,
          "throttle_time_in_millis" : 0
        }

@shaliko
Copy link
Contributor Author

shaliko commented Aug 18, 2016

@GUI Fixed issue by drop ElasticSearch data

curl -XDELETE 'http://localhost:14002/_all'

After that it stars works correctly and I see data on Analytics page.

Now prepare new installation from scratch and will provide for you more debug info.

@shaliko
Copy link
Contributor Author

shaliko commented Aug 18, 2016

I tried enable DEBUG level in ElasticSearch conf (logging.yml.mustache), enabled error_log for Nginx and added debug code in Lua scripts, but not found root case yet.

Delete ElasticSearch data after docker container start fix issue.

curl -XDELETE 'http://localhost:14002/_all'

@rabanian
Copy link

hey guys, I have the same issue but @shaliko solution doesn't seem to solve it..
13.0 installed, getting this error after running the curl:
image

@shaliko
Copy link
Contributor Author

shaliko commented Sep 20, 2016

@ofirtwo Try restart docker containers.

docker-compose restart

@shaliko
Copy link
Contributor Author

shaliko commented Sep 20, 2016

@ofirtwo Actually later we found another issue. You need connect to you docker-container and install curl, the do restart.

docker exec -it CONTAINER_ID bash
apt-get update && apt-get install curl

Then from host machine:

docker restart CONTAINER_ID

@rabanian
Copy link

works now, thanks

@GUI GUI added this to the v0.14.0 milestone Feb 6, 2017
@GUI
Copy link
Member

GUI commented Feb 23, 2017

This should be fixed in the v0.14.0 release.

@GUI GUI closed this as completed Feb 23, 2017
@marquicus
Copy link

marquicus commented May 24, 2018

Version v0.14.4 same issue happens, the workaround doesn't work

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

5 participants