1activegeek / docker-airconnect

AirConnect container for turning Chromecast into Airplay targets
228 stars 27 forks source link

Getting error about unable to find binary file #36

Closed MitchellSingleton closed 2 years ago

MitchellSingleton commented 2 years ago

I am running docker on raspberry pi 4, rasberryos, I am using the below compose configuration:

version: '3.2' services: airconnect: image: 1activegeek/airconnect:latest networks:

Without the arch_var specific, the container was defaulting to x86-64. So I added the arch_var and it appears to successfully influence which architecture is chosen, however the binary files are not able to be found.

Can you please confirm the correct way to identify the architecture and verify that the binaries are downloaded as expected?

1activegeek commented 2 years ago

Can you share any error messages you are seeing in the docker log outputs? I don't have non-x86 arch devices to test on currently. I suspect something may have happened in the new build process which is supposed to handle the manifest properly, but it sounds like your build did NOT grab the right arch build. You shouldn't realistically HAVE to enter that variable as it should automatically choose it (i.e. ARM should use the ARM dockerfile build which actually specifies that ENV variable).

agneevX commented 2 years ago

@MitchellSingleton the image is already built, so the RUN command won't be influenced by env vars.

@1activegeek it looks like during the build process, ARCH_VAR for arm/arm64 is set to x86_64.

1activegeek commented 2 years ago

@MitchellSingleton the image is already built, so the RUN command won't be influenced by env vars.

@1activegeek it looks like during the build process, ARCH_VAR for arm/arm64 is set to x86_64

Not entirely true. It does make some changes that are required in the 30-install, but it shouldn't be necessary anymore and won't pull the correct binary. The issue right now is your second point. I forgot to adjust the builder to choose a different dockerfile for building the different architectures. Long-term, I need to re-architect the whole structure. It was done hastily originally and should be carefully done in the dockerfile with layer optimizations. Short-term, I just need a couple logic statements to adjust the choice of dockerfile.

I'll try and work on it this weekend @MitchellSingleton

agneevX commented 2 years ago

Not entirely true. It does make some changes that are required in the 30-install

That's because that's a separate script, and not the Dockerfile.

1activegeek commented 2 years ago

Ok, builder is running a new version. Added some logic to adjust the binary downloads, and then additionally in the 30-install to normalize the ENV variable properly. Please try and test out the :dev branch of the container and see what you get. I'll run a few local tests after lunch. I don't have Arm/Arm64 variants to try however so I need your validation it's working again. You should not need to enter the ARCH_VAR argument either as it should automatically pull that from the builder process.

IMNotMax commented 2 years ago

posting here now ;) my config:

pi@RasPiDomus:~/docker $ uname -a
Linux RasPiDomus 5.10.63-v7+ #1496 SMP Wed Dec 1 15:58:11 GMT 2021 armv7l GNU/Linux

fully updated

Image used with docker-compose

  airconnect:
    image: 1activegeek/airconnect:dev
#    build:
#      context: ./docker-airconnect/
#      dockerfile: Dockerfile.armhf
#    image: airconnect:Vmax
    restart: always
    network_mode: host
    container_name: airconnect
    environment:
      - TZ=America/Montreal
      - ARCH_VAR=arm

The binaries are in arm version on the container.

pi@RasPiDomus:~/docker $ docker exec -it airconnect sh
# ls /bin/air*
/bin/aircast-arm  /bin/airupnp-arm
# exit

but docker logs:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 01-envfile: executing... 
[cont-init.d] 01-envfile: exited 0.
[cont-init.d] 01-migrations: executing... 
[migrations] started
[migrations] no migrations found
[cont-init.d] 01-migrations: exited 0.
[cont-init.d] 10-adduser: executing... 
usermod: no changes

-------------------------------------
          _         ()
         | |  ___   _    __
         | | / __| | |  /  \ 
         | | \__ \ | | | () |
         |_| |___/ |_|  \__/

Brought to you by linuxserver.io
-------------------------------------

To support LSIO projects visit:
https://www.linuxserver.io/donate/
-------------------------------------
GID/UID
-------------------------------------

User uid:    911
User gid:    911
-------------------------------------

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 30-install: executing... 
/var/run/s6/etc/cont-init.d/30-install: line 57: syntax error: unexpected end of file
[cont-init.d] 30-install: exited 2.
[cont-init.d] 90-custom-folders: executing... 
[cont-init.d] 90-custom-folders: exited 0.
[cont-init.d] 99-custom-scripts: executing... 
[custom-init] no custom files found exiting...
[cont-init.d] 99-custom-scripts: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
2022-01-03 09:46:49,407 CRIT Supervisor running as root (no user in config file)
2022-01-03 09:46:49,421 INFO supervisord started with pid 296
2022-01-03 09:46:50,424 INFO spawnerr: can't find command '/bin/airupnp-x86-64'
2022-01-03 09:46:50,425 INFO spawnerr: can't find command '/bin/aircast-x86-64'
2022-01-03 09:46:51,429 INFO spawnerr: can't find command '/bin/airupnp-x86-64'
2022-01-03 09:46:51,430 INFO spawnerr: can't find command '/bin/aircast-x86-64'
2022-01-03 09:46:53,434 INFO spawnerr: can't find command '/bin/airupnp-x86-64'
2022-01-03 09:46:53,436 INFO spawnerr: can't find command '/bin/aircast-x86-64'
2022-01-03 09:46:56,445 INFO spawnerr: can't find command '/bin/airupnp-x86-64'
2022-01-03 09:46:56,445 INFO gave up: airupnp-x86-64 entered FATAL state, too many start retries too quickly
2022-01-03 09:46:56,447 INFO spawnerr: can't find command '/bin/aircast-x86-64'
2022-01-03 09:46:56,448 INFO gave up: aircast-x86-64 entered FATAL state, too many start retries too quickly

maybe the arm ENV is simply not passed (the container is good with the binaries but fails to launch these bin.

I don't see the arm tag on the logs like in the "latest" tag:

...
Checking for valid arch options
Proceeding with arm arch
...

detail below from the latest image


[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 01-envfile: executing... 
[cont-init.d] 01-envfile: exited 0.
[cont-init.d] 01-migrations: executing... 
[migrations] started
[migrations] no migrations found
[cont-init.d] 01-migrations: exited 0.
[cont-init.d] 10-adduser: executing... 
usermod: no changes

-------------------------------------
          _         ()
         | |  ___   _    __
         | | / __| | |  /  \ 
         | | \__ \ | | | () |
         |_| |___/ |_|  \__/

Brought to you by linuxserver.io
-------------------------------------

To support LSIO projects visit:
https://www.linuxserver.io/donate/
-------------------------------------
GID/UID
-------------------------------------

User uid:    911
User gid:    911
-------------------------------------

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 30-install: executing... 
Checking for valid arch options
Proceeding with arm arch
[cont-init.d] 30-install: exited 0.
[cont-init.d] 90-custom-folders: executing... 
[cont-init.d] 90-custom-folders: exited 0.
[cont-init.d] 99-custom-scripts: executing... 
[custom-init] no custom files found exiting...
[cont-init.d] 99-custom-scripts: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
2022-01-03 09:55:10,127 CRIT Supervisor running as root (no user in config file)
2022-01-03 09:55:10,140 INFO supervisord started with pid 306
2022-01-03 09:55:11,144 INFO spawnerr: can't find command '/bin/airupnp-arm'
2022-01-03 09:55:11,146 INFO spawnerr: can't find command '/bin/aircast-arm'
2022-01-03 09:55:12,149 INFO spawnerr: can't find command '/bin/airupnp-arm'
2022-01-03 09:55:12,150 INFO spawnerr: can't find command '/bin/aircast-arm'
2022-01-03 09:55:14,154 INFO spawnerr: can't find command '/bin/airupnp-arm'
2022-01-03 09:55:14,155 INFO spawnerr: can't find command '/bin/aircast-arm'
2022-01-03 09:55:17,161 INFO spawnerr: can't find command '/bin/airupnp-arm'
2022-01-03 09:55:17,161 INFO gave up: airupnp-arm entered FATAL state, too many start retries too quickly
2022-01-03 09:55:17,165 INFO spawnerr: can't find command '/bin/aircast-arm'
2022-01-03 09:55:17,166 INFO gave up: aircast-arm entered FATAL state, too many start retries too quickly
1activegeek commented 2 years ago

Interesting, I must have screwed up something in the 30-install script. Let me dig into it.

IMNotMax commented 2 years ago

FYI, the ENV looks good

pi@RasPiDomus:~/docker $ docker exec -it airconnect sh
# printenv
LANGUAGE=en_US.UTF-8
HOSTNAME=RasPiDomus
HOME=/root
ARCH_VAR=arm
TERM=xterm
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
LANG=en_US.UTF-8
PWD=/
TZ=America/Montreal
# 
1activegeek commented 2 years ago

Thanks for the followups @IMNotMax. I found what is likely the issue here. In your logs using the dev tag I see there was an issue in the 30-install file:

[cont-init.d] 30-install: executing... 
/var/run/s6/etc/cont-init.d/30-install: line 57: syntax error: unexpected end of file

Checking it out, I missed a fi to close an if loop at the top where I added the new logic. I've made that change, and the builder is running right now.

The issue with the latest tag that this fixes, is that it was ONLY downloading the x86-64 binary because there was no specification of which Dockerfile to use. I was using separate Dockerfiles for the different platforms, and with the move to downloading the binary as part of the image build, I failed to realize I needed to adjust the dockerfile to account for different platforms since the builder only grabs a single dockerfile.

Long story short - try out the latest dev tag now. You'll need to do a quick docker pull to get the latest that just posted.

AllMightySauron commented 2 years ago

Hi,

I've switched to this issue. :)

Binaries seem fine now.

root@pi:/bin# ls -l air*
-rwxr-xr-x 1 root root 440256 Jan  1 17:57 aircast-aarch64
-rwxr-xr-x 1 root root 521256 Jan  1 17:57 airupnp-aarch64
root@pi:/bin#

However, the entry point to run as daemon does not. It seems to be trying to launch the x86 version, instead of the armv7 it should for my raspberry pi:

[cont-init.d] executing container initialization scripts...
[cont-init.d] 01-envfile: executing... 
[cont-init.d] 01-envfile: exited 0.
[cont-init.d] 01-migrations: executing... 
[migrations] started
[migrations] no migrations found
[cont-init.d] 01-migrations: exited 0.
[cont-init.d] 10-adduser: executing... 
usermod: no changes
-------------------------------------
          _         ()
         | |  ___   _    __
         | | / __| | |  /  \ 
         | | \__ \ | | | () |
         |_| |___/ |_|  \__/
Brought to you by linuxserver.io
-------------------------------------
To support LSIO projects visit:
https://www.linuxserver.io/donate/
-------------------------------------
GID/UID
-------------------------------------
User uid:    911
User gid:    911
-------------------------------------
[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 30-install: executing... 
/var/run/s6/etc/cont-init.d/30-install: line 57: syntax error: unexpected end of file
[cont-init.d] 30-install: exited 2.
[cont-init.d] 90-custom-folders: executing... 
[cont-init.d] 90-custom-folders: exited 0.
[cont-init.d] 99-custom-scripts: executing... 
[custom-init] no custom files found exiting...
[cont-init.d] 99-custom-scripts: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
2022-01-03 15:25:46,143 CRIT Supervisor running as root (no user in config file)
2022-01-03 15:25:46,153 INFO supervisord started with pid 290
2022-01-03 15:25:47,155 INFO spawnerr: can't find command '/bin/airupnp-x86-64'
2022-01-03 15:25:47,156 INFO spawnerr: can't find command '/bin/aircast-x86-64'
2022-01-03 15:25:48,158 INFO spawnerr: can't find command '/bin/airupnp-x86-64'
2022-01-03 15:25:48,159 INFO spawnerr: can't find command '/bin/aircast-x86-64'
2022-01-03 15:25:50,163 INFO spawnerr: can't find command '/bin/airupnp-x86-64'
2022-01-03 15:25:50,164 INFO spawnerr: can't find command '/bin/aircast-x86-64'
2022-01-03 15:25:53,169 INFO spawnerr: can't find command '/bin/airupnp-x86-64'
2022-01-03 15:25:53,170 INFO gave up: airupnp-x86-64 entered FATAL state, too many start retries too quickly
2022-01-03 15:25:53,171 INFO spawnerr: can't find command '/bin/aircast-x86-64'
2022-01-03 15:25:53,171 INFO gave up: aircast-x86-64 entered FATAL state, too many start retries too quickly
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.
2022-01-03 15:27:25,857 WARN received SIGHUP indicating restart request
2022-01-03 15:27:25,873 CRIT Supervisor running as root (no user in config file)
2022-01-03 15:27:25,875 INFO supervisord started with pid 290
2022-01-03 15:27:26,877 INFO spawnerr: can't find command '/bin/airupnp-x86-64'
2022-01-03 15:27:26,878 INFO spawnerr: can't find command '/bin/aircast-x86-64'

It all works fine if I launch the aircast-aarch64 manually from the command line...

Thanks

1activegeek commented 2 years ago

@AllMightySauron please try doing a fresh pull of the image that was just posted with dev. I can see in your run the same as I saw in Max's - that 30-install had a syntax error, and thus it never ran, correctly modifying the binary run command. I just made a fix and pushed that out as I found a stupid error noted above.

IMNotMax commented 2 years ago

Got it !

after cleaning container and images.

pi@RasPiDomus:~/docker $ docker-compose up -d
Pulling airconnect (1activegeek/airconnect:dev)...
dev: Pulling from 1activegeek/airconnect
1fab07dfa6d3: Already exists
63fc6f6afc06: Already exists
606c86695ed0: Already exists
cc951d66bbd4: Already exists
688d79095243: Already exists
9e5237a4925f: Already exists
f95557d0957f: Already exists
a267faf9b4b6: Pull complete
99d96287dc24: Pull complete
f4d4fc4dadec: Pull complete
Digest: sha256:e805760aae7a94aee10632fffb073608fbee10ccb122cd5307b145ebfc4941e0
Status: Downloaded newer image for 1activegeek/airconnect:dev
Creating airconnect ... done

then

pi@RasPiDomus:~/docker $ docker logs airconnect
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 01-envfile: executing... 
[cont-init.d] 01-envfile: exited 0.
[cont-init.d] 01-migrations: executing... 
[migrations] started
[migrations] no migrations found
[cont-init.d] 01-migrations: exited 0.
[cont-init.d] 10-adduser: executing... 

-------------------------------------
          _         ()
         | |  ___   _    __
         | | / __| | |  /  \ 
         | | \__ \ | | | () |
         |_| |___/ |_|  \__/

Brought to you by linuxserver.io
-------------------------------------

usermod: no changes
To support LSIO projects visit:
https://www.linuxserver.io/donate/
-------------------------------------
GID/UID
-------------------------------------

User uid:    911
User gid:    911
-------------------------------------

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 30-install: executing... 
Checking for valid arch options
Proceeding with arm arch
[cont-init.d] 30-install: exited 0.
[cont-init.d] 90-custom-folders: executing... 
[cont-init.d] 90-custom-folders: exited 0.
[cont-init.d] 99-custom-scripts: executing... 
[custom-init] no custom files found exiting...
[cont-init.d] 99-custom-scripts: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
2022-01-03 10:33:11,872 CRIT Supervisor running as root (no user in config file)
2022-01-03 10:33:11,884 INFO supervisord started with pid 307
2022-01-03 10:33:12,890 INFO spawned: 'airupnp-arm' with pid 310
2022-01-03 10:33:12,894 INFO spawned: 'aircast-arm' with pid 311
2022-01-03 10:33:14,008 INFO success: airupnp-arm entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2022-01-03 10:33:14,008 INFO success: aircast-arm entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

And AirPlay is working again ;)

AllMightySauron commented 2 years ago

That did it:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 01-envfile: executing... 
[cont-init.d] 01-envfile: exited 0.
[cont-init.d] 01-migrations: executing... 
[migrations] started
[migrations] no migrations found
[cont-init.d] 01-migrations: exited 0.
[cont-init.d] 10-adduser: executing... 
usermod: no changes
-------------------------------------
          _         ()
         | |  ___   _    __
         | | / __| | |  /  \ 
         | | \__ \ | | | () |
         |_| |___/ |_|  \__/
Brought to you by linuxserver.io
-------------------------------------
To support LSIO projects visit:
https://www.linuxserver.io/donate/
-------------------------------------
GID/UID
-------------------------------------
User uid:    911
User gid:    911
-------------------------------------
[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 30-install: executing... 
Checking for valid arch options
Proceeding with aarch64 arch
[cont-init.d] 30-install: exited 0.
[cont-init.d] 90-custom-folders: executing... 
[cont-init.d] 90-custom-folders: exited 0.
[cont-init.d] 99-custom-scripts: executing... 
[custom-init] no custom files found exiting...
[cont-init.d] 99-custom-scripts: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
2022-01-03 15:38:37,112 CRIT Supervisor running as root (no user in config file)
2022-01-03 15:38:37,121 INFO supervisord started with pid 297
2022-01-03 15:38:38,127 INFO spawned: 'airupnp-aarch64' with pid 310
2022-01-03 15:38:38,134 INFO spawned: 'aircast-aarch64' with pid 311
2022-01-03 15:38:39,201 INFO success: airupnp-aarch64 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2022-01-03 15:38:39,201 INFO success: aircast-aarch64 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

Thanks!

1activegeek commented 2 years ago

Awesome!! Thank you both for testing, and coincidentally both arm and arm64 it appears. Should be good to push this to latest. Will try to do that a bit later today. Will post comment here when pushed.

IMNotMax commented 2 years ago

Excellent ! And feel free to ask if you want to test something!

agneevX commented 2 years ago

@1activegeek consider adding shellcheck to your GH actions 👍

1activegeek commented 2 years ago

@IMNotMax @AllMightySauron please feel free to switch over and use latest now as the build has been pushed.

@agneevX not familiar with that. I'll take a look in the future, though hopefully I won't need to touch this repo for awhile now! 😛