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

Need Some Basic Help Getting Started #67

Open
krdorsey opened this issue Apr 25, 2019 · 5 comments
Open

Need Some Basic Help Getting Started #67

krdorsey opened this issue Apr 25, 2019 · 5 comments

Comments

@krdorsey
Copy link

krdorsey commented Apr 25, 2019

Installation went fine and all the default functionality is working.

The trouble starts when I tried to create my own layout_config.yaml and send data to my tiles.

The tiles are visible when browsing to http://serverIP:7272/ but attempts to send data or configuration to the tiles results in HTTP 404: Not Found. Indeed it does appear that there are NO keys in redis, as shown by:

(tb-env) [pylabs@rdu-vs-abe .tipboard]$ redis-cli
127.0.0.1:6379> KEYS *
(empty list or set)
127.0.0.1:6379>

Based on reading various sources it seems the keys for tiles should be created on initial data POSTing (push), correct? If my assumption is not correct, please clarify when are the database entries for the tiles created?

Any suggestions on why I have no keys? Troubleshooting tips are sparse in the docs. Any additional tip are appreciated.

Here is my layout, which is mostly based on the default. Just some renaming of elements and title.

(tb-env) [pylabs@my_server .tipboard]$ cat layout_config.yaml
details:
page_title: System Statistics Dashboard
layout:
- row_1_of_2:
- col_1_of_4:
- tile_template: big_value
tile_id: tile1
title: Monitored Systems

    - col_1_of_4:
        - tile_template: text
          tile_id: tile2
          title: Text Tile1
          classes:

    - col_1_of_4:
        - tile_template: text
          tile_id: tile3
          title: Text Tile
          classes:

    - col_1_of_4:
        - tile_template: text
          tile_id: tile4
          title: Text Tile
          classes:

- row_1_of_2:
    - col_1_of_4:
        - tile_template: text
          tile_id: tile5
          title: Text Tile
          classes:

    - col_1_of_4:
        - tile_template: text
          tile_id: tile6
          title: Text Tile
          classes:

    - col_1_of_4:
        - tile_template: text
          tile_id: tile7
          title: Text Tile
          classes:

    - col_1_of_4:
        - tile_template: text
          tile_id: tile8
          title: Text Tile
          classes:

(tb-env) [pylabs@

Here are my local settings:

(tb-env) [pylabs@rdu-vs-abe .tipboard]$ cat settings-local.py
#!/usr/bin/env python

-- coding: utf-8 --

from future import absolute_import
from future import division
from future import print_function
from future import unicode_literals

PROJECT_NAME = 'soak_dashboard'
API_KEY = '6730c0dd0f334cb483e2a0b0d9f9cdb7'

REDIS_HOST = '0.0.0.0'
HOST = '0.0.0.0'
DEBUG = True
JS_LOG_LEVEL = 2

Here is a sample POST:

http://my_server:7272/api/v0.1/6730c0dd0f334cb483e2a0b0d9f9cdb7/push/?tile=text&key=tile2&data=%7B%22text%22%3A%20%22Hello world!%22%7D

Thanks for your assistance in getting me up and running.

@krdorsey
Copy link
Author

Additional troubleshooting information.

I'm noticing the following exceptions being logged about every hour:

[I 190427 10:34:03 app:165] Web socket opened.
[I 190427 10:34:03 app:171] Subscribed to soak_dashboard:events on Redis.
[I 190427 10:34:03 app:124] Message received: update.
[E 190427 10:49:02 web:1121] Uncaught exception HEAD /layout_config (127.0.0.1)
HTTPRequest(protocol='http', host='localhost:7272', method='HEAD', uri='/layout_config', version='HTTP/1.1', remote_ip='127.0.0.1', body='', headers={'Connection': 'keep-alive', 'Accept-Language': 'en-US,en;q=0.5', 'Accept-Encoding': 'gzip, deflate', 'Referer': 'http://localhost:7272/layout_config', 'Host': 'localhost:7272', 'Accept': '/', 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0'})
Traceback (most recent call last):
File "/home/pylabs/tb-env/lib/python2.7/site-packages/tornado/web.py", line 1077, in _execute
*self.path_args, **self.path_kwargs)
TypeError: head() takes exactly 1 argument (2 given)
[E 190427 10:49:02 web:1514] 500 HEAD /layout_config (127.0.0.1) 7.06ms
[I 190427 10:49:02 app:115] Web socket closed.
[I 190427 10:49:03 app:165] Web socket opened.

@krdorsey
Copy link
Author

krdorsey commented May 6, 2019

Tried installing 1.4.1 in a separate VE, but results were the same.

(tb-env2) [pylabs2@[my server] home]$ pip freeze
docopt==0.6.1
docutils==0.14
Jinja2==2.10.1
MarkupSafe==1.1.1
mock==1.0.1
Pygments==2.3.1
PyYAML==3.10
raven==3.5.2
redis==2.7.5
requests==1.2.3
six==1.4.1
Sphinx==1.2.2
sphinxcontrib-httpdomain==1.3.0
tipboard==1.4.1
tornado==3.0.1
tornado-redis==2.4.2
You are using pip version 9.0.1, however version 19.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
(tb-env2) [pylabs2@[my server] home]$

Also ran tipboard with test option. Everything seems mostly OK:

(tb-env2) [pylabs2@[my server] ~]$ tipboard test
Raven is not configured (logging is disabled). Please see the documentation for more information.
test_01_api_key (test_rest_api.TestRestApi) ... ok
test_02_info_resource (test_rest_api.TestRestApi) ... ok
test_03_push_resource (test_rest_api.TestRestApi) ... ok
test_04_tileconfig_resource_post (test_rest_api.TestRestApi) ... ok
test_05_tiledata_resource_get (test_rest_api.TestRestApi) ... ERROR
test_06_tileconfig_resource_delete (test_rest_api.TestRestApi) ... ok
test_07_tiledata_resource_delete (test_rest_api.TestRestApi) ... ok
test_collecting_tiles_data (test_config_parser.TestConfigFiles) ... ok
test_finding_configs_files (test_config_parser.TestConfigFiles) ... ok
test_get_rows (test_config_parser.TestConfigParser)
simple call of get_rows method and check rows count ... ok
test_get_rows_cols_validator (test_config_parser.TestConfigParser) ... ok
test_all_files_created (test_console_commands.TestConfigFiles) ... ok
test_config_contains_api_key (test_console_commands.TestConfigFiles)
check if 'settings-local.py' contains API key ... ok
test_config_contains_project_name (test_console_commands.TestConfigFiles)
check if 'settings-local.py' contains project's name ... ok
test_recreate_project (test_console_commands.TestConfigFiles) ... ok

======================================================================
ERROR: test_05_tiledata_resource_get (test_rest_api.TestRestApi)

Traceback (most recent call last):
File "/home/pylabs2/tb-env2/lib/python2.7/site-packages/tipboard/tests/test_rest_api.py", line 135, in test_05_tiledata_resource_get
'%Y-%m-%d %H:%M:%S')
File "/usr/lib64/python2.7/_strptime.py", line 325, in _strptime
(data_string, format))
ValueError: time data '2019-05-06T12:17:44-04:00' does not match format '%Y-%m-%d %H:%M:%S'


Ran 15 tests in 0.922s

FAILED (errors=1)
(tb-env2) [pylabs2@[my server] ~]$

@krdorsey
Copy link
Author

krdorsey commented May 6, 2019

Hoping for some sort of reply soon, otherwise I'm off looking for an alternative solution

@krepflap
Copy link
Contributor

http://my_server:7272/api/v0.1/6730c0dd0f334cb483e2a0b0d9f9cdb7/push/?tile=text&key=tile2&data=%7B%22text%22%3A%20%22Hello world!%22%7D

Here you are sending query parameters, but in a POST the data should be sent in the body of the request.

See curl example on https://tipboard.readthedocs.io/en/latest/tile__text.html

@krdorsey
Copy link
Author

Hi. Yes, I tried that form of REST request also, but it still results in a 404 response.
image

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