Issue Summary

when passing invalid email/password validation error about wrong email/password comes
but when passing valid nothing happen on login page

Technical details:

  • Redash Version: latest docker image
  • Browser/OS: MacOs
  • How did you install Redash: Docker Image

docker-compose.yml

users table

.redash-env file

What do you see in your docker logs after making this request?

docker-compose logs redash-server

Also, just making sure: do you have a redis instance configured? It doesn’t appear in the portion of the docker-compose.yml you shared.

I have redis and postgres too, only mail server is not added

logs when trying to login

Please paste the text of the logs.

[2022-04-13 18:51:18,217][PID:179][INFO][metrics] method=POST path=/login endpoint=redash_login status=302 content_type=text/html; charset=utf-8 content_length=209 duration=391.99 query_count=2 query_duration=13.86

[2022-04-13 18:51:18,257][PID:179][INFO][metrics] method=GET path=/ endpoint=redash_index status=302 content_type=text/html; charset=utf-8 content_length=305 duration=1.25 query_count=0 query_duration=0.00

[2022-04-13 18:51:18,780][PID:207][INFO][metrics] method=GET path=/login endpoint=redash_login status=200 content_type=text/html; charset=utf-8 content_length=1827 duration=486.30 query_count=1 query_duration=17.78

[2022-04-13 18:51:19,031][PID:179][INFO][metrics] method=GET path=/static/server.5cdfe7b4f652b665b03f.css.map endpoint=static status=200 content_type=application/octet-stream content_length=237902 duration=1.53 query_count=0 query_duration=0.00

302 getting when sending POST request

Your logs look normal.

When you successfully log-in you’ll be 302 redirected to the / page.

here’s what my logs look like running the latest version. The first event is when I visit the /login endpoint as an unauthenticated user. You see the request first to / and then to static/server... to get the bundle of react files Etc.


server_1     | [2022-04-13 18:51:52,209][PID:20][INFO][werkzeug] 192.168.96.1 - - [13/Apr/2022 18:51:52] "GET /login HTTP/1.1" 200 -
server_1     | [2022-04-13 18:51:52,278][PID:20][INFO][werkzeug] 192.168.96.1 - - [13/Apr/2022 18:51:52] "GET /static/server.aa77f4f20b199cd05db9.css HTTP/1.1" 200 -
server_1     | [2022-04-13 18:51:52,282][PID:20][INFO][werkzeug] 192.168.96.1 - - [13/Apr/2022 18:51:52] "GET /static/images/google_logo.svg HTTP/1.1" 200 -
server_1     | [2022-04-13 18:52:31,522][PID:20][INFO][werkzeug] 192.168.96.1 - - [13/Apr/2022 18:52:31] "POST /login HTTP/1.1" 302 -
server_1     | [2022-04-13 18:52:31,542][PID:20][INFO][werkzeug] 192.168.96.1 - - [13/Apr/2022 18:52:31] "GET / HTTP/1.1" 200 -
server_1     | [2022-04-13 18:52:31,727][PID:20][INFO][werkzeug] 192.168.96.1 - - [13/Apr/2022 18:52:31] "GET /static/app.6dda3ef022941ea4eb3b.css HTTP/1.1" 200 -
server_1     | [2022-04-13 18:52:31,730][PID:20][INFO][werkzeug] 192.168.96.1 - - [13/Apr/2022 18:52:31] "GET /static/vendors~app.ec098cf80b4fe339ed0e.css HTTP/1.1" 200 -
server_1     | [2022-04-13 18:52:31,748][PID:20][INFO][werkzeug] 192.168.96.1 - - [13/Apr/2022 18:52:31] "GET /static/vendors~app.ec098cf80b4fe339ed0e.js HTTP/1.1" 200 -
server_1     | [2022-04-13 18:52:31,752][PID:20][INFO][werkzeug] 192.168.96.1 - - [13/Apr/2022 18:52:31] "GET /static/app.6dda3ef022941ea4eb3b.js HTTP/1.1" 200 -
server_1     | [2022-04-13 18:52:31,762][PID:20][INFO][werkzeug] 192.168.96.1 - - [13/Apr/2022 18:52:31] "GET /static/unsupportedRedirect.js HTTP/1.1" 200 -
server_1     | [2022-04-13 18:52:32,275][PID:20][INFO][werkzeug] 192.168.96.1 - - [13/Apr/2022 18:52:32] "GET /api/session HTTP/1.1" 200 -
server_1     | [2022-04-13 18:52:32,298][PID:20][INFO][werkzeug] 192.168.96.1 - - [13/Apr/2022 18:52:32] "GET /api/organization/status HTTP/1.1" 200 -
server_1     | [2022-04-13 18:52:32,416][PID:20][INFO][werkzeug] 192.168.96.1 - - [13/Apr/2022 18:52:32] "GET /static/fonts/fontawesome-webfont.af7ae50.woff2 HTTP/1.1" 200 -
server_1     | [2022-04-13 18:52:32,421][PID:20][INFO][werkzeug] 192.168.96.1 - - [13/Apr/2022 18:52:32] "GET /static/images/illustrations/dashboard.svg HTTP/1.1" 200 -
server_1     | [2022-04-13 18:52:32,422][PID:20][INFO][werkzeug] 192.168.96.1 - - [13/Apr/2022 18:52:32] "GET /api/dashboards/favorites HTTP/1.1" 200 -
server_1     | [2022-04-13 18:52:32,449][PID:20][INFO][werkzeug] 192.168.96.1 - - [13/Apr/2022 18:52:32] "GET /api/queries/favorites HTTP/1.1" 200 -
server_1     | [2022-04-13 18:52:33,358][PID:20][INFO][werkzeug] 192.168.96.1 - - [13/Apr/2022 18:52:33] "POST /api/events HTTP/1.1" 200 -

Comparing healthy logs to yours:

Healthy:

  1. You POST to /login → response is a 302 to /
  2. You GET to / → response is the homepage

Your situation:

  1. You POST to /login → response is a 302 to /
  2. You get / → response is a 302 back to /login

The fact that the response to your first request is a 302 indicates that authentication succeeded. But for whatever reason, the authentication cookie doesn’t “stick” after that. So when you visit / the app doesn’t see an authenticated user and it redirects.

There could be a lot of causes for this.

  • Your browser is not storing any cookies whatsoever
  • The webserver memory is faulty
  • The user record could be corrupted
  • There could be bad HTTPS settings so that requests to / are always redirected as HTTPS but POSTS to /login are redirected using HTTP.

(post deleted by author)

I have these table after running createdb script, but how can I create visualizations, widgets and other tables?

Strange that those tables don’t appear…can you try running SHOW TABLES rather than using the pgcli \dt command? If you run select * from alerts limit 1 do you receive an error?

What exact command did you run to create the tables? It should have been docker-compose run --rm server create_db