Login not working

i am having troubles login in to my instance. i have set up a admin user in plausible-conf.env. once started with docker, the login does not work though. it keeps telling me “Wrong email or password. Please try again”

what do i do wrong?

also, how exactly can i use “db init-admin” to change those things maybe :frowning: ? what to do with that?

many thansk in advance!

nevermind. fixed it. did not know to edit the settings without {} brackets :stuck_out_tongue:

good to hear, thanks for reporting!

Hi, I have a similar problem except that I have correct plausible-conf.env:
ADMIN_USER_EMAIL=myemail@domain.com
ADMIN_USER_NAME=myusername
ADMIN_USER_PWD=mypassword
BASE_URL=http://docker.adhash.org:8000
SECRET_KEY_BASE=generated key
MAILER_EMAIL=myemail@domain.com
SMTP_HOST_ADDR=smtphost.com
SMTP_HOST_PORT=465
SMTP_USER_NAME=mystmtp_user
SMTP_USER_PWD=mysmtp_password
SMTP_HOST_SSL_ENABLED=true
SMTP_RETRIES=2
docker containers are up:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
0fe06b5f5f3c plausible/analytics:latest “/entrypoint.sh sh -…” 17 seconds ago Up 15 seconds 0.0.0.0:8000->8000/tcp hosting_plausible_1
b78f3bb540e6 yandex/clickhouse-server:latest “/entrypoint.sh” 28 seconds ago Up 18 seconds 8123/tcp, 9000/tcp, 9009/tcp hosting_plausible_events_db_1
81decc5cfcdd postgres:12 “docker-entrypoint.s…” 28 seconds ago Up 19 seconds 5432/tcp hosting_plausible_db_1
33bcf728be2e bytemark/smtp “docker-entrypoint.s…” 28 seconds ago Up 16 seconds 25/tcp hosting_mail_1
########################################
I’m trying to login with email in ADMIN_USER_EMAIL with given password and it says: Wrong email or password. Please try again.
When I try with DISABLE_AUTH=true and without additional custom mail server parameters I’ve go the error 500 and this in docker logs:
Loading plausible…
Starting dependencies…
Starting repos…
create Plausible.Repo database if it doesn’t exist
create Plausible.ClickhouseRepo database if it doesn’t exist
Creation of Db successful!
Loading plausible…
Starting dependencies…
Starting repos…
Running migrations for Elixir.Plausible.Repo
Running migrations for Elixir.Plausible.ClickhouseRepo
Migrations successful!
Loading plausible…
Starting dependencies…
Starting repos…
Admin user already exists. I won’t override, bailing
12:05:44.000 request_id=Fj4o85INDxNJ9EYAAAAh [warn] Failed to send Sentry event.Cannot send Sentry event because of invalid DSN
12:05:44.005 request_id=Fj4o85INDxNJ9EYAAAAh [warn] Failed to send Sentry event.Cannot send Sentry event because of invalid DSN
12:05:44.007 [error] #PID<0.4415.0> running PlausibleWeb.Endpoint (connection #PID<0.4414.0>, stream id 1) terminated
Server: docker.adhash.org:8000 (http)
Request: GET /
** (exit) an exception was raised:
** (Phoenix.Template.UndefinedError) Could not render “login_form.html” for PlausibleWeb.PageView, please define a matching clause for render/2 or define a template at “lib/plausible_web/templates/page/*”. The following templates were compiled:

  • index.html

Assigns:

%{conn: %Plug.Conn{adapter: {Plug.Cowboy.Conn, :…}, assigns: %{error: “Wrong email or password. Please try again.”, layout: {PlausibleWeb.LayoutView, “focus.html”}}, before_send: [#Function<0.39862366/1 in Plug.CSRFProtection.call/2>, #Function<2.7727837/1 in Phoenix.Controller.fetch_flash/2>, #Function<0.29283909/1 in Plug.Session.before_send/2>, #Function<1.129014997/1 in Plug.Logger.call/2>], body_params: %{}, cookies: %{"_plausible_key" => “SFMyNTY.g3QAAAABbQAAAApsb2dpbl9kZXN0bQAAAAEv.BT-8mqaZPw9AwsuumMQborv2VP9IZk3PQhlZh2KmfVI”}, halted: false, host: “docker.adhash.org”, method: “GET”, owner: #PID<0.4415.0>, params: %{}, path_info: [], path_params: %{}, port: 8000, private: %{PlausibleWeb.Router => {[], %{}}, :phoenix_action => :index, :phoenix_controller => PlausibleWeb.PageController, :phoenix_endpoint => PlausibleWeb.Endpoint, :phoenix_flash => %{}, :phoenix_format => “html”, :phoenix_layout => {PlausibleWeb.LayoutView, :app}, :phoenix_router => PlausibleWeb.Router, :phoenix_template => “login_form.html”, :phoenix_view => PlausibleWeb.PageView, :plug_session => %{“login_dest” => “/”}, :plug_session_fetch => :done}, query_params: %{}, query_string: “”, remote_ip: {193, 178, 166, 31}, req_cookies: %{"_plausible_key" => “SFMyNTY.g3QAAAABbQAAAApsb2dpbl9kZXN0bQAAAAEv.BT-8mqaZPw9AwsuumMQborv2VP9IZk3PQhlZh2KmfVI”}, req_headers: [{“accept”, “text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.9”}, {“accept-encoding”, “gzip, deflate”}, {“accept-language”, “en-US,en;q=0.9,bg-BG;q=0.8,bg;q=0.7,ru;q=0.6,de;q=0.5,fr;q=0.4,hu;q=0.3”}, {“cache-control”, “max-age=0”}, {“connection”, “keep-alive”}, {“cookie”, “_plausible_key=SFMyNTY.g3QAAAABbQAAAApsb2dpbl9kZXN0bQAAAAEv.BT-8mqaZPw9AwsuumMQborv2VP9IZk3PQhlZh2KmfVI”}, {“host”, “docker.adhash.org:8000”}, {“upgrade-insecure-requests”, “1”}, {“user-agent”, “Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Safari/537.36”}], request_path: “/”, resp_body: nil, resp_cookies: %{}, resp_headers: [{“cache-control”, “max-age=0, private, must-revalidate”}, {“x-request-id”, “Fj4o85INDxNJ9EYAAAAh”}, {“access-control-allow-origin”, “*”}, {“access-control-expose-headers”, “”}, {“access-control-allow-credentials”, “true”}, {“x-frame-options”, “SAMEORIGIN”}, {“x-xss-protection”, “1; mode=block”}, {“x-content-type-options”, “nosniff”}, {“x-download-options”, “noopen”}, {“x-permitted-cross-domain-policies”, “none”}, {“cross-origin-window-policy”, “deny”}], scheme: :http, script_name: [], secret_key_base: :…, state: :unset, status: nil}, error: “Wrong email or password. Please try again.”, view_module: PlausibleWeb.PageView, view_template: “login_form.html”}

Assigned keys: [:conn, :error, :view_module, :view_template]

    (phoenix 1.4.17) lib/phoenix/template.ex:341: Phoenix.Template.raise_template_not_found/3
    (plausible 0.0.1) lib/plausible_web/templates/layout/focus.html.eex:20: PlausibleWeb.LayoutView."focus.html"/1
    (phoenix 1.4.17) lib/phoenix/view.ex:410: Phoenix.View.render_to_iodata/3
    (phoenix 1.4.17) lib/phoenix/controller.ex:776: Phoenix.Controller.__put_render__/5
    (phoenix 1.4.17) lib/phoenix/controller.ex:792: Phoenix.Controller.instrument_render_and_send/4
    (plausible 0.0.1) lib/plausible_web/plugs/auto_auth_plug.ex:13: PlausibleWeb.AutoAuthPlug.call/2
    (plausible 0.0.1) lib/plausible_web/controllers/page_controller.ex:1: PlausibleWeb.PageController.phoenix_controller_pipeline/2
    (phoenix 1.4.17) lib/phoenix/router.ex:288: Phoenix.Router.__call__/2

12:05:51.350 request_id=Fj4o9Ui4VQ8a6OkAAABh [warn] Failed to send Sentry event.Cannot send Sentry event because of invalid DSN
12:05:51.356 request_id=Fj4o9Ui4VQ8a6OkAAABh [warn] Failed to send Sentry event.Cannot send Sentry event because of invalid DSN
12:05:51.359 [error] #PID<0.4424.0> running PlausibleWeb.Endpoint (connection #PID<0.4422.0>, stream id 1) terminated
Server: docker.adhash.org:8000 (http)
Request: GET /
** (exit) an exception was raised:
** (Phoenix.Template.UndefinedError) Could not render “login_form.html” for PlausibleWeb.PageView, please define a matching clause for render/2 or define a template at “lib/plausible_web/templates/page/*”. The following templates were compiled:

  • index.html

Assigns:

%{conn: %Plug.Conn{adapter: {Plug.Cowboy.Conn, :…}, assigns: %{error: “Wrong email or password. Please try again.”, layout: {PlausibleWeb.LayoutView, “focus.html”}}, before_send: [#Function<0.39862366/1 in Plug.CSRFProtection.call/2>, #Function<2.7727837/1 in Phoenix.Controller.fetch_flash/2>, #Function<0.29283909/1 in Plug.Session.before_send/2>, #Function<1.129014997/1 in Plug.Logger.call/2>], body_params: %{}, cookies: %{"_plausible_key" => “SFMyNTY.g3QAAAABbQAAAApsb2dpbl9kZXN0bQAAAAEv.BT-8mqaZPw9AwsuumMQborv2VP9IZk3PQhlZh2KmfVI”}, halted: false, host: “docker.adhash.org”, method: “GET”, owner: #PID<0.4424.0>, params: %{}, path_info: [], path_params: %{}, port: 8000, private: %{PlausibleWeb.Router => {[], %{}}, :phoenix_action => :index, :phoenix_controller => PlausibleWeb.PageController, :phoenix_endpoint => PlausibleWeb.Endpoint, :phoenix_flash => %{}, :phoenix_format => “html”, :phoenix_layout => {PlausibleWeb.LayoutView, :app}, :phoenix_router => PlausibleWeb.Router, :phoenix_template => “login_form.html”, :phoenix_view => PlausibleWeb.PageView, :plug_session => %{“login_dest” => “/”}, :plug_session_fetch => :done}, query_params: %{}, query_string: “”, remote_ip: {193, 178, 166, 31}, req_cookies: %{"_plausible_key" => “SFMyNTY.g3QAAAABbQAAAApsb2dpbl9kZXN0bQAAAAEv.BT-8mqaZPw9AwsuumMQborv2VP9IZk3PQhlZh2KmfVI”}, req_headers: [{“accept”, “text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.9”}, {“accept-encoding”, “gzip, deflate”}, {“accept-language”, “en-US,en;q=0.9,bg-BG;q=0.8,bg;q=0.7,ru;q=0.6,de;q=0.5,fr;q=0.4,hu;q=0.3”}, {“cache-control”, “max-age=0”}, {“connection”, “keep-alive”}, {“cookie”, “_plausible_key=SFMyNTY.g3QAAAABbQAAAApsb2dpbl9kZXN0bQAAAAEv.BT-8mqaZPw9AwsuumMQborv2VP9IZk3PQhlZh2KmfVI”}, {“host”, “docker.adhash.org:8000”}, {“upgrade-insecure-requests”, “1”}, {“user-agent”, “Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Safari/537.36”}], request_path: “/”, resp_body: nil, resp_cookies: %{}, resp_headers: [{“cache-control”, “max-age=0, private, must-revalidate”}, {“x-request-id”, “Fj4o9Ui4VQ8a6OkAAABh”}, {“access-control-allow-origin”, “*”}, {“access-control-expose-headers”, “”}, {“access-control-allow-credentials”, “true”}, {“x-frame-options”, “SAMEORIGIN”}, {“x-xss-protection”, “1; mode=block”}, {“x-content-type-options”, “nosniff”}, {“x-download-options”, “noopen”}, {“x-permitted-cross-domain-policies”, “none”}, {“cross-origin-window-policy”, “deny”}], scheme: :http, script_name: [], secret_key_base: :…, state: :unset, status: nil}, error: “Wrong email or password. Please try again.”, view_module: PlausibleWeb.PageView, view_template: “login_form.html”}

Assigned keys: [:conn, :error, :view_module, :view_template]

    (phoenix 1.4.17) lib/phoenix/template.ex:341: Phoenix.Template.raise_template_not_found/3
    (plausible 0.0.1) lib/plausible_web/templates/layout/focus.html.eex:20: PlausibleWeb.LayoutView."focus.html"/1
    (phoenix 1.4.17) lib/phoenix/view.ex:410: Phoenix.View.render_to_iodata/3
    (phoenix 1.4.17) lib/phoenix/controller.ex:776: Phoenix.Controller.__put_render__/5
    (phoenix 1.4.17) lib/phoenix/controller.ex:792: Phoenix.Controller.instrument_render_and_send/4
    (plausible 0.0.1) lib/plausible_web/plugs/auto_auth_plug.ex:13: PlausibleWeb.AutoAuthPlug.call/2
    (plausible 0.0.1) lib/plausible_web/controllers/page_controller.ex:1: PlausibleWeb.PageController.phoenix_controller_pipeline/2
    (phoenix 1.4.17) lib/phoenix/router.ex:288: Phoenix.Router.__call__/2

12:05:52.026 request_id=Fj4o9XEF2bEPPjgAAACB [warn] Failed to send Sentry event.Cannot send Sentry event because of invalid DSN
12:05:52.030 request_id=Fj4o9XEF2bEPPjgAAACB [warn] Failed to send Sentry event.Cannot send Sentry event because of invalid DSN
12:05:52.032 [error] #PID<0.4426.0> running PlausibleWeb.Endpoint (connection #PID<0.4422.0>, stream id 3) terminated
Server: docker.adhash.org:8000 (http)
Request: GET /
** (exit) an exception was raised:
** (Phoenix.Template.UndefinedError) Could not render “login_form.html” for PlausibleWeb.PageView, please define a matching clause for render/2 or define a template at “lib/plausible_web/templates/page/*”. The following templates were compiled:

  • index.html

Assigns:

%{conn: %Plug.Conn{adapter: {Plug.Cowboy.Conn, :…}, assigns: %{error: “Wrong email or password. Please try again.”, layout: {PlausibleWeb.LayoutView, “focus.html”}}, before_send: [#Function<0.39862366/1 in Plug.CSRFProtection.call/2>, #Function<2.7727837/1 in Phoenix.Controller.fetch_flash/2>, #Function<0.29283909/1 in Plug.Session.before_send/2>, #Function<1.129014997/1 in Plug.Logger.call/2>], body_params: %{}, cookies: %{"_plausible_key" => “SFMyNTY.g3QAAAABbQAAAApsb2dpbl9kZXN0bQAAAAEv.BT-8mqaZPw9AwsuumMQborv2VP9IZk3PQhlZh2KmfVI”}, halted: false, host: “docker.adhash.org”, method: “GET”, owner: #PID<0.4426.0>, params: %{}, path_info: [], path_params: %{}, port: 8000, private: %{PlausibleWeb.Router => {[], %{}}, :phoenix_action => :index, :phoenix_controller => PlausibleWeb.PageController, :phoenix_endpoint => PlausibleWeb.Endpoint, :phoenix_flash => %{}, :phoenix_format => “html”, :phoenix_layout => {PlausibleWeb.LayoutView, :app}, :phoenix_router => PlausibleWeb.Router, :phoenix_template => “login_form.html”, :phoenix_view => PlausibleWeb.PageView, :plug_session => %{“login_dest” => “/”}, :plug_session_fetch => :done}, query_params: %{}, query_string: “”, remote_ip: {193, 178, 166, 31}, req_cookies: %{"_plausible_key" => “SFMyNTY.g3QAAAABbQAAAApsb2dpbl9kZXN0bQAAAAEv.BT-8mqaZPw9AwsuumMQborv2VP9IZk3PQhlZh2KmfVI”}, req_headers: [{“accept”, “text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.9”}, {“accept-encoding”, “gzip, deflate”}, {“accept-language”, “en-US,en;q=0.9,bg-BG;q=0.8,bg;q=0.7,ru;q=0.6,de;q=0.5,fr;q=0.4,hu;q=0.3”}, {“cache-control”, “max-age=0”}, {“connection”, “keep-alive”}, {“cookie”, “_plausible_key=SFMyNTY.g3QAAAABbQAAAApsb2dpbl9kZXN0bQAAAAEv.BT-8mqaZPw9AwsuumMQborv2VP9IZk3PQhlZh2KmfVI”}, {“host”, “docker.adhash.org:8000”}, {“upgrade-insecure-requests”, “1”}, {“user-agent”, “Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Safari/537.36”}], request_path: “/”, resp_body: nil, resp_cookies: %{}, resp_headers: [{“cache-control”, “max-age=0, private, must-revalidate”}, {“x-request-id”, “Fj4o9XEF2bEPPjgAAACB”}, {“access-control-allow-origin”, “*”}, {“access-control-expose-headers”, “”}, {“access-control-allow-credentials”, “true”}, {“x-frame-options”, “SAMEORIGIN”}, {“x-xss-protection”, “1; mode=block”}, {“x-content-type-options”, “nosniff”}, {“x-download-options”, “noopen”}, {“x-permitted-cross-domain-policies”, “none”}, {“cross-origin-window-policy”, “deny”}], scheme: :http, script_name: [], secret_key_base: :…, state: :unset, status: nil}, error: “Wrong email or password. Please try again.”, view_module: PlausibleWeb.PageView, view_template: “login_form.html”}

Assigned keys: [:conn, :error, :view_module, :view_template]

    (phoenix 1.4.17) lib/phoenix/template.ex:341: Phoenix.Template.raise_template_not_found/3
    (plausible 0.0.1) lib/plausible_web/templates/layout/focus.html.eex:20: PlausibleWeb.LayoutView."focus.html"/1
    (phoenix 1.4.17) lib/phoenix/view.ex:410: Phoenix.View.render_to_iodata/3
    (phoenix 1.4.17) lib/phoenix/controller.ex:776: Phoenix.Controller.__put_render__/5
    (phoenix 1.4.17) lib/phoenix/controller.ex:792: Phoenix.Controller.instrument_render_and_send/4
    (plausible 0.0.1) lib/plausible_web/plugs/auto_auth_plug.ex:13: PlausibleWeb.AutoAuthPlug.call/2
    (plausible 0.0.1) lib/plausible_web/controllers/page_controller.ex:1: PlausibleWeb.PageController.phoenix_controller_pipeline/2
    (phoenix 1.4.17) lib/phoenix/router.ex:288: Phoenix.Router.__call__/2

Thanks in advance.

@Svetoslav I had an issue logging in with admin credentials myself. In my case, I had messed up the configuration file so the email address was followed by a tab character.

Can you try something like this and show the output of the commands on your server?

root@plausible-testing:~/hosting# docker-compose exec plausible /app/bin/plausible remote
Erlang/OTP 22 [erts-10.7.2] [source] [64-bit] [smp:1:1] [ds:1:1:10] [async-threads:1] [hipe]

Interactive Elixir (1.10.3) - press Ctrl+C to exit (type h() ENTER for help)
iex(plausible@decf0147d4a7)1> Plausible.Auth.find_user_by(email: "myemail@domain.com")
iex(plausible@decf0147d4a7)2> Plausible.Repo.all(Plausible.Auth.User)