dwyl / dwyl/auth

BUG: Get approles results in error 500

Open
#132 7 comments 1 reaction 0 assignees View on GitHub
bug priority-1
Dominant language
Elixir
Stars
141
Forks
8
PR merge metrics
No merged PRs in 30d

Description

When trying to run tests for Smart Home Security Server, I started getting error 500 from Auth.

Heroku logging spits out the following:

```
2020-10-01T15:00:03.600090+00:00 app[web.1]: Request: GET /approles/
2020-10-01T15:00:03.600090+00:00 app[web.1]: ** (exit) an exception was raised:
2020-10-01T15:00:03.600091+00:00 app[web.1]: ** (ArgumentError) session not fetched, call fetch_session/2
2020-10-01T15:00:03.600091+00:00 app[web.1]: (plug 1.10.4) lib/plug/conn.ex:1570: Plug.Conn.get_session/1
2020-10-01T15:00:03.600091+00:00 app[web.1]: (plug 1.10.4) lib/plug/conn.ex:1553: Plug.Conn.get_session/2
2020-10-01T15:00:03.600092+00:00 app[web.1]: (phoenix 1.5.4) lib/phoenix/controller.ex:1342: Phoenix.Controller.fetch_flash/2
2020-10-01T15:00:03.600092+00:00 app[web.1]: (auth 1.3.1) AuthWeb.Router.api/2
2020-10-01T15:00:03.600093+00:00 app[web.1]: (auth 1.3.1) lib/auth_web/router.ex:1: AuthWeb.Router.__pipe_through2__/1
2020-10-01T15:00:03.600093+00:00 app[web.1]: (phoenix 1.5.4) lib/phoenix/router.ex:347: Phoenix.Router.__call__/2
2020-10-01T15:00:03.600093+00:00 app[web.1]: (auth 1.3.1) lib/auth_web/endpoint.ex:1: AuthWeb.Endpoint.plug_builder_call/2
2020-10-01T15:00:03.600094+00:00 app[web.1]: (auth 1.3.1) lib/auth_web/endpoint.ex:1: AuthWeb.Endpoint.call/2
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the logged request to GET /approles/ and inspect AuthWeb.Router.api/2 in lib/auth_web/router.ex, then trace the Phoenix session and flash pipeline shown in the stack trace. Reproduce the request and identify why session access is reached without a fetched session. Done means the request no longer raises the reported error or returns HTTP 500.

Written by the indexing model from the issue text.

Assessment

Tech stack
elixir
Domain
api, authentication
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.