home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.48k stars 30.7k forks source link

Component mobile_app No module named 'hass_nabucasa' on config check. #27380

Closed eifinger closed 5 years ago

eifinger commented 5 years ago

Home Assistant release with the issue:

0.100

Last working Home Assistant release (if known): 0.99.3

Operating environment (Hass.io/Docker/Windows/etc.):

Docker / Azure CI Integration:

https://www.home-assistant.io/integrations/mobile_app/

Description of problem: My CI always builds against my installed and against the latest version. With the just released version 0.100 it fails with the error Package ariela setup failed. Component mobile_app No module named 'hass_nabucasa'.

The command I executed is

hass -c . --script check_config --info all

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

mobile_app:
utility_meter:
  step_counter_kevin:
    source: sensor.oneplus3_ariela_step_counter_sensor
    cycle: daily

My full config can be found under: https://github.com/eifinger/homeassistant-config

Traceback (if applicable):

##[section]Starting: Test Home-Assistant Config
==============================================================================
Task         : Command line
Description  : Run a command line script using Bash on Linux and macOS and cmd.exe on Windows
Version      : 2.151.2
Author       : Microsoft Corporation
Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/command-line
==============================================================================
Generating script.
Script contents:
hass -c . --script check_config --info all
========================== Starting Command Output ===========================
[command]/bin/bash --noprofile --norc /home/vsts/work/_temp/7fe52024-e789-47a1-9b1f-9ee11cc4fc3c.sh
INFO:homeassistant.util.package:Attempting install of colorlog==4.0.2
Testing configuration at /home/vsts/work/1/s/.‌
INFO:homeassistant.util.package:Attempting install of alexapy==1.3.2
INFO:homeassistant.util.package:Attempting install of pydroid-ipcam==0.8
INFO:homeassistant.util.package:Attempting install of PyNaCl==1.3.0
INFO:homeassistant.util.package:Attempting install of pydeconz==63
INFO:homeassistant.util.package:Attempting install of denonavr==0.7.10
INFO:homeassistant.util.package:Attempting install of jsonrpc-async==0.6
INFO:homeassistant.util.package:Attempting install of jsonrpc-websocket==0.6
INFO:homeassistant.util.package:Attempting install of spotipy-homeassistant==2.4.4.dev1
INFO:homeassistant.util.package:Attempting install of influxdb==5.2.3
INFO:homeassistant.util.package:Attempting install of google-api-python-client==1.6.4
INFO:homeassistant.util.package:Attempting install of httplib2==0.10.3
INFO:homeassistant.util.package:Attempting install of oauth2client==4.0.0
INFO:homeassistant.util.package:Attempting install of holidays==0.9.11
INFO:homeassistant.util.package:Attempting install of hbmqtt==0.9.5
INFO:homeassistant.util.package:Attempting install of paho-mqtt==1.4.0
INFO:homeassistant.util.package:Attempting install of wakeonlan==1.1.6
INFO:homeassistant.util.package:Attempting install of broadlink==0.11.1
INFO:homeassistant.util.package:Attempting install of slacker==0.13.0
INFO:homeassistant.util.package:Attempting install of construct==2.9.45
INFO:homeassistant.util.package:Attempting install of python-miio==0.4.5
INFO:homeassistant.util.package:Attempting install of python-forecastio==1.4.0
INFO:homeassistant.util.package:Attempting install of pyowm==2.10.0
INFO:homeassistant.util.package:Attempting install of pyhaversion==3.1.0
INFO:homeassistant.util.package:Attempting install of integrationhelper==0.2.2
INFO:homeassistant.util.package:Attempting install of broadlink==0.9.0
INFO:homeassistant.util.package:Attempting install of python-telegram-bot==11.1.0
INFO:homeassistant.util.package:Attempting install of xmltodict==0.12.0
INFO:homeassistant.util.package:Attempting install of googlemaps==2.5.1
INFO:homeassistant.util.package:Attempting install of broadlink==0.11.1
INFO:homeassistant.util.package:Attempting install of PyRMVtransport==0.1.3
INFO:homeassistant.util.package:Attempting install of sqlalchemy==1.3.8
INFO:homeassistant.util.package:Attempting install of alpha_vantage==2.1.0
INFO:homeassistant.util.package:Attempting install of coinmarketcap==5.0.3
INFO:homeassistant.util.package:Attempting install of herepy==0.6.3.1
INFO:homeassistant.util.package:Attempting install of hole==0.5.0
INFO:homeassistant.util.package:Attempting install of glances_api==0.2.0
INFO:homeassistant.util.package:Attempting install of psutil==5.6.3
INFO:homeassistant.util.package:Attempting install of pexpect==4.6.0
INFO:homeassistant.util.package:Attempting install of yeelight==0.5.0
INFO:homeassistant.util.package:Attempting install of home-assistant-frontend==20191002.2
INFO:homeassistant.util.package:Attempting install of pillow==6.1.0
INFO:homeassistant.util.package:Attempting install of aiogithubapi==0.4.2
INFO:homeassistant.util.package:Attempting install of aiohttp_cors==0.7.0
INFO:homeassistant.util.package:Attempting install of pyHS100==0.3.5
INFO:homeassistant.util.package:Attempting install of tplink==0.2.1
INFO:homeassistant.util.package:Attempting install of distro==1.4.0
Failed config‌
  ‌homeassistant.packages.ariela.mobile_app:‌ ‌
    - Package ariela setup failed. Component mobile_app No module named 'hass_nabucasa'
    - mobile_app: None
      utility_meter: ‌[source /home/vsts/work/1/s/./packages/ariela.yaml:2]‌
        step_counter_kevin: ‌[source /home/vsts/work/1/s/./packages/ariela.yaml:3]‌
          cycle: daily
          source: sensor.oneplus3_ariela_step_counter_sensor

Additional information:

eifinger commented 5 years ago

The link to the failed Azure CI pipeline is: https://dev.azure.com/keifinger/homeassistant-config/_build/results?buildId=109

Sjeff commented 5 years ago

Receiving a similar error with Check Home Assistant configuration add-on:

starting version 3.2.8
[10:05:21] INFO: Don't worry, this temporary installation is not overwriting your current one.
[10:05:21] INFO: Installing Home Assistant: latest...
[10:05:21] INFO: Please be patient, this might take a few minutes...
WARNING: You are using pip version 19.2.2, however version 19.2.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
[10:08:15] INFO: Installed Home Assistant 0.100.0
[10:08:15] INFO: Making a copy of your configuration for checking...
[10:10:08] INFO: Checking your configuration against this version...
[10:15:24] ERROR: The configuration check did not pass!
[10:15:24] ERROR: See the output below for more details.
INFO:homeassistant.util.package:Attempting install of colorlog==4.0.2
Testing configuration at /tmp/config
INFO:homeassistant.util.package:Attempting install of home-assistant-frontend==20191002.2
INFO:homeassistant.util.package:Attempting install of google-api-python-client==1.6.4
INFO:homeassistant.util.package:Attempting install of httplib2==0.10.3
INFO:homeassistant.util.package:Attempting install of oauth2client==4.0.0
INFO:homeassistant.util.package:Attempting install of aiohttp_cors==0.7.0
INFO:homeassistant.util.package:Attempting install of PyNaCl==1.3.0
INFO:homeassistant.util.package:Attempting install of python-nest==4.1.0
INFO:homeassistant.util.package:Attempting install of sqlalchemy==1.3.8
INFO:homeassistant.util.package:Attempting install of netdisco==2.6.0
INFO:homeassistant.util.package:Attempting install of distro==1.4.0
INFO:homeassistant.util.package:Attempting install of jsonrpc-async==0.6
INFO:homeassistant.util.package:Attempting install of jsonrpc-websocket==0.6
INFO:homeassistant.util.package:Attempting install of paho-mqtt==1.4.0
INFO:homeassistant.util.package:Attempting install of pyunifi==2.16
Failed config
  homeassistant.packages.mobile_app.mobile_app: 
    - Package mobile_app setup failed. Component mobile_app No module named 'hass_nabucasa'
    - mobile_app: None

Successful config (partial)
  homeassistant.packages.mobile_app.mobile_app:
wackydoo commented 5 years ago

Also seeing this when updating to .100. I should mention that I use pipenv and previously I have had no problems updating HA using "pipenv update" with the single dependency in my Pipfile:

[packages]
homeassistant = "*"

[Edit: Workaround is to add the hass_nabucasa package explictly to the Pipfile.]

probot-home-assistant[bot] commented 5 years ago

Hey there @robbiet480, mind taking a look at this issue as its been labeled with a integration (mobile_app) you are listed as a codeowner for? Thanks!

h4nc commented 5 years ago

I get the same as @Sjeff

uSpike commented 5 years ago

Looks like it's importing from cloud here https://github.com/home-assistant/home-assistant/blob/05ecc5a1355c7af11b5d310470a6171528dc7a2b/homeassistant/components/mobile_app/http_api.py#L8 and cloud uses hass_nabucasa

callifo commented 5 years ago

Same issue here; it was suggested in another issue with the same symptom to pip3 install hass-nabucasa

This has resolved it for me.

uSpike commented 5 years ago

It also works to explicitly enable cloud: in your configuration, which will install hass_nabucasa. #27112 introduced this change.

h4nc commented 5 years ago

I updated to 0.100.1 and I did not enable cloud: I'm running Cassio and it seems like everything is ok. No config errors (as before in the config check add-on)

P-Verbrugge commented 5 years ago

Like @h4nc I can confirm that the upgrade works just fine without having cloud enabled in the config. It's all running fine. No issues.

kevintuhumury commented 5 years ago

It's all running fine. No issues.

On a web browser, sure. It works fine indeed.

But when you're using Home Assistant through the mobile app (version 2.0) the app will crash every single time.

Also... I don't have the Home Assistant Cloud / Nabu Casa, so why would I need to include cloud: in my configuration? That doesn't make sense.

This is still failing for me.

Edit 1: Just noticed this has been fixed in 0.100.2 by PR #27470.

Edit 2: It's still failing on 0.100.2:

Failed config
  homeassistant.packages.mobile_app.mobile_app: 
    - Package mobile_app setup failed. Component mobile_app No module named 'hass_nabucasa'
    - mobile_app: None

Edit 3: (hours later) The issue with the beta app crashing is an issue in the app itself. Apparently the app uses a library which can't handle the minor version of Home Assistant. As in: now that the minor version (major: 0, minor: 100, patch: 2) of Home Assistant is on 100, it breaks because that library can only go up to 99.

Also: The main issue is still failing for me on my CI.

kevintuhumury commented 5 years ago

Since this is already closed and people might still find this... I've added cloud: to my configuration. I'm not using the cloud at all, but it does fix the issue.

It annoys my OCD that I have to add it though :P.

pergolafabio commented 5 years ago

i am using 100.2 , when i do a config check for 100.3 i also receive error below i am using nanbucasa, so enabled cloud: and also mobile_app: in my config

mobile_app: i dont use anymore, tested it with ariela, but not active anymore

Failed config General Errors:

uSpike commented 5 years ago

I find that on latest dev (acee87bef6edfa83d949a87b553bf92a9592277b)

A fresh config directory with only mobile_app: inside configuration.yaml results in:

$ hass -c config/ --script check_config
Testing configuration at /src/homeassistant/home-assistant/config/
Failed config
  General Errors: 
    - Component error: mobile_app - No module named 'hass_frontend'

Successful config (partial)

So, I tried adding frontend to mobile_app manifest.json dependencies, and that didn't work. Maybe I have a misunderstanding of what the "dependencies" in manifest.json do, but it doesn't seem to install that modules requirements.