home-assistant / supervisor

:house_with_garden: Home Assistant Supervisor
https://home-assistant.io/hassio/
Apache License 2.0
1.78k stars 649 forks source link

"Cannot connect to host" with Google, Telegram, Yahoo... #305

Closed prigal closed 6 years ago

prigal commented 6 years ago

After update to 0.60.2, hassio can't connect to online apis and services.

Thread on forum : https://community.home-assistant.io/t/strange-cannot-connect-to-host-issue/37467

Google calendar :

2018-01-10 14:07:20 ERROR (MainThread) [homeassistant.components.calendar] Error while setting up platform google
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/httplib2/__init__.py", line 995, in _conn_request
    conn.connect()
  File "/usr/lib/python3.6/http/client.py", line 1392, in connect
    super().connect()
  File "/usr/lib/python3.6/http/client.py", line 936, in connect
    (self.host,self.port), self.timeout, self.source_address)
  File "/usr/lib/python3.6/socket.py", line 704, in create_connection
    for res in getaddrinfo(host, port, 0, SOCK_STREAM):
  File "/usr/lib/python3.6/socket.py", line 745, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -3] Try again

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_component.py", line 171, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT, loop=self.hass.loop)
  File "/usr/lib/python3.6/asyncio/tasks.py", line 358, in wait_for
    return fut.result()
  File "/usr/lib/python3.6/asyncio/futures.py", line 245, in result
    raise self._exception
  File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/lib/python3.6/site-packages/homeassistant/components/calendar/google.py", line 39, in setup_platform
    for data in disc_info[CONF_ENTITIES] if data[CONF_TRACK]])
  File "/usr/lib/python3.6/site-packages/homeassistant/components/calendar/google.py", line 39, in <listcomp>
    for data in disc_info[CONF_ENTITIES] if data[CONF_TRACK]])
  File "/usr/lib/python3.6/site-packages/homeassistant/components/calendar/google.py", line 49, in __init__
    super().__init__(hass, data)
  File "/usr/lib/python3.6/site-packages/homeassistant/components/calendar/__init__.py", line 72, in __init__
    self.update()
  File "/usr/lib/python3.6/site-packages/homeassistant/components/calendar/__init__.py", line 138, in update
    if not self.data or not self.data.update():
  File "/usr/lib/python3.6/site-packages/homeassistant/util/__init__.py", line 306, in wrapper
    result = method(*args, **kwargs)
  File "/usr/lib/python3.6/site-packages/homeassistant/components/calendar/google.py", line 65, in update
    service = self.calendar_service.get()
  File "/usr/lib/python3.6/site-packages/homeassistant/components/google.py", line 249, in get
    'calendar', 'v3', http=http, cache_discovery=False)
  File "/usr/lib/python3.6/site-packages/oauth2client/_helpers.py", line 133, in positional_wrapper
    return wrapped(*args, **kwargs)
  File "/usr/lib/python3.6/site-packages/googleapiclient/discovery.py", line 229, in build
    requested_url, discovery_http, cache_discovery, cache)
  File "/usr/lib/python3.6/site-packages/googleapiclient/discovery.py", line 276, in _retrieve_discovery_doc
    resp, content = http.request(actual_url)
  File "/usr/lib/python3.6/site-packages/oauth2client/transport.py", line 175, in new_request
    redirections, connection_type)
  File "/usr/lib/python3.6/site-packages/oauth2client/transport.py", line 282, in request
    connection_type=connection_type)
  File "/usr/lib/python3.6/site-packages/httplib2/__init__.py", line 1322, in request
    (response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
  File "/usr/lib/python3.6/site-packages/httplib2/__init__.py", line 1072, in _request
    (response, content) = self._conn_request(conn, request_uri, method, body, headers)
  File "/usr/lib/python3.6/site-packages/httplib2/__init__.py", line 1002, in _conn_request
    raise ServerNotFoundError("Unable to find the server at %s" % conn.host)
httplib2.ServerNotFoundError: Unable to find the server at www.googleapis.com

Google maps :

2018-01-10 14:31:52 ERROR (MainThread) [homeassistant.components.camera.generic] Error getting new camera image: Cannot connect to host maps.googleapis.com:443 ssl:True [Try again]

Telegram :

2018-01-10 14:32:00 ERROR (MainThread) [homeassistant.components.telegram_bot.polling] Cannot connect to host api.telegram.org:443 ssl:True [Try again]
prigal commented 6 years ago

Some log found in hassio logs, not sure it's relevant :

18-01-10 13:06:25 WARNING (MainThread) [hassio.tasks] Watchdog found a problem with Home-Assistant docker!

pvizeli commented 6 years ago

Can you post the http configuration?

pvizeli commented 6 years ago

Like describe here: https://home-assistant.io/components/http/

Can you remove the server_host options from config and retry it?

prigal commented 6 years ago

I don't have server_host option in my config

http:
  # Uncomment this to add a password (recommended!)
  api_password: !secret http_password
  # Uncomment this if you are using SSL or running in Docker etc
  base_url: https://****.duckdns.org:8123
  ssl_certificate: /ssl/fullchain.pem
  ssl_key: /ssl/privkey.pem
pvizeli commented 6 years ago

What is you host system? With generic system, what is your docker version?

If you have host access, please report: docker inspect homeassistant docker inspect hassio_supervisor (resin_supervisor on resinos) docker inspect hassio docker exec homeassistant cat /etc/resolv.conf docker exec hassio_supervisor cat /etc/resolv.conf

prigal commented 6 years ago

Sorry, I can't access to host, it's a pi3 with default hassio installation.

I only have ssh access to hassio container, not to host. I need a physical access to PI to open access to host and I'm at work actually.

Some info from container :

core-ssh:~# cat /etc/resolv.conf
nameserver 127.0.0.11
options ndots:0
core-ssh:~# hassio network info
{
    "result": "ok",
    "data": {
        "hostname": "hassio"
    }
}
core-ssh:~# hassio network options
{
    "result": "ok",
    "data": {}
}
core-ssh:~# hassio supervisor info
{
    "result": "ok",
    "data": {
        "version": "0.81",
        "last_version": "0.81",
        "beta_channel": false,
        "arch": "armhf",
        "wait_boot": 5,
        "timezone": "Europe/Paris",
        "addons": [
            {
                "name": "Mosquitto broker",
                "slug": "core_mosquitto",
                "description": "An Open Source MQTT broker",
                "state": "started",
                "version": "1.0",
                "installed": "1.0",
                "repository": "core",
                "logo": true
            },
            {
                "name": "SSH server",
                "slug": "core_ssh",
                "description": "Allows connections over SSH",
                "state": "started",
                "version": "3.0",
                "installed": "3.0",
                "repository": "core",
                "logo": true
            },
            {
                "name": "Duck DNS",
                "slug": "core_duckdns",
                "description": "Free Dynamic DNS (DynDNS or DDNS) service with Let's Encrypt support",
                "state": "started",
                "version": "1.0",
                "installed": "1.0",
                "repository": "core",
                "logo": true
            },
            {
                "name": "Let's Encrypt",
                "slug": "core_letsencrypt",
                "description": "Manage certificate from Let's Encrypt",
                "state": "stopped",
                "version": "1.2",
                "installed": "1.2",
                "repository": "core",
                "logo": false
            },
            {
                "name": "MariaDB",
                "slug": "core_mariadb",
                "description": "An SQL database server",
                "state": "started",
                "version": "0.2",
                "installed": "0.2",
                "repository": "core",
                "logo": true
            }
        ],
        "addons_repositories": [
            "https://github.com/hassio-addons/repository"
        ]
    }
}
pvizeli commented 6 years ago

No problem. For resinos, I need this data not.

Can you send my also the hassio homeassistant info?

Maybe what could help: hassio homeassitant update -o version=0.60 after that back to 0.60.1

prigal commented 6 years ago
core-ssh:~# hassio homeassistant info
{
    "result": "ok",
    "data": {
        "version": "0.60.1",
        "last_version": "0.60.1",
        "image": "homeassistant/raspberrypi3-homeassistant",
        "custom": false,
        "boot": true,
        "port": 8123,
        "ssl": true,
        "watchdog": true
    }
}
pvizeli commented 6 years ago

I think the problem is with NetworkManager on host system (resin-sample). If that is possible, can you post the resin-sample file of network configuration?

Maybe with host access: docker inspect hassio docker exec homeassistant cat /etc/resolv.conf cat /etc/resolv.conf

prigal commented 6 years ago

Hello, I did not have time to look last night, will check tonight.

pvizeli commented 6 years ago

https://github.com/aio-libs/aiohttp/issues/2620

Maybe the bug is fix with home-assistant 0.61

prigal commented 6 years ago

Hello, still did not have time to access host by ssh, but I did the update (supervisor -> 0.82, hassio -> 0.61.dev) and problem is still there.

pvizeli commented 6 years ago

Do you use DHCP?

prigal commented 6 years ago

yes

pvizeli commented 6 years ago

Any manual changes on network config sample inside boot folder?

prigal commented 6 years ago

No, nothing has changed, IP is the same. Router is configured to always assign the same IP.

I really need to take some hours in the night to reboot my raspberry and activate host ssh while at home, we won't understand without this. (kids are definitely eating time !!!)

prigal commented 6 years ago

Finally I managed to take some time and get access :

root@hassio:~# docker inspect homeassistant
[
    {
        "Id": "1113e479beb2956e1705ff4afad2c1cc3fa8b95dfdcbbd5a72d635a544bb00c6",
        "Created": "2018-01-17T20:26:47.686803296Z",
        "Path": "/usr/bin/entry.sh",
        "Args": [
            "python3",
            "-m",
            "homeassistant",
            "--config",
            "/config"
        ],
        "State": {
            "Status": "running",
            "Running": true,
            "Paused": false,
            "Restarting": false,
            "OOMKilled": false,
            "Dead": false,
            "Pid": 1979,
            "ExitCode": 0,
            "Error": "",
            "StartedAt": "2018-01-17T20:26:50.731090899Z",
            "FinishedAt": "0001-01-01T00:00:00Z"
        },
        "Image": "sha256:4752b2d5a6be7ba9cc7dcb14a2af0344ec31570da404ddbc10e9d819cf2b9b62",
        "ResolvConfPath": "/var/lib/docker/containers/1113e479beb2956e1705ff4afad2c1cc3fa8b95dfdcbbd5a72d635a544bb00c6/resolv.conf",
        "HostnamePath": "/var/lib/docker/containers/1113e479beb2956e1705ff4afad2c1cc3fa8b95dfdcbbd5a72d635a544bb00c6/hostname",
        "HostsPath": "/var/lib/docker/containers/1113e479beb2956e1705ff4afad2c1cc3fa8b95dfdcbbd5a72d635a544bb00c6/hosts",
        "LogPath": "",
        "Name": "/homeassistant",
        "RestartCount": 0,
        "Driver": "aufs",
        "Platform": "linux",
        "MountLabel": "",
        "ProcessLabel": "",
        "AppArmorProfile": "",
        "ExecIDs": null,
        "HostConfig": {
            "Binds": [
                "/resin-data/homeassistant:/config:rw",
                "/resin-data/ssl:/ssl:ro",
                "/resin-data/share:/share:rw"
            ],
            "ContainerIDFile": "",
            "LogConfig": {
                "Type": "journald",
                "Config": {}
            },
            "NetworkMode": "host",
            "PortBindings": null,
            "RestartPolicy": {
                "Name": "",
                "MaximumRetryCount": 0
            },
            "AutoRemove": false,
            "VolumeDriver": "",
            "VolumesFrom": null,
            "CapAdd": null,
            "CapDrop": null,
            "Dns": [
                "172.30.32.2"
            ],
            "DnsOptions": [
                "ndots:0"
            ],
            "DnsSearch": [
                "."
            ],
            "ExtraHosts": null,
            "GroupAdd": null,
            "IpcMode": "",
            "Cgroup": "",
            "Links": null,
            "OomScoreAdj": 0,
            "PidMode": "",
            "Privileged": true,
            "PublishAllPorts": false,
            "ReadonlyRootfs": false,
            "SecurityOpt": null,
            "UTSMode": "",
            "UsernsMode": "",
            "ShmSize": 67108864,
            "Runtime": "runc",
            "ConsoleSize": [
                0,
                0
            ],
            "Isolation": "",
            "CpuShares": 0,
            "Memory": 0,
            "NanoCpus": 0,
            "CgroupParent": "",
            "BlkioWeight": 0,
            "BlkioWeightDevice": null,
            "BlkioDeviceReadBps": null,
            "BlkioDeviceWriteBps": null,
            "BlkioDeviceReadIOps": null,
            "BlkioDeviceWriteIOps": null,
            "CpuPeriod": 0,
            "CpuQuota": 0,
            "CpuRealtimePeriod": 0,
            "CpuRealtimeRuntime": 0,
            "CpusetCpus": "",
            "CpusetMems": "",
            "Devices": [
                {
                    "PathOnHost": "/dev/ttyAMA0",
                    "PathInContainer": "/dev/ttyAMA0",
                    "CgroupPermissions": "rwm"
                }
            ],
            "DeviceCgroupRules": null,
            "DiskQuota": 0,
            "KernelMemory": 0,
            "MemoryReservation": 0,
            "MemorySwap": 0,
            "MemorySwappiness": -1,
            "OomKillDisable": false,
            "PidsLimit": 0,
            "Ulimits": null,
            "CpuCount": 0,
            "CpuPercent": 0,
            "IOMaximumIOps": 0,
            "IOMaximumBandwidth": 0,
            "Init": true
        },
        "GraphDriver": {
            "Data": null,
            "Name": "aufs"
        },
        "Mounts": [
            {
                "Type": "bind",
                "Source": "/resin-data/ssl",
                "Destination": "/ssl",
                "Mode": "ro",
                "RW": false,
                "Propagation": "rprivate"
            },
            {
                "Type": "bind",
                "Source": "/resin-data/share",
                "Destination": "/share",
                "Mode": "rw",
                "RW": true,
                "Propagation": "rprivate"
            },
            {
                "Type": "bind",
                "Source": "/resin-data/homeassistant",
                "Destination": "/config",
                "Mode": "rw",
                "RW": true,
                "Propagation": "rprivate"
            }
        ],
        "Config": {
            "Hostname": "homeassistant",
            "Domainname": "",
            "User": "",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "HASSIO=172.30.32.2",
                "TZ=Europe/Paris",
                "HASSIO_TOKEN=e85562f884a04a49a80e9de027e51bf5",
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "LANG=C.UTF-8",
                "PYTHONPATH=/usr/local/lib/python3.6/site-packages",
                "LD_LIBRARY_PATH=/opt/vc/lib:"
            ],
            "Cmd": [
                "python3",
                "-m",
                "homeassistant",
                "--config",
                "/config"
            ],
            "ArgsEscaped": true,
            "Image": "homeassistant/raspberrypi3-homeassistant",
            "Volumes": {
                "/config": {},
                "/share": {},
                "/ssl": {}
            },
            "WorkingDir": "/config",
            "Entrypoint": [
                "/usr/bin/entry.sh"
            ],
            "OnBuild": null,
            "Labels": {
                "io.hass.arch": "armhf",
                "io.hass.machine": "raspberrypi3",
                "io.hass.type": "homeassistant",
                "io.hass.version": "0.61"
            }
        },
        "NetworkSettings": {
            "Bridge": "",
            "SandboxID": "06bf8c9d640d0e3859bbe840a2bf6704c0e78fac85ac58b428d9063fe5d5be6b",
            "HairpinMode": false,
            "LinkLocalIPv6Address": "",
            "LinkLocalIPv6PrefixLen": 0,
            "Ports": {},
            "SandboxKey": "/var/run/docker/netns/default",
            "SecondaryIPAddresses": null,
            "SecondaryIPv6Addresses": null,
            "EndpointID": "",
            "Gateway": "",
            "GlobalIPv6Address": "",
            "GlobalIPv6PrefixLen": 0,
            "IPAddress": "",
            "IPPrefixLen": 0,
            "IPv6Gateway": "",
            "MacAddress": "",
            "Networks": {
                "host": {
                    "IPAMConfig": null,
                    "Links": null,
                    "Aliases": null,
                    "NetworkID": "39820d884038271295a14d59ea8a15cbf730725e8de82c67296be5410d62edc9",
                    "EndpointID": "c298094baed5fa6b1f8db05a7c663c5be06e92c2764c57acd45fdb7a7ea8d1fb",
                    "Gateway": "",
                    "IPAddress": "",
                    "IPPrefixLen": 0,
                    "IPv6Gateway": "",
                    "GlobalIPv6Address": "",
                    "GlobalIPv6PrefixLen": 0,
                    "MacAddress": "",
                    "DriverOpts": null
                }
            }
        }
    }
]
root@hassio:~# docker inspect resin_supervisor
[
    {
        "Id": "2705b016c9d18a1755be4a69f866eb8e14695f1f0d7306a099c1ecc70df8faa6",
        "Created": "2018-01-16T15:45:09.062066064Z",
        "Path": "/usr/bin/entry.sh",
        "Args": [
            "python3",
            "-m",
            "hassio"
        ],
        "State": {
            "Status": "running",
            "Running": true,
            "Paused": false,
            "Restarting": false,
            "OOMKilled": false,
            "Dead": false,
            "Pid": 1087,
            "ExitCode": 0,
            "Error": "",
            "StartedAt": "2018-01-17T20:21:37.37396942Z",
            "FinishedAt": "2018-01-17T20:22:40.073912515Z"
        },
        "Image": "sha256:9c9e40710f33760245029700ee4438ed2f448f797afea37b834dee2aaa2ad873",
        "ResolvConfPath": "/var/lib/docker/containers/2705b016c9d18a1755be4a69f866eb8e14695f1f0d7306a099c1ecc70df8faa6/resolv.conf",
        "HostnamePath": "/var/lib/docker/containers/2705b016c9d18a1755be4a69f866eb8e14695f1f0d7306a099c1ecc70df8faa6/hostname",
        "HostsPath": "/var/lib/docker/containers/2705b016c9d18a1755be4a69f866eb8e14695f1f0d7306a099c1ecc70df8faa6/hosts",
        "LogPath": "",
        "Name": "/resin_supervisor",
        "RestartCount": 0,
        "Driver": "aufs",
        "Platform": "linux",
        "MountLabel": "",
        "ProcessLabel": "",
        "AppArmorProfile": "",
        "ExecIDs": null,
        "HostConfig": {
            "Binds": [
                "/var/run/hassio-hc.sock:/var/run/hassio-hc.sock",
                "/resin-data:/data",
                "/var/log/supervisor-log:/var/log",
                "/var/run/docker.sock:/var/run/docker.sock"
            ],
            "ContainerIDFile": "",
            "LogConfig": {
                "Type": "journald",
                "Config": {}
            },
            "NetworkMode": "default",
            "PortBindings": {},
            "RestartPolicy": {
                "Name": "no",
                "MaximumRetryCount": 0
            },
            "AutoRemove": false,
            "VolumeDriver": "",
            "VolumesFrom": null,
            "CapAdd": null,
            "CapDrop": null,
            "Dns": [],
            "DnsOptions": [],
            "DnsSearch": [],
            "ExtraHosts": null,
            "GroupAdd": null,
            "IpcMode": "",
            "Cgroup": "",
            "Links": null,
            "OomScoreAdj": 0,
            "PidMode": "",
            "Privileged": false,
            "PublishAllPorts": false,
            "ReadonlyRootfs": false,
            "SecurityOpt": null,
            "UTSMode": "",
            "UsernsMode": "",
            "ShmSize": 67108864,
            "Runtime": "runc",
            "ConsoleSize": [
                0,
                0
            ],
            "Isolation": "",
            "CpuShares": 0,
            "Memory": 0,
            "NanoCpus": 0,
            "CgroupParent": "",
            "BlkioWeight": 0,
            "BlkioWeightDevice": [],
            "BlkioDeviceReadBps": null,
            "BlkioDeviceWriteBps": null,
            "BlkioDeviceReadIOps": null,
            "BlkioDeviceWriteIOps": null,
            "CpuPeriod": 0,
            "CpuQuota": 0,
            "CpuRealtimePeriod": 0,
            "CpuRealtimeRuntime": 0,
            "CpusetCpus": "",
            "CpusetMems": "",
            "Devices": [],
            "DeviceCgroupRules": null,
            "DiskQuota": 0,
            "KernelMemory": 0,
            "MemoryReservation": 0,
            "MemorySwap": 0,
            "MemorySwappiness": -1,
            "OomKillDisable": false,
            "PidsLimit": 0,
            "Ulimits": null,
            "CpuCount": 0,
            "CpuPercent": 0,
            "IOMaximumIOps": 0,
            "IOMaximumBandwidth": 0
        },
        "GraphDriver": {
            "Data": null,
            "Name": "aufs"
        },
        "Mounts": [
            {
                "Type": "bind",
                "Source": "/resin-data",
                "Destination": "/data",
                "Mode": "",
                "RW": true,
                "Propagation": "rprivate"
            },
            {
                "Type": "bind",
                "Source": "/var/log/supervisor-log",
                "Destination": "/var/log",
                "Mode": "",
                "RW": true,
                "Propagation": "rprivate"
            },
            {
                "Type": "bind",
                "Source": "/var/run/docker.sock",
                "Destination": "/var/run/docker.sock",
                "Mode": "",
                "RW": true,
                "Propagation": "rprivate"
            },
            {
                "Type": "bind",
                "Source": "/var/run/hassio-hc.sock",
                "Destination": "/var/run/hassio-hc.sock",
                "Mode": "",
                "RW": true,
                "Propagation": "rprivate"
            }
        ],
        "Config": {
            "Hostname": "2705b016c9d1",
            "Domainname": "",
            "User": "",
            "AttachStdin": false,
            "AttachStdout": true,
            "AttachStderr": true,
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "SUPERVISOR_SHARE=/resin-data",
                "SUPERVISOR_NAME=resin_supervisor",
                "HOMEASSISTANT_REPOSITORY=homeassistant/raspberrypi3-homeassistant",
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "LANG=C.UTF-8"
            ],
            "Cmd": [
                "python3",
                "-m",
                "hassio"
            ],
            "ArgsEscaped": true,
            "Image": "homeassistant/armhf-hassio-supervisor",
            "Volumes": null,
            "WorkingDir": "",
            "Entrypoint": [
                "/usr/bin/entry.sh"
            ],
            "OnBuild": null,
            "Labels": {
                "io.hass.arch": "armhf",
                "io.hass.type": "supervisor",
                "io.hass.version": "0.82"
            }
        },
        "NetworkSettings": {
            "Bridge": "",
            "SandboxID": "485ea4c7754fd8f86ceb1187f2853a7a7648fbf0e8e75e99c91546a8f6117744",
            "HairpinMode": false,
            "LinkLocalIPv6Address": "",
            "LinkLocalIPv6PrefixLen": 0,
            "Ports": {},
            "SandboxKey": "/var/run/docker/netns/485ea4c7754f",
            "SecondaryIPAddresses": null,
            "SecondaryIPv6Addresses": null,
            "EndpointID": "6f204918a41982308e92c0a2cfde65c4c07f4b11c69d2c91ca3af1a128ad9e2d",
            "Gateway": "172.17.0.1",
            "GlobalIPv6Address": "",
            "GlobalIPv6PrefixLen": 0,
            "IPAddress": "172.17.0.2",
            "IPPrefixLen": 16,
            "IPv6Gateway": "",
            "MacAddress": "02:42:ac:11:00:02",
            "Networks": {
                "bridge": {
                    "IPAMConfig": null,
                    "Links": null,
                    "Aliases": null,
                    "NetworkID": "3791c4e4391167a56c8d9604cf6a364731e559ae8bddf0dbc2a03d3b2cd7a2d7",
                    "EndpointID": "6f204918a41982308e92c0a2cfde65c4c07f4b11c69d2c91ca3af1a128ad9e2d",
                    "Gateway": "172.17.0.1",
                    "IPAddress": "172.17.0.2",
                    "IPPrefixLen": 16,
                    "IPv6Gateway": "",
                    "GlobalIPv6Address": "",
                    "GlobalIPv6PrefixLen": 0,
                    "MacAddress": "02:42:ac:11:00:02",
                    "DriverOpts": null
                },
                "hassio": {
                    "IPAMConfig": {
                        "IPv4Address": "172.30.32.2"
                    },
                    "Links": null,
                    "Aliases": [
                        "hassio",
                        "2705b016c9d1"
                    ],
                    "NetworkID": "775362f3d90603b0126eac99efd22c68f09477c0013482b876ebb2957f320819",
                    "EndpointID": "38284033107a4db961e190e73ad62d9ea92662189e38313b9acb7744a73f0f61",
                    "Gateway": "172.30.32.1",
                    "IPAddress": "172.30.32.2",
                    "IPPrefixLen": 23,
                    "IPv6Gateway": "",
                    "GlobalIPv6Address": "",
                    "GlobalIPv6PrefixLen": 0,
                    "MacAddress": "02:42:ac:1e:20:02",
                    "DriverOpts": null
                }
            }
        }
    }
]
root@hassio:~# docker inspect hassio
[
    {
        "Name": "hassio",
        "Id": "775362f3d90603b0126eac99efd22c68f09477c0013482b876ebb2957f320819",
        "Created": "2017-08-29T13:08:02.910654731Z",
        "Scope": "local",
        "Driver": "bridge",
        "EnableIPv6": false,
        "IPAM": {
            "Driver": "default",
            "Options": null,
            "Config": [
                {
                    "Subnet": "172.30.32.0/23",
                    "IPRange": "172.30.33.0/24",
                    "Gateway": "172.30.32.1"
                }
            ]
        },
        "Internal": false,
        "Attachable": false,
        "Ingress": false,
        "ConfigFrom": {
            "Network": ""
        },
        "ConfigOnly": false,
        "Containers": {
            "0958554a9a9df1a24528faa9da67c137ad037d02a102abedd85b0ebb098bdfb4": {
                "Name": "addon_core_duckdns",
                "EndpointID": "f5882661243e450cbb9ce39ce12fff551bd4ea3b50f367650b3ddb3c9b037f85",
                "MacAddress": "02:42:ac:1e:21:02",
                "IPv4Address": "172.30.33.2/23",
                "IPv6Address": ""
            },
            "2705b016c9d18a1755be4a69f866eb8e14695f1f0d7306a099c1ecc70df8faa6": {
                "Name": "resin_supervisor",
                "EndpointID": "38284033107a4db961e190e73ad62d9ea92662189e38313b9acb7744a73f0f61",
                "MacAddress": "02:42:ac:1e:20:02",
                "IPv4Address": "172.30.32.2/23",
                "IPv6Address": ""
            },
            "6066bffe5987eab70482832ba0f6b67c28653fab9bd1adf7f9dd183a3f1caa41": {
                "Name": "addon_core_ssh",
                "EndpointID": "378b2c60b12713bb1e9ef87c650bc390d5d60ad23a549ea46289e864a85774bb",
                "MacAddress": "02:42:ac:1e:21:03",
                "IPv4Address": "172.30.33.3/23",
                "IPv6Address": ""
            },
            "d5ce55fbc7c9df7bd9e29d2c4288ecb56366aaf19d0d802d11c94cfcb70524ca": {
                "Name": "addon_core_mosquitto",
                "EndpointID": "0d785ca5cf4d7e7eacf72038f8b472348b6871ad5cc54494c7d08cf7b77f52df",
                "MacAddress": "02:42:ac:1e:21:01",
                "IPv4Address": "172.30.33.1/23",
                "IPv6Address": ""
            },
            "e88ca463dd690c9736bd509b3b92929e039869828add63fc0684304fe2b2420d": {
                "Name": "addon_core_mariadb",
                "EndpointID": "4cdf4406f84cae733d097210945bed8fbf363832c6b3a2a4e03cfb7754d0533e",
                "MacAddress": "02:42:ac:1e:21:00",
                "IPv4Address": "172.30.33.0/23",
                "IPv6Address": ""
            }
        },
        "Options": {
            "com.docker.network.bridge.name": "hassio"
        },
        "Labels": {}
    }
]
root@hassio:~# docker exec homeassistant cat /etc/resolv.conf
nameserver 172.30.32.2
options ndots:0
root@hassio:~# docker exec resin_supervisor cat /etc/resolv.conf
nameserver 127.0.0.11
options ndots:0
SteveEdson commented 6 years ago

Also getting this issue, Raspberry Pi 3, running 0.61.1. If I SSH, I can ping websites, but doing a wget gives me the error wget: error getting response: Connection reset by peer.

This has affected all my platforms that use the external network. Maybe worth mentioning that hassio also powers the PiHole add on, which my router is configured to use.

frenck commented 6 years ago

@SteveEdson Please share you Resin network configuration file

pvizeli commented 6 years ago

@prigal can you get from host: cat /etc/resolv.conf

Do you can share you network config or you never change the config file and run on LAN?

All look fine. That mean can't resolve the DNS over the router. I play with the idea that we implement a own dns server.

SteveEdson commented 6 years ago
cat /etc/resolv.conf
# Generated by NetworkManager
nameserver 192.168.1.193
nameserver 192.168.1.1
nameserver 8.8.8.8

However nameserver 192.168.1.193 is my old PiHole server, so maybe its trying to use that and not falling back properly? If I edit the file, it just gets reverted on restart though.

pvizeli commented 6 years ago

Yes I think so. You can edit this over that: https://docs.resin.io/deployment/network/2.x/

SteveEdson commented 6 years ago

@pvizeli do you know which bit I need to edit? I edited (directly on the SD card) the file /resin-boot/system-connections/resin-sample so it included:

[ipv4]
dns=8.8.8.8;8.8.4.4;

However this was also reverted on a restart, as well as the resolv.conf file again.

frenck commented 6 years ago

Did you set a static IP using the resin-sample file? If not, it is overwritten/extended by your DHCP server...

SteveEdson commented 6 years ago

Realised that my router was still set to use the old 192.168.1.193 DNS server, updated this to the new address which has now changed the resolv.conf file, however none of external services are working still. Anything else I can provide to help debug this? Thanks

frenck commented 6 years ago

You mentioned using the Pi-Hole add-on and secondly, the Pi is using DHCP (since it gets its DNS via your router).

The Pi-hole add-on requires a static IP to be set (not via DHCP or DHCP Lease).

prigal commented 6 years ago
root@hassio:~# cat /etc/resolv.conf
# Generated by NetworkManager
nameserver 192.168.1.254
nameserver 8.8.8.8
nameserver 8.8.4.4

I have never change anything in my local network.

prigal commented 6 years ago

From command line, I can ping any domain with it's name, so DNS is working (on host and on homeassistant container)

prigal commented 6 years ago

Have updated to 0.61.1, but problem is still there.

frenck commented 6 years ago

@prigal I was not clear in my last message. Does your HA machine have a static IP assigned?

prigal commented 6 years ago

It's not a static IP, only a DHCP static route to ensure my PI will always have the same IP.

prigal commented 6 years ago

(and on my side, I don't use pi-hole)

pvizeli commented 6 years ago

That is a docker issue. He use only the first DNS server.

You can fix it, if you router will send the correct working DNS settings.

frenck commented 6 years ago

Or simply set a true static IP, which also fixes this.

SteveEdson commented 6 years ago

I solved my issue, think I had my PiHole config wrong, and because it's only using the first DNS server, it couldn't connect to anything. The rest of my network was fine, because it was able to fall back correctly.

prigal commented 6 years ago

Ok serving 8.8.8.8 directly from my router via DHCP instead of local DNS server solves problem.

SteveEdson commented 6 years ago

Is using the first DNS server a generic docker issue, or is it a problem with resin / hass? Is there an issue we can track?

Apart from that, I think this issue can probably be closed now. Thanks for the help.

prigal commented 6 years ago

Yes thanks for the help :)

rsissons commented 6 years ago

So I have been dealing with this for the last couple days as an HA Newb. This information would have been useful on the GETTING STARTED page and I wouldn't have wasted so much time. What I am reading is to assign a static IP to the HA in order to bypass the hassio docker issue of using the first DNS?

prigal commented 6 years ago

@rsissons I don't think we need it in GETTING STARTED page as long as it's an issue that only affect some users. Moreover, issue is quite well documented, in forum and here. A google search should drive everyone to here quite fast.

On my side, I solved it without touching anything in hassio. I only update my gateway settings to send 8.8.8.8 as DNS via DHCP and not the local IP of my gateway.

rsissons commented 6 years ago

@prigal As a new HA user, I respectfully disagree. If there are known issues that affect the initial installation of HA (Step 3), then putting a note to fix the issue(like the 2.4GHz issue) will save a new user from having to scour the forums to figure out why the default sensors don't work. If this would have been stated as an issue when setting up the wireless BEFORE(you can't change it via ssh, so you have to take it back out of the RPI) inserting it into the RPI for the very first time would have saved me a lot of wasted time and headache. You may be pushing the DNS from your router, but per the instructions on the HA site, it doesn't state that and is not something someone new to HA would know.

  1. "WiFi setup only: open the file system-connections/resin-sample (from the resin-boot volume on the SD card) with a text editor. Change ssid to be your network name and psk to be your password. Note that the Raspberry Pi 3 is a 2.4GHz WiFi device, so do not try to connect it to a 5GHz network."

There's a Note for connecting to 2.4GHz only as an issue. Another Note could be

The Docker container where Hassio is installed, only uses the 1st DNS entry. Set it to 8.8.8.8 if you're not using your own DNS server."

It's a small addition to the instructions for new HA users installing for WiFi only just to get the basic setup to actually work. If not, then they have to do a search in the forum (if they know what to search for), remove the card from the Pi, edit the resin_sample to add the DNS, and put it back into the Pi for something a simple addition to the instructions would alleviate. I couldn't get weather underground to work(couldn't reach the site), ecobee couldn't be set up because it couldn't get the pin, and api calls fail.

If you don't want to put these in the installation instructions, then at least put a link to Known Installation Issues with forum links. This would save unneeded forum posts asking the same questions, or be searching the internet for a solution that should have been included in the instructions. Don't get me wrong, I am all for new users seeking out their own knowledge for HA(and the learning curve) for things they want to do and how to do them, but initial installation shouldn't be one of them. Help the new users out a little.

da-anda commented 6 years ago

sorry for digging this up again. I'm facing the same issue, running PiHole on the same device (using the HASS.io add-on). Now I'm trying to set a static IP and did Google on how to do it on resin. The guide I found suggested to edit the config.json of the boot partition (which somehow didn't work for me, since after a reboot everything was back to normal). In here I read something about editing the resin-sample file. Which way is considered best practice here? Thanks.

edit: managed to do it. In the end I didn't use either of the two ways, since I found another guide simply using the network manager CLI tool

resin> nmcli connection edit
// pick the connection to edit from the list displayed
nmcli> remove ipv4.dns  
nmcli> set ipv4.ignore-auto-dns yes
nmcli> set ipv4.dns 1.1.1.1,8.8.8.8    
nmcli> save
nmcli> quit 

after that, reboot and you're good to go. That way you even don't need a static IP but can have your DHCP manage it for your