beefproject / beefproject/beef
Unexpected error while processing request: undefined method `each' for nil:NilClass
- Dominant language
- JavaScript
- Stars
- 11k
- Forks
- 2.4k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 15
Description
Enabling `beef.http.debug: true` results in the following stacktrace when accessing the admin UI.
```
I, [2020-01-15T00:31:57.487248 #27751] INFO -- : Thin web server (v1.7.2 codename Bachmanity)
D, [2020-01-15T00:31:57.487294 #27751] DEBUG -- : Debugging ON
I, [2020-01-15T00:31:57.487338 #27751] INFO -- : Maximum connections set to 1024
I, [2020-01-15T00:31:57.487381 #27751] INFO -- : Listening on 0.0.0.0:3000, CTRL+C to stop
E, [2020-01-15T00:32:59.685733 #27751] ERROR -- : Unexpected error while processing request: undefined method `each' for nil:NilClass
/var/lib/gems/2.5.0/gems/rack-2.1.1/lib/rack/utils.rb:424:in `initialize'
/var/lib/gems/2.5.0/gems/rack-2.1.1/lib/rack/common_logger.rb:36:in `new'
/var/lib/gems/2.5.0/gems/rack-2.1.1/lib/rack/common_logger.rb:36:in `call'
/var/lib/gems/2.5.0/gems/sinatra-2.0.8.1/lib/sinatra/base.rb:231:in `call'
/var/lib/gems/2.5.0/gems/thin-1.7.2/lib/thin/connection.rb:86:in `block in pre_process'
/var/lib/gems/2.5.0/gems/thin-1.7.2/lib/thin/connection.rb:84:in `catch'
/var/lib/gems/2.5.0/gems/thin-1.7.2/lib/thin/connection.rb:84:in `pre_process'
/var/lib/gems/2.5.0/gems/thin-1.7.2/lib/thin/connection.rb:53:in `process'
/var/lib/gems/2.5.0/gems/thin-1.7.2/lib/thin/connection.rb:39:in `receive_data'
/var/lib/gems/2.5.0/gems/eventmachine-1.2.7/lib/eventmachine.rb:195:in `run_machine'
/var/lib/gems/2.5.0/gems/eventmachine-1.2.7/lib/eventmachine.rb:195:in `run'
/var/lib/gems/2.5.0/gems/thin-1.7.2/lib/thin/backends/base.rb:73:in `start'
/var/lib/gems/2.5.0/gems/thin-1.7.2/lib/thin/server.rb:162:in `start'
/root/Desktop/beef/core/main/server.rb:165:in `start'
./beef:232:in `'
```
Contributor guide
Research direction
Reproduce the failure by enabling `beef.http.debug: true` and opening the admin UI. Start at `core/main/server.rb:165`, then inspect the Rack CommonLogger and `rack/utils.rb:424` frames; done means the admin UI request no longer raises the reported `each`-on-nil error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100