Skip to content

Fix unexpected error thrown if instance_domain is not set#23615

Merged
balloob merged 1 commit intohome-assistant:devfrom
robbiet480:cloud-instance-domain-fix
May 2, 2019
Merged

Fix unexpected error thrown if instance_domain is not set#23615
balloob merged 1 commit intohome-assistant:devfrom
robbiet480:cloud-instance-domain-fix

Conversation

@robbiet480
Copy link
Copy Markdown
Contributor

@robbiet480 robbiet480 commented May 2, 2019

Fixes this error that mobile_app users that don't use cloud are getting, which causes a 500 and registration to fail:

Log Details (ERROR)
Wed May 01 2019 21:32:02 GMT-0400 (Eastern Daylight Time)
Error handling request
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 418, in start
    resp = await task
  File "/srv/homeassistant/lib/python3.6/site-packages/aiohttp/web_app.py", line 458, in _handle
    resp = await handler(request)
  File "/srv/homeassistant/lib/python3.6/site-packages/aiohttp/web_middlewares.py", line 119, in impl
    return await handler(request)
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/http/real_ip.py", line 33, in real_ip_middleware
    return await handler(request)
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/http/ban.py", line 68, in ban_middleware
    return await handler(request)
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/http/auth.py", line 216, in auth_middleware
    return await handler(request)
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/http/view.py", line 115, in handle
    result = await result
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/http/data_validator.py", line 46, in wrapper
    result = await method(view, request, *args, **kwargs)
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/mobile_app/http_api.py", line 57, in post
    remote_ui_url = async_remote_ui_url(hass)
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/cloud/__init__.py", line 125, in async_remote_ui_url
    return "https://" + hass.data[DOMAIN].remote.instance_domain
TypeError: must be str, not NoneType

Thanks to @arsaboo

home-assistant/iOS#299

@robbiet480 robbiet480 requested a review from a team as a code owner May 2, 2019 01:37
@ghost
Copy link
Copy Markdown

ghost commented May 2, 2019

Hey there @home-assistant/core, mind taking a look at this pull request as its been labeled with a integration (cloud) you are listed as a codeowner for? Thanks!

This is a automatic comment generated by codeowners-mention to help ensure issues and pull requests are seen by the right people.

Copy link
Copy Markdown
Member

@andrewsayre andrewsayre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be tagged for 0.92.2?

@robbiet480 robbiet480 added this to the 0.92.2 milestone May 2, 2019
@balloob balloob merged commit d1e44e3 into home-assistant:dev May 2, 2019
@balloob balloob mentioned this pull request May 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants