Ulrar / hassio-addons

Repo for hassio addons
MIT License
23 stars 10 forks source link

Can't Install Raspotify #17

Closed floodwayprintco closed 3 years ago

floodwayprintco commented 3 years ago

Hi there, thanks for these addons! But I am having trouble getting Raspotify going. It doesn't say much, just:

Failed to install addon, Unknown Error, see logs

20-08-03 20:49:54 INFO (SyncWorker_7) [supervisor.docker.addon] Start build e4ac757a/armv7-addon-raspotify:dev 20-08-03 20:50:00 ERROR (SyncWorker_7) [supervisor.docker.addon] Can't build e4ac757a/armv7-addon-raspotify:dev: The command '/bin/bash -o pipefail -c git clone git://github.com/librespot-org/librespot.git /tmp/librespot && cd /tmp/librespot && git config --global user.name build && git config --global user.email "none@none.tld" && git apply /tmp/metadata-pipe.patch' returned a non-zero code: 1

Any ideas what this is about?

marecabo commented 3 years ago

It looks like the default branch of librespot is 'dev' which might be less stable than 'master'? If this would be the case here, one could use git clone git://github.com/librespot-org/librespot.git --branch master --depth 1 /tmp/librespot. However, I have not tested if this is the cause.

floodwayprintco commented 3 years ago

Thank you for your help. I ran that script and all looked good, no errors when I ran it. I restarted HA and tried to install Raspotify but am getting the same error:

Failed to install addon, Unknown Error, see logs

20-08-04 17:08:01 ERROR (SyncWorker_5) [supervisor.docker.addon] Can't build e4ac757a/armv7-addon-raspotify:dev: The command '/bin/bash -o pipefail -c git clone git://github.com/librespot-org/librespot.git /tmp/librespot && cd /tmp/librespot && git config --global user.name build && git config --global user.email "none@none.tld" && git apply /tmp/metadata-pipe.patch' returned a non-zero code: 1

Ulrar commented 3 years ago

Hey,

Sorry about the delay. I've updated the patch and the addon to build against the master branch, that should hopefully resolve your issue. If not, let me know.

Antexa commented 3 years ago

Hey,

I try to build Raspotify today with your latest patch and it fail :


20-08-20 16:15:18 ERROR (SyncWorker_7) [supervisor.docker.addon] Can't build e4ac757a/armv7-addon-raspotify:dev: The command '/bin/bash -o pipefail -c ${BUILD_ARCH}-linux-gnu-strip /usr/bin/librespot' returned a non-zero code: 127
20-08-20 16:15:18 ERROR (MainThread) [asyncio] Task exception was never retrieved
future: <Task finished name='Task-103565' coro=<AddonManager.install() done, defined at /usr/src/supervisor/supervisor/addons/__init__.py:129> exception=AddonsError()>
Traceback (most recent call last):
  File "/usr/src/supervisor/supervisor/docker/addon.py", line 394, in _build
    image, log = self.sys_docker.images.build(
  File "/usr/local/lib/python3.8/site-packages/docker/models/images.py", line 287, in build
    raise BuildError(chunk['error'], result_stream)
docker.errors.BuildError: The command '/bin/bash -o pipefail -c ${BUILD_ARCH}-linux-gnu-strip /usr/bin/librespot' returned a non-zero code: 127

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/supervisor/supervisor/addons/__init__.py", line 155, in install
    await addon.instance.install(store.version, store.image)
  File "/usr/src/supervisor/supervisor/utils/__init__.py", line 32, in wrap_api
    return await method(api, *args, **kwargs)
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/supervisor/supervisor/docker/addon.py", line 381, in _install
    self._build(tag)
  File "/usr/src/supervisor/supervisor/docker/addon.py", line 405, in _build
    raise DockerAPIError()
supervisor.exceptions.DockerAPIError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/supervisor/supervisor/addons/__init__.py", line 158, in install
    raise AddonsError()
supervisor.exceptions.AddonsError
Ulrar commented 3 years ago

Hi,

That's interesting, it's a different error. Looks like it failed on the strip after the build, which I suppose isn't critical it's just making the binary a bit smaller. What are you running this on, a pi4 ? Is it hassos or a supervised install ? Just wondering why you could be missing the strip binary, that's very strange. Any chance you might have run out of ram during the build ?

On Thu 20 Aug 2020, 17:19 Antexa, notifications@github.com wrote:

Hey,

I try to build Raspotify today with your latest patch and it fail :

20-08-20 16:15:18 ERROR (SyncWorker_7) [supervisor.docker.addon] Can't build e4ac757a/armv7-addon-raspotify:dev: The command '/bin/bash -o pipefail -c ${BUILD_ARCH}-linux-gnu-strip /usr/bin/librespot' returned a non-zero code: 127 20-08-20 16:15:18 ERROR (MainThread) [asyncio] Task exception was never retrieved future: <Task finished name='Task-103565' coro=<AddonManager.install() done, defined at /usr/src/supervisor/supervisor/addons/init.py:129> exception=AddonsError()> Traceback (most recent call last): File "/usr/src/supervisor/supervisor/docker/addon.py", line 394, in _build image, log = self.sys_docker.images.build( File "/usr/local/lib/python3.8/site-packages/docker/models/images.py", line 287, in build raise BuildError(chunk['error'], result_stream) docker.errors.BuildError: The command '/bin/bash -o pipefail -c ${BUILD_ARCH}-linux-gnu-strip /usr/bin/librespot' returned a non-zero code: 127

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/src/supervisor/supervisor/addons/init.py", line 155, in install await addon.instance.install(store.version, store.image) File "/usr/src/supervisor/supervisor/utils/init.py", line 32, in wrap_api return await method(api, *args, *kwargs) File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run result = self.fn(self.args, **self.kwargs) File "/usr/src/supervisor/supervisor/docker/addon.py", line 381, in _install self._build(tag) File "/usr/src/supervisor/supervisor/docker/addon.py", line 405, in _build raise DockerAPIError() supervisor.exceptions.DockerAPIError

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/src/supervisor/supervisor/addons/init.py", line 158, in install raise AddonsError() supervisor.exceptions.AddonsError

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Ulrar/hassio-addons/issues/17#issuecomment-677763422, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGVHT6BX67LDXWSRCIYDU3SBVEIFANCNFSM4PTYE37A .

Antexa commented 3 years ago

Hey,

What are you running this on, a pi4 ? Is it hassos or a supervised install? Yes, PI4 2GB with supervised install

pi@raspberrypi:~ $ uname -a
Linux raspberrypi 4.19.118-v7l+ #1311 SMP Mon Apr 27 14:26:42 BST 2020 armv7l GNU/Linux

Any chance you might have run out of ram during the build ? I got 1 GB free in idle, It may enough ?

I can open a new issue, if this new one is not related to the previous one

Antexa commented 3 years ago

I tried to build locally through ssh and it seems that the var ${BUILD_ARCH} is not implemented :

Step 19/28 : RUN ${BUILD_ARCH}-linux-gnu-strip /usr/bin/librespot
 ---> Running in d0b769ce413b
/bin/bash: -linux-gnu-strip: command not found
The command '/bin/bash -o pipefail -c ${BUILD_ARCH}-linux-gnu-strip /usr/bin/librespot' returned a non-zero code: 127
Ulrar commented 3 years ago

That doesn't seem right, that's should be defined by hassio when building. If you're building manually you need to pass it to docker build, in your case the value would be armv7.

I think the issue could be that debian (on which the image is based) doesn't use the name armv7, they use armhf I believe. I don't have anything on that arch to test it but I suspect the binary might be named armhf-linux-gnu-strip, could you take a look on your side and see if you have a binary with that name or something similar ? If that's the case I can add a condition for that arch in the file and you'll be set.

Once the docker hub supports other archs, with any luck, I should be able to just have it build these, which should make all of this much easier for everyone.

Antexa commented 3 years ago

Hey,

I'm not sure on how to force this. Could you explain me the steps to achieve this ?

I try to set up the ARG in the Dockerfile, unfortunately this doesn't work.

ARG BUILD_ARCH=armhf

Ulrar commented 3 years ago

Hey,

You can't pass armhf, the arch in hassio is called armv7 but I don't thing Debian calls it that. If you've pulled the repo locally you could just replace that variable in the Dockerfile and see if it builds ?

On Fri 21 Aug 2020, 20:21 Antexa, notifications@github.com wrote:

Hey,

I'm not sure on how to force this. Could you explain me the steps to achieve this ?

I try to set up the ARG in the Dockerfile, unfortunately this doesn't work.

ARG BUILD_ARCH=armhf

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Ulrar/hassio-addons/issues/17#issuecomment-678451848, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGVHT4F6SGSU6YJXARD4V3SB3CMVANCNFSM4PTYE37A .

Antexa commented 3 years ago

I can't get this works.

Something bothered me, when I try to build I notice that base-image is pulled. Why the base image (debian-base-armv7) in build.json is not used?

"armv7": "hassioaddons/debian-base-armv7:3.0.0",

Sending build context to Docker daemon  39.94kB
Step 1/28 : ARG BUILD_FROM=hassioaddons/debian-base:3.0.0
Step 2/28 : FROM ${BUILD_FROM} as base
 ---> a3d622ffc3f9
Step 3/28 : ARG BUILD_ARCH
 ---> Using cache
 ---> 24ad2531dfc7
Ulrar commented 3 years ago

That's likely because you're running it manually, build.json is a hassio config file, not docker.

I've pushed a change to use arm-linux-gnu-strip on armv7, looking at this I'm hoping that's the one. To be safe I've added a ;true to it so even if that's not it, it should succeed. The binary will be a bit bigger but that shouldn't be an issue. Could you refresh the repo and try ?

Antexa commented 3 years ago

This is working !! 👍

I think, I still have an issue with the ARG coming from my supervised install of Hassio.

Ulrar commented 3 years ago

Great ! So you're able to use it now or is it failing with a new error ?

Antexa commented 3 years ago

I think it's correct (dunno nothing about raspotify features arg like linear volume, normalisation, ...) , however I got flooded with WARN like this one :

[2020-08-23T18:19:41Z WARN libmdns::fsm] couldn't parse packet from V4(172.30.32.1:5353): ReservedBitsAreNonZero

I give it a go with this config, this is the one your recommend ?

name: Raspotify
bitrate: 320
volume_normalisation: true
backend: pipe
username: **redacted**
password: **redacted**
device: /share/forked-daapd/music/Raspotify
metadata_pipe: /share/forked-daapd/music/Raspotify.metadata
Ulrar commented 3 years ago

If you're using it with forked-daapd then yes, that'd be it. I don't use username / password myself but it should work either way. As for the warning I'm not sure what that could be, hopefully it won't be an issue or we'll have to ask the librespot dev I suppose

floodwayprintco commented 3 years ago

Hey,

Sorry about the delay. I've updated the patch and the addon to build against the master branch, that should hopefully resolve your issue. If not, let me know.

Just chiming in to say this worked for me, hooray and THANK YOU! This really helps tie my system together.

Ulrar commented 3 years ago

Glad to hear it ! I'll probably have to use a specific commit as it'll likely break again when they update master, but we'll see when that happens.

Since this seems resolved for everyone I'll go ahead and close this, feel free to re-open if needed of course.

amitkeret commented 3 years ago

Sorry to open this issue again... I'm having similar issues where the installation fails.

Initially the error was for line 25:

The command '/bin/bash -o pipefail -c curl https://sh.rustup.rs -sSf | sh -s -- -y

Following this happening once, though, the error is now consistently on line 31:

The command '/bin/bash -o pipefail -c git clone git://github.com/librespot-org/librespot.git /tmp/librespot && cd /tmp/librespot && git checkout master && git config --global user.name build && git config --global user.email "none@none.tld" && git apply /tmp/metadata-pipe.patch' returned a non-zero code: 1

I'm can't figure out the reason for this. Any help will be appreciated. I'm this close to achieving multiroom Chromecast audio with your brilliant add-on! Thanks

keliam commented 2 years ago

Having the same issue as @amitkeret