Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong default access_log_format in web.run_app #2649

Closed
azhpushkin opened this issue Jan 9, 2018 · 2 comments
Closed

Wrong default access_log_format in web.run_app #2649

azhpushkin opened this issue Jan 9, 2018 · 2 comments
Labels

Comments

@azhpushkin
Copy link
Contributor

Long story short

web.run_app does not provide correct default access_log_format, because of this None is being passed into AccessLogger.compile_format and causes an error. Because of this application cannot proceed requests correctly.

aiohttp/aiohttp/web.py

Lines 39 to 43 in 19c138c

def run_app(app, *, host=None, port=None, path=None, sock=None,
shutdown_timeout=60.0, ssl_context=None,
print=print, backlog=128, access_log_class=helpers.AccessLogger,
access_log_format=None, access_log=access_logger,
handle_signals=True):

Expected behaviour

Having helpers.AccessLogger.LOG_FORMAT as default value

Actual behaviour

None as default value for access log format

Steps to reproduce

from aiohttp import web

async def index(request):
    return web.Response()

app = web.Application()
app.router.add_get('/', index)
web.run_app(app, host='0.0.0.0', port=8080)

Querying 0.0.0.0:8080 returns nothing, stopping aiohttp produces following traceback before finish of the loop:

Task exception was never retrieved
future: <Task finished coro=<RequestHandler.start() done, defined at /.../aiohttp/aiohttp/web_protocol.py:343> exception=AttributeError("'RequestHandler' object has no attribute '_force_close'",)>
Traceback (most recent call last):
  File "/.../aiohttp/aiohttp/web_protocol.py", line 357, in start
    while not self._force_close:
AttributeError: 'RequestHandler' object has no attribute '_force_close'
@azhpushkin azhpushkin changed the title Wrong Wrong default access_log_format in web.run_app Jan 9, 2018
@azhpushkin
Copy link
Contributor Author

Closed in #2650

@lock
Copy link

lock bot commented Oct 28, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a [new issue] for related bugs.
If you feel like there's important points made in this discussion, please include those exceprts into that [new issue].
[new issue]: https://github.com/aio-libs/aiohttp/issues/new

@lock lock bot added the outdated label Oct 28, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant