These are chat archives for getredash/redash

5th
Jun 2017
Eric Feng
@ehfeng
Jun 05 2017 04:20
hey all, trying to get a dev machine up and running
i've gotten everything else, but I'm not sure how to create an admin account
scanning through previous threads, I tried docker-compose run --rm server manage users create --admin --password admin "Admin" "admin"
Eric Feng
@ehfeng
Jun 05 2017 04:27
@arik's previous reply seems to be more geared towards native installs, instead of via docker, which is recommended now
Arik Fraimovich
@arikfr
Jun 05 2017 04:28
@ehfeng it supposed to open the setup flow, which creates the admin user. apparently I broke it when ignoring my own comment and changing some code to be more idiomatic :O https://github.com/getredash/redash/pull/1807/files. can you try opening /setup in the browser?
@d-ray yes.
@umaxfun this feature was removed when we moved to plotly, where you can just select the time frame you need.
@vgadva if you're not using memsql, then it's not a problem... did you change the collection name in your query or ran it as is? because as is, it expects to find data in the date_test collection, which you probably don't have......
@Jonnyblacklabel try using {{{}}} (3 pairs of braces).
Eric Feng
@ehfeng
Jun 05 2017 04:32
@arik, i'm getting an "IOError: [Errno 32] Broken pipe" when i hit /setup
i can hit /login just fine though
Arik Fraimovich
@arikfr
Jun 05 2017 04:33
where do you get this error?
Eric Feng
@ehfeng
Jun 05 2017 04:33
server_1?
Arik Fraimovich
@arikfr
Jun 05 2017 04:33
in the log? is there a stacktrace?
Eric Feng
@ehfeng
Jun 05 2017 04:33
not sure i understand the question?
yeah, let me retrigger real fast
Arik Fraimovich
@arikfr
Jun 05 2017 04:34
@filipponova still having this problem? can you add a full stacktrace?
Eric Feng
@ehfeng
Jun 05 2017 04:36
odd it's just hanging now
Arik Fraimovich
@arikfr
Jun 05 2017 04:40
nothing in the logs?
Eric Feng
@ehfeng
Jun 05 2017 04:41
l just restarted my machine
one se
seems to just redirect me
server_1 | [2017-06-05 04:43:12,701][PID:132][INFO][metrics] method=GET path=/setup endpoint=redash.setup status=302 content_type=text/html; charset=utf-8 content_length=209 duration=0.44 query_count=0 query_duration=0.00
yeah @arik, i never can get to /setup
Arik Fraimovich
@arikfr
Jun 05 2017 04:45

you already created an organization object? if you have, then yeah, /setup will redirect to login.

anyway, to create a user you can run: docker-compose run --rm server manage users create admin Admin --pasword admin --admin

@mikeadamz see my discussion above with @ehfeng.
@cellsight you didn't delete the user, just removed it from the default group. you will need to add it back by changing it directly in the database.
@ArtursO you're using outdated documents (I thought I removed them, wasn't aware of the rtd.io url....). see new instructions here. Heroku is no longer documented or recommended. Many users had issues with their free tier and it much easier/cheaper just to deploy on DigitalOcean or similar.
Arik Fraimovich
@arikfr
Jun 05 2017 04:51
@ehfeng did it work?
Eric Feng
@ehfeng
Jun 05 2017 04:51
i tried that before :/
let me try again
i'm going to just start from scratch
in case I screwed seomthing up
Arik Fraimovich
@arikfr
Jun 05 2017 04:51
in the command you pasted above I think you have the order of arguments wrong
if this doesn't work, then it's enough to nuke the postgres container and call /setup. but give the create user a chance
Eric Feng
@ehfeng
Jun 05 2017 04:55
ok
hmm, i'm actually getting this error during docker-compose up: ERROR: relation "queries" does not exist at character 901
this is after I run docker-compose run --rm server create_db
Arik Fraimovich
@arikfr
Jun 05 2017 04:56
wtf
Eric Feng
@ehfeng
Jun 05 2017 04:57
but the stdout on that command is weirdly short
Starting redash_redis_1
Starting redash_postgres_1
[2017-06-05 04:57:35,149][PID:1][INFO][root] Generating grammar tables from /usr/lib/python2.7/lib2to3/Grammar.txt
[2017-06-05 04:57:35,178][PID:1][INFO][root] Generating grammar tables from /usr/lib/python2.7/lib2to3/PatternGrammar.txt
[2017-06-05 04:57:37,052][PID:1][INFO][alembic.runtime.migration] Context impl PostgresqlImpl.
[2017-06-05 04:57:37,053][PID:1][INFO][alembic.runtime.migration] Will assume transactional DDL.
huh, got this when running your command
Traceback (most recent call last):
  File "/app/manage.py", line 9, in <module>
    manager()
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/flask/cli.py", line 345, in main
    return AppGroup.main(self, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/flask/cli.py", line 229, in decorator
    return __ctx.invoke(f, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/app/redash/cli/users.py", line 81, in create
    groups = build_groups(org, groups, is_admin)
  File "/app/redash/cli/users.py", line 21, in build_groups
    groups = [org.default_group.id]
AttributeError: 'NoneType' object has no attribute 'default_group'
Arik Fraimovich
@arikfr
Jun 05 2017 05:01
this means you don't have an organization object. right, just realized that the bug was affecting the route itself. I merged @44px's fix so you can pull master again, and /setup should work
Eric Feng
@ehfeng
Jun 05 2017 05:04
server_1    | Traceback (most recent call last):
server_1    |   File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1988, in wsgi_app
server_1    |     response = self.full_dispatch_request()
server_1    |   File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1641, in full_dispatch_request
server_1    |     rv = self.handle_user_exception(e)
server_1    |   File "/usr/local/lib/python2.7/dist-packages/flask_restful/__init__.py", line 271, in error_router
server_1    |     return original_handler(e)
server_1    |   File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1544, in handle_user_exception
server_1    |     reraise(exc_type, exc_value, tb)
server_1    |   File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1639, in full_dispatch_request
server_1    |     rv = self.dispatch_request()
server_1    |   File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1625, in dispatch_request
server_1    |     return self.view_functions[rule.endpoint](**req.view_args)
server_1    |   File "/usr/local/lib/python2.7/dist-packages/flask_login/utils.py", line 228, in decorated_view
server_1    |     return func(*args, **kwargs)
server_1    |   File "/app/redash/handlers/static.py", line 41, in index
server_1    |     return render_index()
server_1    |   File "/app/redash/handlers/static.py", line 34, in render_index
server_1    |     response = send_file(full_path, **dict(cache_timeout=0, conditional=True))
server_1    |   File "/usr/local/lib/python2.7/dist-packages/flask/helpers.py", line 536, in send_file
server_1    |     file = open(filename, 'rb')
server_1    | IOError: [Errno 2] No such file or directory: '/app/redash/../client/dist/index.html'
server_1    | [2017-06-05 05:03:58,304][PID:132][ERROR][redash] Exception on / [GET]
server_1    | Traceback (most recent call last):
server_1    |   File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1988, in wsgi_app
server_1    |     response = self.full_dispatch_request()
server_1    |   File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1641, in full_dispatch_request
server_1    |     rv = self.handle_user_exception(e)
server_1    |   File "/usr/local/lib/python2.7/dist-packages/flask_restful/__init__.py", line 271, in error_router
server_1    |     return original_handler(e)
server_1    |   File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1544, in handle_user_exception
server_1    |     reraise(exc_type, exc_value, tb)
server_1    |   File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1639, in full_dispatch_request
server_1    |     rv = self.dispatch_request()
server_1    |   File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1625, in dispatch_request
server_1    |     return self.view_functions[rule.endpoint](**req.view_args)
server_1    |   File "/usr/local/lib/python2.7/dist-packages/flask_login/utils.py", line 228, in decorated_view
server_1    |     return func(*args, **kwargs)
server_1    |   File "/app/redash/handlers/static.py", line 41, in index
server_1    |     return render_index()
server_1    |   File "/app/redash/handlers/static.py", line 34, in render_index
server_1    |     response = send_file(full_path, **dict(cache_timeout=0, conditional=True))
server_1    |   File "/usr/local/lib/python2.7/dist-packages/flask/helpers.py", line 536, in send_file
server_1    |     file = open(filename, 'rb')
server_1    | IOError: [Errno 2] No such file or directory: '/app/redash/../client/dist/index.html'
not looking good
good news is that /setup worked
Arik Fraimovich
@arikfr
Jun 05 2017 05:05
did you run npm run build?
Eric Feng
@ehfeng
Jun 05 2017 05:05
ah damn
that never worked for me
i was hoping that wasn't necessary
Arik Fraimovich
@arikfr
Jun 05 2017 05:05
did you run npm install?
if both don't work for you, make sure you have a recent enough version of node (I think v4 should work, but recommend v6).
Eric Feng
@ehfeng
Jun 05 2017 05:06
i'm running 8
Arik Fraimovich
@arikfr
Jun 05 2017 05:06
bleeding edge :)
do you get any errors when running npm install?
Eric Feng
@ehfeng
Jun 05 2017 05:07
just blindly `brew upgrade'ing
yeah
This version of npm is compatible with lockfileVersion@1, but npm-shrinkwrap.json was generated for lockfileVersion@0. I'll try to do my best with it!
npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but npm-shrinkwrap.json was generated for lockfileVersion@0. I'll try to do my best with it!
npm ERR! code 128
npm ERR! Command failed: /usr/local/bin/git clone --depth=1 -q -b 22/head git://github.com/mapbox/mapbox-gl-shaders.git /Users/eric/.npm/_cacache/tmp/git-clone-aa0e5eed
npm ERR! warning: templates not found /var/folders/nh/f4ny0t7x4nq_3w1kpl2j0rsh0000gn/T/pacote-git-template-tmp/git-clone-e7002d5d
npm ERR! warning: Could not find remote branch 22/head to clone.
npm ERR! fatal: Remote branch 22/head not found in upstream origin
npm ERR!

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/eric/.npm/_logs/2017-06-05T05_06_15_040Z-debug.log
something with..mapbox?
Arik Fraimovich
@arikfr
Jun 05 2017 05:08
this has to do with npm v5 and not node itself. I have the same version so will try to reproduce
Eric Feng
@ehfeng
Jun 05 2017 05:09
ah dang
it doesn't look like mapbox has a brnach called 22/head?
hm nvm
Arik Fraimovich
@arikfr
Jun 05 2017 05:13
?
I don't see this branch referenced in the shrinkwrap file. I'm now running npm install in a new folder to see what gives
Eric Feng
@ehfeng
Jun 05 2017 05:14
yeah, ignore that
why is it outputing "Command failed...git clone..."
Arik Fraimovich
@arikfr
Jun 05 2017 05:16
because it tries to install an npm package from git... looks like an issue with mapbox package and they fixed it: plotly/plotly.js#1745
Arik Fraimovich
@arikfr
Jun 05 2017 05:21
actually it's not clear if plotly fixed it by now or not. we don't even use their map features :(
Eric Feng
@ehfeng
Jun 05 2017 05:22
dang
Arik Fraimovich
@arikfr
Jun 05 2017 05:22
I downgraded npm to v3 - npm i -g npm@3 and running npm install now. Will let you know in a few minutes if it helped.
Eric Feng
@ehfeng
Jun 05 2017 05:23
:thumbsup:
Arik Fraimovich
@arikfr
Jun 05 2017 05:24
it worked.
Eric Feng
@ehfeng
Jun 05 2017 05:26
ah ok
Arik Fraimovich
@arikfr
Jun 05 2017 05:42
worked? :)
Eric Feng
@ehfeng
Jun 05 2017 05:46
npm install did :)
but i'm still hitting the same internal error when tyring to load the page
working!
thanks @arikfr !
Arik Fraimovich
@arikfr
Jun 05 2017 05:51
yay :tada:
Eric Feng
@ehfeng
Jun 05 2017 05:56
i'm going to take a crack at turning TYPE_DATETIME into a real python datetime object
in the python runner
thoughts?
damn, hitting another error :/
worker_1    | Traceback (most recent call last):
worker_1    |   File "/usr/local/lib/python2.7/dist-packages/celery/app/trace.py", line 240, in trace_task
worker_1    |     R = retval = fun(*args, **kwargs)
worker_1    |   File "/app/redash/worker.py", line 69, in __call__
worker_1    |     return TaskBase.__call__(self, *args, **kwargs)
worker_1    |   File "/usr/local/lib/python2.7/dist-packages/celery/app/trace.py", line 438, in __protected_call__
worker_1    |     return self.run(*args, **kwargs)
worker_1    |   File "/app/redash/tasks/queries.py", line 511, in execute_query
worker_1    |     scheduled_query).run()
worker_1    |   File "/app/redash/tasks/queries.py", line 433, in run
worker_1    |     annotated_query = self._annotate_query(query_runner)
worker_1    |   File "/app/redash/tasks/queries.py", line 474, in _annotate_query
worker_1    |     if query_runner.annotate_query():
worker_1    | AttributeError: 'NoneType' object has no attribute 'annotate_query'
got the python data source working
Arik Fraimovich
@arikfr
Jun 05 2017 06:01
I assume you updated the env variables? you need to recreate the containers after that ...
Eric Feng
@ehfeng
Jun 05 2017 06:01
yup
ah
docker-compose rm?
Arik Fraimovich
@arikfr
Jun 05 2017 06:02
yes -> docker-compose stop worker && docker-compose rm worker && docker-compose create worker && docker-compose start worker
Eric Feng
@ehfeng
Jun 05 2017 06:02
ah cool
thanks
Arik Fraimovich
@arikfr
Jun 05 2017 06:04

i'm going to take a crack at turning TYPE_DATETIME into a real python datetime object

see the mongo query runner and how we hook into parsing json objects. maybe you can do the same here. although a simple loop over the rows after loading might work just as well :)

Eric Feng
@ehfeng
Jun 05 2017 06:04
cool
hmmm, still no luck
same AttributeError
Eric Feng
@ehfeng
Jun 05 2017 06:19
ooh nvm
need to manually restart workers
huh still nothing
Arik Fraimovich
@arikfr
Jun 05 2017 06:25
how your docker compose file looks like now?
Eric Feng
@ehfeng
Jun 05 2017 06:26
ah, i'm an idiot
i set REDASH_ADDITIONAL_QUERY_RUNNERS only for the server
not the worker
working now
phew!
Arik Fraimovich
@arikfr
Jun 05 2017 06:27
:thumbsup:
Eric Feng
@ehfeng
Jun 05 2017 06:27
thanks!
the docker set up is pretty sweet
way easier than installing sentry locally
(for development)
Arik Fraimovich
@arikfr
Jun 05 2017 06:28
happy to hear this! :)
I prefer to run things locally, but switched to using the Docker setup to use the same tools as other will be using...
Docker is nice and has many benefits, but I wish it was less resources hungry on a mac & had better IO performance.
Eric Feng
@ehfeng
Jun 05 2017 06:43
ah
it just seems pretty smooth
i prefer locally as well
but the docker instructions were wonderfully simple
Eric Feng
@ehfeng
Jun 05 2017 06:56
oh, damn
the local installation was much easier for me
:P
much better
ok, thanks for everything
Arik Fraimovich
@arikfr
Jun 05 2017 06:57
makes sense, as the stack is similar to sentry. you probably already have redis/pg installed. only issue I can think of is keys collision in Redis between Sentry and Redash. You might want to use a different database number for Redash
Arturs
@ArtursO
Jun 05 2017 13:12
@arikfr thanks for letting me know, I was sifting through github issues and gitter and it did seem like you had removed heroku support. Yeah it was a lil confusing cz I kept running into one documentation site and then the RTD one. Thanks for taking down the RTD one now, itll make things clearer :)
Are you still actively using the public "Redash Roadmap" Trello board? - https://trello.com/b/b2LUHU7A/redash-roadmap