hacs / integration

HACS gives you a powerful UI to handle downloads of all your custom needs.
https://hacs.xyz
MIT License
4.91k stars 1.23k forks source link

Unable to install version from main branch when "zipRelease": true #3513

Closed L2jLiga closed 4 months ago

L2jLiga commented 4 months ago

System Health details

System Information

version core-2024.2.1
installation_type Unknown
dev false
hassio false
docker false
user root
virtualenv false
python_version 3.12.1
os_name Linux
os_version 5.15.0-1053-realtime
arch x86_64
timezone Europe/Kaliningrad
config_dir /config
Home Assistant Community Store GitHub API | ok -- | -- GitHub Content | ok GitHub Web | ok GitHub API Calls Remaining | 4600 Installed Version | 1.34.0 Stage | running Available Repositories | 1460 Downloaded Repositories | 16
AccuWeather can_reach_server | ok -- | -- remaining_requests | 23
Home Assistant Cloud logged_in | false -- | -- can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | ok
Dashboards dashboards | 3 -- | -- resources | 8 views | 13 mode | storage
Recorder oldest_recorder_run | September 27, 2023 at 09:03 -- | -- current_recorder_run | February 16, 2024 at 13:46 estimated_db_size | 13243.73 MiB database_engine | postgresql database_version | 16.0

Checklist

Describe the issue

When trying to install version from master branch HACS stucks at downloading

image

Reproduction steps

  1. Open HA
  2. Navigate to HACS
  3. Click "Explore and download repositories"
  4. Search for any with "zip_release": true, for example "Mikrotik Router" integration and click on it
  5. Click "Download"
  6. In "Select version" dropdown choose main branch ("master" or "main" or "dev")
  7. Click "Download"

Debug logs

2024-02-16 13:50:00.175 ERROR (MainThread) [custom_components.hacs] Download failed - Got status code 404 when trying to download https://github.com/tomaae/homeassistant-mikrotik_router/releases/download/master/mikrotik_router.zip
Traceback (most recent call last):
  File "/config/custom_components/hacs/base.py", line 730, in async_download_file
    raise HacsException(
custom_components.hacs.exceptions.HacsException: Got status code 404 when trying to download https://github.com/tomaae/homeassistant-mikrotik_router/releases/download/master/mikrotik_router.zip
2024-02-16 13:50:00.180 ERROR (MainThread) [custom_components.hacs] <Integration tomaae/homeassistant-mikrotik_router> Failed to download https://github.com/tomaae/homeassistant-mikrotik_router/releases/download/master/mikrotik_router.zip
2024-02-16 13:50:06.753 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140508956649280] Error handling message: Unknown error (unknown_error) Андрей from fd02:21:22:0:dea6:32ff:fea9:f5eb (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 26, in _handle_async_response
    await func(hass, connection, msg)
  File "/config/custom_components/hacs/websocket/repository.py", line 234, in hacs_repository_download
    await repository.async_install()
  File "/config/custom_components/hacs/repositories/base.py", line 893, in async_install
    await self.async_install_repository(version=version)
  File "/config/custom_components/hacs/repositories/base.py", line 990, in async_install_repository
    raise HacsException("Could not download, see log for details")
custom_components.hacs.exceptions.HacsException: Could not download, see log for details

Diagnostics dump

No response

hacs-bot[bot] commented 4 months ago

Make sure you have read the issue guidelines and that you filled out the entire template.

If you have an issue identical to this, do not add comments like "same here", "i have this too", instead add a :+1: reaction to the issue description. Thanks! :+1:

ludeeus commented 4 months ago

This is correct. It should not be possible. When a repository uses release assets (zip_release), only those assets are valid.

L2jLiga commented 4 months ago

Then what I can do to download version from master branch? Currently I'm downloading it manually with wget and unzip.

Also I'm pretty sure that I was able to download master branch with "zipRelease" in previous HACS versions

ludeeus commented 4 months ago

Ask the author if you need a development version. If that was possible before, that was a bug.

L2jLiga commented 4 months ago

Thanks, I've created issue in mikrotik router about inability to install from master.

Btw, from HACS size I guess it would be better to set "hide_default_branch" to true when "zip_release" is set to true, isn't it?

ludeeus commented 4 months ago

Yes

tomaae commented 4 months ago

yes, it was possible to install master even with zip releases. obviously master cannot have zip. if this is intended behavior now, it would be better to hide master option by default when zip_release is selected.