These are chat archives for getredash/redash

4th
Dec 2015
Arik Fraimovich
@arikfr
Dec 04 2015 05:30
@sromku glad to hear :-)
@dookehster did you use the bootstrap script or manually installed what's needed? Are you sure the server uses the same db name you use when running psql?
anthonyinfinity
@anthonyinfinity
Dec 04 2015 13:29
Hi guys, pulled the 0.8.2 and I am running into an error, I was wondering if you could suggest how to troubleshoot this?
This message was deleted
[ERROR][redash.wsgi] Exception on /login [GET]
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1817, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1477, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python2.7/dist-packages/flask_restful/__init__.py", line 251, in error_router
    return original_handler(e)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1381, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1475, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1461, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/opt/redash/current/redash/handlers/authentication.py", line 37, in login
    show_saml_login=settings.SAML_LOGIN_ENABLED)
  File "/usr/local/lib/python2.7/dist-packages/flask/templating.py", line 127, in render_template
    return _render(ctx.app.jinja_env.get_or_select_template(template_name_or_list),
  File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 830, in get_or_select_template
    return self.get_template(template_name_or_list, parent, globals)
  File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 791, in get_template
    return self._load_template(name, self.make_globals(globals))
  File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 765, in _load_template
    template = self.loader.load(self, name, globals)
  File "/usr/local/lib/python2.7/dist-packages/jinja2/loaders.py", line 113, in load
    source, filename, uptodate = self.get_source(environment, name)
  File "/usr/local/lib/python2.7/dist-packages/flask/templating.py", line 64, in get_source
    raise TemplateNotFound(template)
TemplateNotFound: login.html
Arik Fraimovich
@arikfr
Dec 04 2015 14:12
@anthonyinfinity seems like you're pointing it at a non existing folder for the static assets. can you elaborate on how you run redash?
anthonyinfinity
@anthonyinfinity
Dec 04 2015 14:14
hi @arikfr I build the image, from the repo, and run it with marathon, I pass envs with the marathon json e.g
 "env": {
        "REDASH_CONNECTION_ADAPTER": "pg",
        "REDASH_CONNECTION_STRING": "dbname=redash",
        "REDASH_STATIC_ASSETS_PATH": "/opt/redash/current/rd_ui",
....
A. Brooks Hollar
@hollarab
Dec 04 2015 14:16
shouldn't that last line end in the "dist" folder?
"REDASH_STATIC_ASSETS_PATH": "/opt/redash/current/rd_ui/dist"
Howdy Arik - I installed the latest AMI onto an EC2 box yesterday. It appears 0.8.1 is installed, and the server is running, but when I go to /data_sources i'm getting a 403 on /api/data_types/types and the Dropdown is empty. Am I missing something obvious?
Arik Fraimovich
@arikfr
Dec 04 2015 14:21
@anthonyinfinity it should be /opt/redash/current/rd_ui/dist if you built the minified assets (recommended) or /opt/redash/current/rd_ui/app if you haven't. Also, unless you have a good reason to do it, you can use the image from docker hub (https://hub.docker.com/r/redash/redash). I just noticed that it wasn't uploading recent builds there, but I think I fixed it and in a few minutes there will be one.
@hollarab are you logging in as an admin?
A. Brooks Hollar
@hollarab
Dec 04 2015 14:22
ahh. no. i just wired it up to Google Auth, didn't designate an admin user.
i bet that fixes me up - thanks Arik!
anthonyinfinity
@anthonyinfinity
Dec 04 2015 14:26
makes sense, many thanks
CarpeFridiem
@brentonmallen1
Dec 04 2015 14:40
@arikfr I tried to execute the command you suggested to @gallamine yesterday in regards to the alerts but I got errors along the lines of: {{...query runner enabled but not supported, not registering.}} and {{/tmp/redash_env.z4maPB: line 8: export: `32': not a valid identifier}}. Any thoughts?
Arik Fraimovich
@arikfr
Dec 04 2015 14:46
@hollarab yes, just make your use an admin - either from the CLI or by logging in with the admin user and checking the "Admin" checkbox in the settings tab for your user.
@brentonmallen1 the "enabled/not registering" messages are just warnings and you can safely ignore them. The other one sounds like an issue in your .env file.
A. Brooks Hollar
@hollarab
Dec 04 2015 14:50
@arikfr - thanks, i got it up and working!
CarpeFridiem
@brentonmallen1
Dec 04 2015 15:06
Is there a way to inspect the .env file for issues?
Arik Fraimovich
@arikfr
Dec 04 2015 15:07
yes, just run source .env and check the errors you get
CarpeFridiem
@brentonmallen1
Dec 04 2015 15:09
I got the following errors
:/opt/redash/current$ source .env -bash: export: `32': not a valid identifier -bash: export: `-1': not a valid identifier
Arik Fraimovich
@arikfr
Dec 04 2015 15:12
@hollarab super! I hope you enjoy it :)
Arik Fraimovich
@arikfr
Dec 04 2015 15:20
@brentonmallen1 do you have a line with such an identifier? probably some syntax issue. if you can, share it here
CarpeFridiem
@brentonmallen1
Dec 04 2015 15:21

you mean in my .env file? it's contents are:

export REDASH_CONNECTION_ADAPTER=pg
export REDASH_CONNECTION_STRING="dbname=redash"
export REDASH_STATIC_ASSETS_PATH="../rd_ui/dist/"
export REDASH_LOG_LEVEL="INFO"
export REDASH_WORKERS_COUNT=6
export REDASH_REDIS_URL=redis://localhost:6379/1
export REDASH_DATABASE_URL="postgresql://redash"
export REDASH_COOKIE_SECRET=pwgen 32 -1
export REDASH_GOOGLE_APPS_DOMAIN=

Arik Fraimovich
@arikfr
Dec 04 2015 15:27
@brentonmallen1 it's the COOKIE_SECRET line. Run pwgen 32 -1 once and copy the result to there instead
CarpeFridiem
@brentonmallen1
Dec 04 2015 15:32
okay, that seemed to work after I did {{source .env}} I got no errors
however, when I try to run {{ bin/run python -c "import redash.models; redash.models.AlertSubscription.create_table() }} I get {{ peewee.OperationalError: FATAL: role "ubuntu" does not exist }}
A. Brooks Hollar
@hollarab
Dec 04 2015 15:33
@arikfr one more quick one, i hope. I've added a couple tables to the Redshift instance i'm connected to as a data_source. Redash isn't seeing them. is there a way to have a data_source refresh it's schema?
Arik Fraimovich
@arikfr
Dec 04 2015 15:34
@hollarab it refreshes the schema every 30 minutes. currently there is no way to trigger it ...
@brentonmallen1 right, you need to run it as redash user: sudo -u redash bin/run python -c "...".
CarpeFridiem
@brentonmallen1
Dec 04 2015 15:37
ah, i'll give that a go
That seemed to run, I just got the warnings mentioned before
Arik Fraimovich
@arikfr
Dec 04 2015 15:38
:+1: great. try to create an alert now. it should work right.
CarpeFridiem
@brentonmallen1
Dec 04 2015 15:50
I was able to save and subscribe to the alert but when it triggered I didn't receive an email
Arik Fraimovich
@arikfr
Dec 04 2015 15:51
@brentonmallen1 that's probably because you haven't setup a mail server, see: http://docs.redash.io/en/latest/setup.html#mail-configuration (it's like a quest, every time you complete a level, you get a hint to the next task ;))
A. Brooks Hollar
@hollarab
Dec 04 2015 15:52
@arikfr cool. sitting around for 30m i can do!
CarpeFridiem
@brentonmallen1
Dec 04 2015 15:56
haha it's all part of the adventure
i really appreciate all the help
Arik Fraimovich
@arikfr
Dec 04 2015 16:16
Happy to help
:-)
anthonyinfinity
@anthonyinfinity
Dec 04 2015 16:40
This message was deleted
@arikfr, I tried to pull the repo but got this error : Tag latest not found in repository docker.io/redash/redash
Arik Fraimovich
@arikfr
Dec 04 2015 17:48
@anthonyinfinity I didn't tag any image as latest yet. I'll do it later today. Meanwhile you can just pull with a specific tag.
Ryan Katkov
@solidspark
Dec 04 2015 18:57
@arikfr greetings
@arikfr we seem to be experiencing issues with celery
when a query goes into queue, the timer starts, but if we refresh the page and then hit the refresh again, the timer resets. iirc, that's not normal behavior
Arik Fraimovich
@arikfr
Dec 04 2015 18:59
@solidspark hi.
does it say "query in queue" or "executing query" next to the counter?
Ryan Katkov
@solidspark
Dec 04 2015 19:02
query in queue
i've restarted redash and cleared out the celery workers several times as well
and i see no queries being executed on Redshift
Arik Fraimovich
@arikfr
Dec 04 2015 19:03
did you flush redis between stopping and starting celery?
Ryan Katkov
@solidspark
Dec 04 2015 19:04
yes
Arik Fraimovich
@arikfr
Dec 04 2015 19:04
can you try executing a random query like "select 948845855"?
Ryan Katkov
@solidspark
Dec 04 2015 19:04

sudo /etc/init.d/redash_supervisord stop

sudo ps faux | grep -i celery | awk '{print $2}' | xargs sudo kill -9

redis-cli flushdb

sudo service redis_6379 restart

sudo /etc/init.d/redash_supervisord start

trying
in queue as well
Arik Fraimovich
@arikfr
Dec 04 2015 19:08
can you check the celery logs?
Ryan Katkov
@solidspark
Dec 04 2015 19:08
checking logs
haha
Arik Fraimovich
@arikfr
Dec 04 2015 19:08
:)
Ryan Katkov
@solidspark
Dec 04 2015 19:09
[2015-12-04 11:05:26,573: ERROR/MainProcess] Task redash.tasks.execute_query[348103cb-7a69-4669-b4bc-b03f762a15ea] raised unexpected: Exception('table 132351 dropped by concurrent transaction\n',)
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/celery/app/trace.py", line 240, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/opt/redash/redash.0.7.0.b977/redash/tasks.py", line 24, in __call__
    return super(BaseTask, self).__call__(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/celery/app/trace.py", line 437, in __protected_call__
    return self.run(*args, **kwargs)
  File "/opt/redash/redash.0.7.0.b977/redash/tasks.py", line 312, in execute_query
    raise Exception(error)
Exception: table 132351 dropped by concurrent transaction
i see this in api_error.log too:
[2015-12-04 11:10:22,086][PID:29202][DEBUG][peewee] ('SELECT "t1"."id", "t1"."updated_at", "t1"."created_at", "t1"."name", "t1"."email", "t1"."password_hash", "t1"."groups", "t1"."api_key" FROM "users" AS t1 WHERE ("t1"."id" = %s) LIMIT 1', [17])
neither of these seem relevant
Arik Fraimovich
@arikfr
Dec 04 2015 19:12
yes
can you share the full celery log since restarting?
(in private maybe)
Ryan Katkov
@solidspark
Dec 04 2015 19:14
sent
Arik Fraimovich
@arikfr
Dec 04 2015 19:15
it looks like it executes only scheduled_queries queue. do you have another process for the adhoc queries (queue with the name "queries" usually)?
(let's continue here)
CarpeFridiem
@brentonmallen1
Dec 04 2015 19:16
Is there a test for sending webhook alerts? Something like the send_test_mail test?
Arik Fraimovich
@arikfr
Dec 04 2015 19:17
@brentonmallen1 nope :|
CarpeFridiem
@brentonmallen1
Dec 04 2015 19:18
lol no worries, i'll keep debugging
CarpeFridiem
@brentonmallen1
Dec 04 2015 20:20
@arikfr it doesn't look like the webhook feature wants to play nice with trying to send a message to slack (or i'm using it wrong).
Arik Fraimovich
@arikfr
Dec 04 2015 20:20
@brentonmallen1 how do you set it up?
CarpeFridiem
@brentonmallen1
Dec 04 2015 20:21
I generated a webhook url from slack and put that into the .envfile under the REDASH_WEBHOOK_ENDPOINT variable
I think the payload requirement for slack is a bit different
Arik Fraimovich
@arikfr
Dec 04 2015 20:22
I don't think this will work. I assume that Slack excepts a specific structure, while re:dash sends something of its own. You will need a small "proxy" to parse the two
CarpeFridiem
@brentonmallen1
Dec 04 2015 20:23
in another system I use pyslack, I can look into using that this weekend and maybe contribute if that would be of any use to anyone
Arik Fraimovich
@arikfr
Dec 04 2015 20:24
Adding "native" support for Slack will definitely be useful for others too. I'm not sure if pyslack or just supporting their webhooks
CarpeFridiem
@brentonmallen1
Dec 04 2015 20:25
ok, i'll take a look into it this weekend and see if I can come up with a working solution
Arik Fraimovich
@arikfr
Dec 04 2015 20:25
super. thanks :)
CarpeFridiem
@brentonmallen1
Dec 04 2015 20:28
Arik Fraimovich
@arikfr
Dec 04 2015 20:34
this library is just the following function just with much more code:
def slack_notify(webhook_url, payload):
    requests.post(webhooks_url, data={'payload': json.dumps(payload))
(they used urllib instead of requests, which increases the amount of code you might need to use)