TravisCI platform configured, but no entities are being added

Hey all. I am fairly new to Home Assistant, using Hass.io on a Rasberry Pi. I am trying to configure an Automation to do a git pull on a config that passes TravisCi build, but I am having an issue with creating the sensors in HomeAssistant for TravisCI.

My configuration.yaml looks like:

sensor: !include sensor.yaml

My sensor.yaml has entry:

- platform: travisci
  api_key: !secret gh_token
  repository: 'githubuser/githubrepo'

The error I am seeing in the logging is copied below:

Log Details (ERROR)
Sat Oct 19 2019 14:03:12 GMT-0400 (Eastern Daylight Time)
travisci: Error on device update!
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 292, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 448, in async_device_update
    await self.hass.async_add_executor_job(self.update)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/travisci/sensor.py", line 155, in update
    repo = self._data.repo(self._repo_name)
  File "/usr/local/lib/python3.7/site-packages/travispy/travispy.py", line 269, in repo
    return Repo.find_one(self._session, id_or_slug)
  File "/usr/local/lib/python3.7/site-packages/travispy/entities/repo.py", line 72, in find_one
    result = super(Repo, cls).find_one(session, entity_id, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/travispy/entities/_entity.py", line 90, in find_one
    contents = get_response_contents(response)
  File "/usr/local/lib/python3.7/site-packages/travispy/_helpers.py", line 40, in get_response_contents
    raise TravisError(contents)
travispy.errors.TravisError: [404] not found

I have configured the sensor’s API token using the GitHub token as discussed on the docs here. Any help on clarifying this would be greatly appreciated.

2 Likes

I have the same issue, but no way to figure out what the problem is.

same here as well. no other logs or status messages to debug what the issue is.

Hi,

i also have issues with the Travis CI integration.

Home-Assistant is running on version 0.106.0.

My Travis CI integration:

In configuration.yaml:

sensor: !include_dir_list sensors

travisci.yaml in folder /sensors:

platform: travisci
api_key: !secret travisci_api

The error in log file:

DEBUG (SyncWorker_13) [homeassistant.util.json] JSON file not found: /usr/src/homeassistant/homeassistant/components/travisci/.translations/sensor.de.json

In the folder /usr/src/homeassistant/homeassistant/components/travisci, i dont see a folder “.translations”

/usr/src/homeassistant/homeassistant/components/travisci
bash-5.0# ls -lhtra
total 52K
-rw-r--r--    1 root     root        5.3K Feb 26 14:45 sensor.py
-rw-r--r--    1 root     root         205 Feb 26 14:45 manifest.json
-rw-r--r--    1 root     root          30 Feb 26 14:45 __init__.py
drwxr-xr-x    1 root     root       24.0K Feb 26 14:58 ..
drwxr-xr-x    2 root     root        4.0K Feb 26 14:58 __pycache__
drwxr-xr-x    1 root     root        4.0K Feb 26 14:58 .

Anybody figure this out? I just tried setting up the sensor as well…

- platform: travisci
  api_key: !secret travisci_api_key
  monitored_conditions:
    - last_build_id
    - last_build_state

Running 0.112.4 currently.

I’ve made the repo public, set up the sensor in a few different ways, but no luck. Same 404 error every time…

travisci: Error on device update!
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 319, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 466, in async_device_update
    self.update  # type: ignore
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/travisci/sensor.py", line 154, in update
    repo = self._data.repo(self._repo_name)
  File "/usr/local/lib/python3.7/site-packages/travispy/travispy.py", line 269, in repo
    return Repo.find_one(self._session, id_or_slug)
  File "/usr/local/lib/python3.7/site-packages/travispy/entities/repo.py", line 72, in find_one
    result = super(Repo, cls).find_one(session, entity_id, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/travispy/entities/_entity.py", line 90, in find_one
    contents = get_response_contents(response)
  File "/usr/local/lib/python3.7/site-packages/travispy/_helpers.py", line 40, in get_response_contents
    raise TravisError(contents)
travispy.errors.TravisError: [404] not found

I had the same issue today. I was using travis-ci.com.
Then, I tried by setting a build in travis-ci.org as its a different platform it seems

It worked. Go figure…