New Install (invocation error)

I have installed HA 0.68.1 on a Raspberry Pi 3 running Gentoo Linux. The install completed without incident. I am using the default configuration created by HA with one addition. I added:

base_url: firewall:8123

to the html: entry.

Seconds after starting HA, I get the following error in the log:

2018-05-09 01:56:37 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/opt/homeassistant/lib/python3.5/site-packages/homeassistant/components/cloud/__init__.py", line 221, in async_start
    success = yield from self._fetch_jwt_keyset()
  File "/opt/homeassistant/lib/python3.5/site-packages/homeassistant/components/cloud/__init__.py", line 270, in _fetch_jwt_keyset
    req = yield from session.get(url)
  File "/opt/homeassistant/lib/python3.5/site-packages/aiohttp/client.py", line 320, in _request
    traces=traces
  File "/opt/homeassistant/lib/python3.5/site-packages/aiohttp/connector.py", line 418, in connect
    traces=traces
  File "/opt/homeassistant/lib/python3.5/site-packages/aiohttp/connector.py", line 733, in _create_connection
    traces=traces
  File "/opt/homeassistant/lib/python3.5/site-packages/aiohttp/connector.py", line 838, in _create_direct_connection
    req=req, client_error=client_error)
  File "/opt/homeassistant/lib/python3.5/site-packages/aiohttp/connector.py", line 797, in _wrap_create_connection
    return await self._loop.create_connection(*args, **kwargs)
  File "/usr/lib/python3.5/asyncio/base_events.py", line 731, in create_connection
    infos = f1.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
    raise self._exception
  File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/lib/python3.5/socket.py", line 733, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
TypeError: getaddrinfo() argument 1 must be string or None

Subsequently, everything I try causes the error again and again in the log, and I cannot get even a simple test of tts to work.

2018-05-09 01:58:31 ERROR (MainThread) [homeassistant.core] Error executing service <ServiceCall tts.google_say: entity_id=['media_player.d_office_speaker'], message=test>

followed by the same getaddrinfo() traceback error.

In another thread I have been trying to resolve the tts error. but now believe I need to resolve the initial getaddrinfo() error first, as it appears to be causing all the problems:

https://community.home-assistant.io/t/cant-get-tts-to-work-new-user/52635

Can anyone help me find/fix the getaddrinfo() error?

Thanks!

It’s probably because you have a colon in the name.

Change it to:

base_url: "firewall:8123"

Or it is possible that the component you are using segregated the port and it could be:

base_url: firewall
base_port: 8123

You should take a look at the components documentation and verify that it can except a port in the base_url.

Also, what is ‘firewall’? Does your os recognize that as an good url?

My local dns server recognizes “firewall”. It is setup in my dns which defaults to my local domain krautclan.com

The “:” is not part of the name. It is the delimiter between the name and the port number. The HA documentation example in the default config shows this from the generated configuration.yaml:

http:
  # Secrets are defined in the file secrets.yaml
  # api_password: !secret http_password
  # Uncomment this if you are using SSL/TLS, running in Docker container, etc.
  # base_url: example.duckdns.org:8123

I omit the domain name because my dns server searches for my domain automatically.

firewall:8123 (on my system) is the same as firewall.krautclan.com:8123
I have tried all of these, all with the same error result:

base_url: firewall:8123
base_url: firewall.krautclan.com:8123
base_url: localhost:8123
base_url: 192.168.1.71:8123
base_url: 127.0.0.1:8123

I have verified that port can be specified in the base_url. All the above still generate the getaddrinfo() error.

I will, however, try specifying base_port: separately as you suggest.

Pedro, as you suggest, I have changed the http item in my configuration to:

http:
  # Secrets are defined in the file secrets.yaml
  # api_password: !secret http_password
  # Uncomment this if you are using SSL/TLS, running in Docker container, etc.
  # base_url: example.duckdns.org:8123
  base_url: firewall.krautclan.com
  base_port: 8123

This generated the following error in the log (and HA exits):

Please check your config., title=Invalid config, notification_id=invalid_config, service=create, domain=persistent_notification>
2018-05-09 19:18:34 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: old_state=<state persistent_notification.invalid_config=notifying; message=The following components and platforms could not be set up:

Please advise…

Pedro, above, are you suggesting I add double quotes around the firewall:8123 string? I have not heard of that? Like:

base_url: "firewall:8123"

Pedro, after searching, I am unable to find any reference to “base_port:” in the HA documentation or elsewhere.

Please advise where you encountered this information.

When I originally suggested that, I wasn’t sure what component you were trying to set up. That was a shot in the dark. Now that I see you are using the http: component, your yaml is formatted correctly.

As for the double quotes, in some cases yaml needs to have quotes on things. I don’t think it’s needed for this scenario, but it won’t hurt. Yaml will treat it as a string regardless of the fact that it has quotes or not.

On to your problem. The root cause is the first argument in getaddrinfo must be a string. according to the error, that is your host name.

Are you sure your os sees your host name as firewall? can you temporarily turn your firewall off and specify the host as the pi’s IP? Verify that the error doesn’t persist then turn the firewall back on. I’m not sure it will help but at this point it’s one of 2 things, your firewall is causing problems or your install is borked.

Are you sure your os sees your host name as firewall?

100% sure.  I have been using it that way for years.  Besides, I tried it with IP, full doman name etc...
all without success.

an you temporarily turn your firewall off and specify the host as the pi’s IP?

my firewall is what runs my dns server.  It has been providing dns to my local network for years.

firewall is a linux server (an rpi) which runs my dns, named, dhcp, etc.  It uses iptables to provide routing to the outside world as well as firewall screening.  I am just using it to run homeassistant because it is a low power machine which is always up.

I’m not sure it will help but at this point it’s one of 2 things, your firewall is causing problems or your install is borked.

I have installed and reinstalled without incident. It comes right up with no problem, but for this error.
I expect there is something else wrong. Perhaps someone else can chime in? …suggestions re: what I can do to diagnose what is causing the problem, rather than trial and error.

well if it works without your firewall, then you can start with looking at your network. Good luck!

I can’t see why you need the base_url parameter. Are you using HA from outside your lan?

1 Like

I also just noticed that the error is coming from the cloud component. Just turn that off. You already have a dns, why use the cloud?

it should be in your config as:

cloud:

Edit comment it out with # or remove it all together.

#cloud:

I may not need it. I added it at other’s suggestions to try to solve the problem, which occurs with and without the base_url:

Got rid of cloud: error still occurs…

I have removed base_url: and the problem still remains. I will leave base_url: and cloud: commented out for now.

I am thinking this is a bug. I have reported it as an issue…

https://github.com/home-assistant/home-assistant/issues/14370

Petro, what do you mean “works without my firewall”. HA is running on my firewall…

The machine named “firewall” is on my local network, but also acts as a firewall to the outside via my iptables configuration.

So from an outside standpoint, the only difference you have that the 1000’s of other people have on this forum is your firewall, network, or device that is running home assistant. Typically when one troubleshoots an issue you strip everything back to the bare minimum and add complexity until it breaks. The last item you add is the culprit. I’m not sure why, but you seem unwilling to trouble shoot the hardware and point your finger at the software. Just my 2 cents.

Petro, I’m not sure what you mean…

I started with the bare mininum (default untouched clean install). All I added was base_url: and I removed that and also tried all other combinations of base_url:

When/how do I troubleshoot the hardware? I do not see any recommendations in this thread for doing so. I would be happy to troubleshoot in any way which might lead to a resolution. What hardware do you suggest I troubleshoot and how?

P.S. I have not heard anyone chime in saying they have google_say tts working with a Google Home.