0.117 nest integration requiring grpcio on pi wants to compile but fails

HI I did try and log this as a bug but was told I am missing C compilers and libraries.

I think I have the ones listed here https://www.home-assistant.io/docs/installation/virtualenv/ and can run gcc and the like - it’s managed previously to compile the later versions of Python - so not sure how you find what I’m missing… Anyone can help?

After upgrading from 0.116.4 to 0.117.0 or 0.117.1 the integration it took over an hour, and if you restart home assistant it takes the same time, downgrading to 0.116.4 returns back to normal and the nest thermostat and protect devices work again.

During this period the system is unresponsive and can see a lot of gcc related processes running - I think the grpcio module was attempted to be installed but there is no wheel for the armv11 for Python 3.8 (I think you may have to go back to an older Python version to get a wheel for it)

After the long wait it logs masses of errors about compiling problems

arch | armv7l
-- | --
dev | false
docker | false
hassio | false
installation_type | Home Assistant Core
os_name | Linux
os_version | 5.4.51-v7+
python_version | 3.8.5
timezone | Europe/London
version | 0.117.1
virtualenv | true

Errors output

2020-10-30 23:29:14 ERROR (SyncWorker_25) [homeassistant.util.package] Unable to install package google-nest-sdm==0.1.6: ERROR: Command errored out with exit status 1:
   command: /srv/ha/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-4udvkrwr/grpcio/setup.py'"'"'; __file__='"'"'/tmp/pip-install-4udvkrwr/grpcio/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-5xtg6w2g
       cwd: /tmp/pip-install-4udvkrwr/grpcio/
  Complete output (2196 lines):
  Found cython-generated files...
  running bdist_wheel
  running build
  running build_py
  running build_project_metadata
  creating python_build
  creating python_build/lib.linux-armv7l-3.8
  creating python_build/lib.linux-armv7l-3.8/grpc
  copying src/python/grpcio/grpc/_simple_stubs.py -> python_build/lib.linux-armv7l-3.8/grpc
  copying src/python/grpcio/grpc/_channel.py -> python_build/lib.linux-armv7l-3.8/grpc
...[snipped this section so I can log this]..
  creating python_build/temp.linux-armv7l-3.8/third_party/upb
  creating python_build/temp.linux-armv7l-3.8/third_party/upb/upb
  creating python_build/temp.linux-armv7l-3.8/third_party/zlib
  gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DOPENSSL_NO_ASM=1 -D_WIN32_WINNT=1536 -DGPR_BACKWARDS_COMPATIBILITY_MODE=1 -DHAVE_CONFIG_H=1 -DGRPC_ENABLE_FORK_SUPPORT=1 -DPyMODINIT_FUNC=extern "C" __attribute__((visibility ("default"))) PyObject* -DGRPC_POSIX_FORK_ALLOW_PTHREAD_ATFORK=1 -Isrc/python/grpcio -Iinclude -I. -Ithird_party/abseil-cpp -Ithird_party/address_sorting/include -Ithird_party/cares -Ithird_party/cares/cares -Ithird_party/cares/config_linux -Ithird_party/re2 -Ithird_party/boringssl-with-bazel/src/include -Ithird_party/upb -Isrc/core/ext/upb-generated -Ithird_party/zlib -I/usr/local/include/python3.8 -c src/python/grpcio/grpc/_cython/cygrpc.cpp -o python_build/temp.linux-armv7l-3.8/src/python/grpcio/grpc/_cython/cygrpc.o -std=c++11 -std=gnu99 -fvisibility=hidden -fno-wrapv -fno-exceptions -pthread

  cc1plus: warning: command line option ‘-std=gnu99’ is valid for C/ObjC but not for C++
  gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/local/include/python3.8 -c /tmp/tmp9xt5d4vp/a.c -o None/tmp/tmp9xt5d4vp/a.o
    Traceback (most recent call last):
      File "/usr/local/lib/python3.8/distutils/unixccompiler.py", line 117, in _compile
        self.spawn(compiler_so + cc_args + [src, '-o', obj] +
      File "/tmp/pip-install-4udvkrwr/grpcio/src/python/grpcio/_spawn_patch.py", line 54, in _commandfile_spawn
        _classic_spawn(self, command)
      File "/usr/local/lib/python3.8/distutils/ccompiler.py", line 910, in spawn
        spawn(cmd, dry_run=self.dry_run)
      File "/usr/local/lib/python3.8/distutils/spawn.py", line 36, in spawn
        _spawn_posix(cmd, search_path, dry_run=dry_run)
      File "/usr/local/lib/python3.8/distutils/spawn.py", line 157, in _spawn_posix
        raise DistutilsExecError(
    distutils.errors.DistutilsExecError: command 'gcc' failed with exit status 1
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/tmp/pip-install-4udvkrwr/grpcio/src/python/grpcio/commands.py", line 264, in build_extensions
        build_ext.build_ext.build_extensions(self)
      File "/usr/local/lib/python3.8/distutils/command/build_ext.py", line 449, in build_extensions
        self._build_extensions_serial()
      File "/usr/local/lib/python3.8/distutils/command/build_ext.py", line 474, in _build_extensions_serial
        self.build_extension(ext)
      File "/srv/ha/lib/python3.8/site-packages/setuptools/command/build_ext.py", line 196, in build_extension
        _build_ext.build_extension(self, ext)
      File "/usr/local/lib/python3.8/distutils/command/build_ext.py", line 528, in build_extension
        objects = self.compiler.compile(sources,
      File "/tmp/pip-install-4udvkrwr/grpcio/src/python/grpcio/_parallel_compile_patch.py", line 58, in _parallel_compile
        multiprocessing.pool.ThreadPool(BUILD_EXT_COMPILER_JOBS).map(
      File "/usr/local/lib/python3.8/multiprocessing/pool.py", line 364, in map
        return self._map_async(func, iterable, mapstar, chunksize).get()
      File "/usr/local/lib/python3.8/multiprocessing/pool.py", line 771, in get
        raise self._value
      File "/usr/local/lib/python3.8/multiprocessing/pool.py", line 125, in worker
        result = (True, func(*args, **kwds))
      File "/usr/local/lib/python3.8/multiprocessing/pool.py", line 48, in mapstar
        return list(map(*args))
      File "/tmp/pip-install-4udvkrwr/grpcio/src/python/grpcio/_parallel_compile_patch.py", line 54, in _compile_single_file
        self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
      File "/tmp/pip-install-4udvkrwr/grpcio/src/python/grpcio/commands.py", line 247, in new_compile
        return old_compile(obj, src, ext, cc_args, extra_postargs,
      File "/usr/local/lib/python3.8/distutils/unixccompiler.py", line 120, in _compile
        raise CompileError(msg)
    distutils.errors.CompileError: command 'gcc' failed with exit status 1
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-4udvkrwr/grpcio/setup.py", line 410, in <module>
        setuptools.setup(
      File "/srv/ha/lib/python3.8/site-packages/setuptools/__init__.py", line 153, in setup
        return distutils.core.setup(**attrs)
      File "/usr/local/lib/python3.8/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/usr/local/lib/python3.8/distutils/dist.py", line 966, in run_commands
        self.run_command(cmd)
      File "/usr/local/lib/python3.8/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/srv/ha/lib/python3.8/site-packages/setuptools/command/install.py", line 61, in run
        return orig.install.run(self)
      File "/usr/local/lib/python3.8/distutils/command/install.py", line 545, in run
        self.run_command('build')
      File "/usr/local/lib/python3.8/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/local/lib/python3.8/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/usr/local/lib/python3.8/distutils/command/build.py", line 135, in run
        self.run_command(cmd_name)
      File "/usr/local/lib/python3.8/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/local/lib/python3.8/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/srv/ha/lib/python3.8/site-packages/setuptools/command/build_ext.py", line 79, in run
        _build_ext.run(self)
      File "/usr/local/lib/python3.8/distutils/command/build_ext.py", line 340, in run
        self.build_extensions()
      File "/tmp/pip-install-4udvkrwr/grpcio/src/python/grpcio/commands.py", line 268, in build_extensions
        raise CommandError(
    commands.CommandError: Failed `build_ext` step:
    Traceback (most recent call last):
      File "/usr/local/lib/python3.8/distutils/unixccompiler.py", line 117, in _compile
        self.spawn(compiler_so + cc_args + [src, '-o', obj] +
      File "/tmp/pip-install-4udvkrwr/grpcio/src/python/grpcio/_spawn_patch.py", line 54, in _commandfile_spawn
        _classic_spawn(self, command)
      File "/usr/local/lib/python3.8/distutils/ccompiler.py", line 910, in spawn
        spawn(cmd, dry_run=self.dry_run)
      File "/usr/local/lib/python3.8/distutils/spawn.py", line 36, in spawn
        _spawn_posix(cmd, search_path, dry_run=dry_run)
      File "/usr/local/lib/python3.8/distutils/spawn.py", line 157, in _spawn_posix
        raise DistutilsExecError(
    distutils.errors.DistutilsExecError: command 'gcc' failed with exit status 1
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/tmp/pip-install-4udvkrwr/grpcio/src/python/grpcio/commands.py", line 264, in build_extensions
        build_ext.build_ext.build_extensions(self)
      File "/usr/local/lib/python3.8/distutils/command/build_ext.py", line 449, in build_extensions
        self._build_extensions_serial()
      File "/usr/local/lib/python3.8/distutils/command/build_ext.py", line 474, in _build_extensions_serial
        self.build_extension(ext)
      File "/srv/ha/lib/python3.8/site-packages/setuptools/command/build_ext.py", line 196, in build_extension
        _build_ext.build_extension(self, ext)
      File "/usr/local/lib/python3.8/distutils/command/build_ext.py", line 528, in build_extension
        objects = self.compiler.compile(sources,
      File "/tmp/pip-install-4udvkrwr/grpcio/src/python/grpcio/_parallel_compile_patch.py", line 58, in _parallel_compile
        multiprocessing.pool.ThreadPool(BUILD_EXT_COMPILER_JOBS).map(
      File "/usr/local/lib/python3.8/multiprocessing/pool.py", line 364, in map
        return self._map_async(func, iterable, mapstar, chunksize).get()
      File "/usr/local/lib/python3.8/multiprocessing/pool.py", line 771, in get
        raise self._value
      File "/usr/local/lib/python3.8/multiprocessing/pool.py", line 125, in worker
        result = (True, func(*args, **kwds))
      File "/usr/local/lib/python3.8/multiprocessing/pool.py", line 48, in mapstar
        return list(map(*args))
      File "/tmp/pip-install-4udvkrwr/grpcio/src/python/grpcio/_parallel_compile_patch.py", line 54, in _compile_single_file
        self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
      File "/tmp/pip-install-4udvkrwr/grpcio/src/python/grpcio/commands.py", line 247, in new_compile
        return old_compile(obj, src, ext, cc_args, extra_postargs,
      File "/usr/local/lib/python3.8/distutils/unixccompiler.py", line 120, in _compile
        raise CompileError(msg)
    distutils.errors.CompileError: command 'gcc' failed with exit status 1
    
    ----------------------------------------
ERROR: Command errored out with exit status 1: /srv/ha/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-4udvkrwr/grpcio/setup.py'"'"'; __file__='"'"'/tmp/pip-install-4udvkrwr/grpcio/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-bt33pibv/install-record.txt --single-version-externally-managed --compile --install-headers /srv/ha/include/site/python3.8/grpcio Check the logs for full command output.
2020-10-30 23:29:14 ERROR (MainThread) [homeassistant.setup] Setup failed for nest: Requirements for nest not found: ['google-nest-sdm==0.1.6'].

Ok well figured it out in the end - wasn’t at all missing libraries or applications it was the Raspberry Pi B+ ran out of memory and the swap file was at 100MB, increased and that worked.

You’re a saint! I wish I read this post 48 hours ago.

1 Like