Updating from Home Assistant Core 2022.6.7 to 2022.7.3 on my TrueNAS Core Version: TrueNAS-13.0-U1

Hi, trying to upgrade my Home Assistant Core 2022.6.7 to 2022.7.3 on my TrueNAS Core Version: TrueNAS-13.0-U1

But I get an error message -

Downloading orjson-3.7.5.tar.gz (640 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 640.2/640.2 KB 33.2 MB/s eta 0:00:00
Installing build dependencies … error
error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> [102 lines of output]
Collecting maturin<0.13,>=0.12.19
Downloading maturin-0.12.20.tar.gz (156 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 156.9/156.9 KB 5.5 MB/s eta 0:00:00
Installing build dependencies: started
Installing build dependencies: finished with status ‘done’
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status ‘done’
Preparing metadata (pyproject.toml): started
Preparing metadata (pyproject.toml): finished with status ‘done’
Collecting tomli>=1.1.0
Downloading tomli-2.0.1-py3-none-any.whl (12 kB)
Building wheels for collected packages: maturin
Building wheel for maturin (pyproject.toml): started
Building wheel for maturin (pyproject.toml): finished with status ‘error’
error: subprocess-exited-with-error

    × Building wheel for maturin (pyproject.toml) did not run successfully.
    │ exit code: 1
    ╰─> [77 lines of output]
        running bdist_wheel
        running build
        running build_py
        creating build
        creating build/lib.freebsd-12.2-RELEASE-p14-amd64-3.9
        creating build/lib.freebsd-12.2-RELEASE-p14-amd64-3.9/maturin
        copying maturin/import_hook.py -> build/lib.freebsd-12.2-RELEASE-p14-amd64-3.9/maturin
        copying maturin/__init__.py -> build/lib.freebsd-12.2-RELEASE-p14-amd64-3.9/maturin
        running build_ext
        running build_rust
         Downloading crates ...
        error: failed to download `scroll v0.11.0`

        Caused by:
          unable to get packages from source

        Caused by:
          failed to parse manifest at `/home/homeassistant/.cargo/registry/src/github.com-1ecc6299db9ec823/scroll-0.11.0/Cargo.toml`

        Caused by:
          feature `edition2021` is required

          The package requires the Cargo feature called `edition2021`, but that feature is not stabilized in this version of Cargo (1.55.0).
          Consider trying a newer version of Cargo (this may require the nightly release).
          See https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#edition-2021 for more information about the status of this feature.
        Traceback (most recent call last):
          File "/tmp/tmp8s47tk37_in_process.py", line 363, in <module>
            main()
          File "/tmp/tmp8s47tk37_in_process.py", line 345, in main
            json_out['return_val'] = hook(**hook_input['kwargs'])
          File "/tmp/tmp8s47tk37_in_process.py", line 261, in build_wheel
            return _build_backend().build_wheel(wheel_directory, config_settings,
          File "/tmp/pip-build-env-ias8tab4/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 216, in build_wheel
            return self._build_with_temp_dir(['bdist_wheel'], '.whl',
          File "/tmp/pip-build-env-ias8tab4/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 202, in _build_with_temp_dir
            self.run_setup()
          File "/tmp/pip-build-env-ias8tab4/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 145, in run_setup
            exec(compile(code, __file__, 'exec'), locals())
          File "setup.py", line 57, in <module>
            setup(
          File "/tmp/pip-build-env-ias8tab4/overlay/lib/python3.9/site-packages/setuptools/__init__.py", line 153, in setup
            return distutils.core.setup(**attrs)
          File "/usr/local/lib/python3.9/distutils/core.py", line 148, in setup
            dist.run_commands()
          File "/usr/local/lib/python3.9/distutils/dist.py", line 966, in run_commands
            self.run_command(cmd)
          File "/usr/local/lib/python3.9/distutils/dist.py", line 985, in run_command
            cmd_obj.run()
          File "/tmp/pip-build-env-ias8tab4/overlay/lib/python3.9/site-packages/wheel/bdist_wheel.py", line 299, in run
            self.run_command('build')
          File "/usr/local/lib/python3.9/distutils/cmd.py", line 313, in run_command
            self.distribution.run_command(command)
          File "/usr/local/lib/python3.9/distutils/dist.py", line 985, in run_command
            cmd_obj.run()
          File "/usr/local/lib/python3.9/distutils/command/build.py", line 135, in run
            self.run_command(cmd_name)
          File "/usr/local/lib/python3.9/distutils/cmd.py", line 313, in run_command
            self.distribution.run_command(command)
          File "/usr/local/lib/python3.9/distutils/dist.py", line 985, in run_command
            cmd_obj.run()
          File "/tmp/pip-build-env-ias8tab4/overlay/lib/python3.9/site-packages/setuptools_rust/setuptools_ext.py", line 132, in run
            build_rust.run()
          File "/tmp/pip-build-env-ias8tab4/overlay/lib/python3.9/site-packages/setuptools_rust/command.py", line 101, in run
            self.run_for_extension(ext)
          File "/tmp/pip-build-env-ias8tab4/overlay/lib/python3.9/site-packages/setuptools_rust/build.py", line 112, in run_for_extension
            dylib_paths = self.build_extension(ext, self.target)
          File "/tmp/pip-build-env-ias8tab4/overlay/lib/python3.9/site-packages/setuptools_rust/build.py", line 143, in build_extension
            target_dir = _base_cargo_target_dir(ext)
          File "/tmp/pip-build-env-ias8tab4/overlay/lib/python3.9/site-packages/setuptools_rust/build.py", line 690, in _base_cargo_target_dir
            target_directory = ext._metadata()["target_directory"]
          File "/tmp/pip-build-env-ias8tab4/overlay/lib/python3.9/site-packages/setuptools_rust/extension.py", line 225, in _metadata
            self._cargo_metadata = json.loads(subprocess.check_output(metadata_command))
          File "/usr/local/lib/python3.9/subprocess.py", line 424, in check_output
            return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
          File "/usr/local/lib/python3.9/subprocess.py", line 528, in run
            raise CalledProcessError(retcode, process.args,
        subprocess.CalledProcessError: Command '['cargo', 'metadata', '--manifest-path', 'Cargo.toml', '--format-version', '1']' returned non-zero exit status 101.
        [end of output]

    note: This error originates from a subprocess, and is likely not a problem with pip.
    ERROR: Failed building wheel for maturin
  Failed to build maturin
  ERROR: Could not build wheels for maturin, which is required to install pyproject.toml-based projects
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

  ERROR: Could not build wheels for maturin, which is required to install pyproject.toml-based projects
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem withpip.

Almost the same error for me, also on an NAS, really old one though (Excito B3).

        Caused by:
          this version of Cargo is older than the `2021` edition, and only supports `2015` and `2018` editions.

It’s the maturin installation that’s seems to be causing the problem. I’ve been trying various fixes all day without luck.

Ufff…

Will be fun to see if either HA soulves it or TrueNAS finds a solution :face_with_raised_eyebrow:

is there any way to roll this back to the previous version, house is kind of uncontrollable without it lol

Just verified that i’m on the previous version, but no webui for my HA install, wth? claims to be running

I have the same problem, any solution?

Have posted on several platforms, no response anywhere :frowning:

Now I have finally solved it, after almost a week. My girlfriend thinks I’m mad :slight_smile:.

The main problem is the lack of a precompiled wheel for maturin and orjson. Therefore we need to build wheel ourselves. And for the compilation rust needs to be installed. And not just any rust, but 2021 version. On my super slow NAS with ARMv5tel CPU, there are no possibility to run rustup. But you might be more lucky than me, try

curl https://sh.rustup.rs -sSf | sh

and see if you can install rustup. If so, run

rustup update

and then it should work.

But I needed to install rustc and cargo with apt. I could install the 2018 version with the stable in
/etc/apt/sources.list

deb http://deb.debian.org/debian stable main

and then changed to testing

deb http://deb.debian.org/debian testing non-free contrib main

then installed rustc, cargo and cargo-doc, not sure if I needed the last one. I only installed the wanted packages, and then switched back to stable source.

After that, I tried to compile maturin, which worked but took a couple of hours. Then I felt pretty sure the update would work, so I tried :slight_smile:. It took about eight hours, but now it’s ok!

Thank you so much for your replay.
I tested to install via curl https://sh.rustup.rs -sSf | sh
then run the update; rustup update but that gave me this message:

[email protected]:~ # rustup update
rustup: Command not found.

No dice, still the same error :frowning:

But when I run it outside the jail; I get this message:

[email protected][~]# rustup update
info: syncing channel updates for "stable-x86_64-unknown-freebsd
info: checking for self-updates

stable-x86_64-unkown-freebsd unchanged - rustc 1.62.1 (e092d0b6b 2022-07-16)

info: cleaning yo downloads and tmp directories

After that, tested to update HA again, still no dice.

Just happened to stumble on this… Did you ever get your Home Assistant fixed?

Maybe by now you have moved to a different installation method, which is completely understandable.

Anyways, if you’re still holding out for a solution, I think you’ll need to rebuild the Home Assistant venv… Might as well update Python at the same time.

These steps are done from the Home Assistant jail console

## Press 0 to exit the menu

# stop home assistant
service homeassistant stop

# install updated python requirements
pkg install python310 py310-sqlite3

# set python version for home assistant virtualenv
sysrc homeassistant_python=/usr/local/bin/python3.10

# rebuild the home assistant virtualenv
service homeassistant reinstall homeassistant

# start home assistant
service homeassistant start

On average this will take at least 15-30 minutes to complete. However a few users have reported waiting over an hour for the Home Assistant web UI to become available again! The amount of time it takes will vary depending on the speed of your NAS and the number of integrations you have added to Home Assistant.

If that doesn’t work, it’s probably quickest to reinstall the plugin and restore your configuration, rather than continue to troubleshoot a broken install – Remember as long as you do not delete your existing plugin, your configuration can be saved even if the jail itself failed to start.

Good luck

Unfortunately I still get the same error.

Seems like they want to force you to switch to TrueNAS Scale if you want to continue using HA via TrueNAS.
I’ll see when I can deal with it as I have to install and reconfigure both Plex Server and HA as you can’t just upgrade to Scale apparently.

You mentioned you’re on TrueNAS 13.1 but can you say version the jail is trying to use?

Your Home Assistant plugin should be using the 13.1-RELEASE. If not, you may need to refresh the community plugin index.

I’m going to fire up a VM with TrueNAS 13 to have a look.

After updating the plugins and updating the Jail, updating HA was fine.

But something seemed to have gone really wrong in my HA.
Couldn’t access it afterwards.

So I had to go back with backup, take out backups of automations and other things that I needed.
Took and deleted the entire HA Jail and reinstalled everything from scratch.