1activegeek / docker-airconnect

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

Architecture variable not working #19

Closed dmatora closed 3 years ago

dmatora commented 3 years ago

Trying to run 1activegeek/airconnect:latest-arm using Portainer inside Home Assistant OS running on Raspberry Pi 4 and it fails to run

Checking for valid arch options,
Proceeding with aarch64 arch,
--2020-12-12 16:00:21--  https://raw.githubusercontent.com/philippe44/AirConnect/master/bin/airupnp-aarch64,
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.244.133,
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|151.101.244.133|:443... connected.,
HTTP request sent, awaiting response... 200 OK,
Length: 521200 (509K) [application/octet-stream],
Saving to: ‘/bin/airupnp-aarch64’,
     0K .......... .......... .......... .......... ..........  9%  764K 1s,
    50K .......... .......... .......... .......... .......... 19% 1.00M 0s,
   100K .......... .......... .......... .......... .......... 29% 1.07M 0s,
   150K .......... .......... .......... .......... .......... 39% 1.00M 0s,
   200K .......... .......... .......... .......... .......... 49% 1.61M 0s,
   250K .......... .......... .......... .......... .......... 58% 1014K 0s,
   300K .......... .......... .......... .......... .......... 68%  507K 0s,
   350K .......... .......... .......... .......... .......... 78% 8.37M 0s,
   400K .......... .......... .......... .......... .......... 88% 7.51M 0s,
   450K .......... .......... .......... .......... .......... 98%  828K 0s,
   500K ........                                              100% 1.33M=0.5s,
2020-12-12 16:00:22 (1.07 MB/s) - ‘/bin/airupnp-aarch64’ saved [521200/521200],
--2020-12-12 16:00:22--  https://raw.githubusercontent.com/philippe44/AirConnect/master/bin/aircast-aarch64,
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.244.133,
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|151.101.244.133|:443... connected.,
HTTP request sent, awaiting response... 200 OK,
Length: 440208 (430K) [application/octet-stream],
Saving to: ‘/bin/aircast-aarch64’,
     0K .......... .......... .......... .......... .......... 11%  750K 1s,
    50K .......... .......... .......... .......... .......... 23%  742K 0s,
   100K .......... .......... .......... .......... .......... 34% 1.66M 0s,
   150K .......... .......... .......... .......... .......... 46% 1.54M 0s,
   200K .......... .......... .......... .......... .......... 58% 1.34M 0s,
   250K .......... .......... .......... .......... .......... 69% 1.36M 0s,
   300K .......... .......... .......... .......... .......... 81% 1.47M 0s,
   350K .......... .......... .......... .......... .......... 93% 1.66M 0s,
   400K .......... .......... .........                       100% 1.60M=0.3s,
2020-12-12 16:00:22 (1.20 MB/s) - ‘/bin/aircast-aarch64’ saved [440208/440208],
[cont-init.d] 30-install: 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.,
2020-12-12 16:00:23,329 CRIT Supervisor running as root (no user in config file),
2020-12-12 16:00:23,338 INFO supervisord started with pid 269,
2020-12-12 16:00:24,345 INFO spawned: 'airupnp-aarch64' with pid 277,
2020-12-12 16:00:24,353 INFO spawned: 'airupnp-aarch64' with pid 278,
2020-12-12 16:00:24,366 INFO exited: airupnp-aarch64 (exit status 127; not expected),
2020-12-12 16:00:24,370 INFO exited: airupnp-aarch64 (exit status 127; not expected),
2020-12-12 16:00:25,377 INFO spawned: 'airupnp-aarch64' with pid 279,
2020-12-12 16:00:25,386 INFO spawned: 'airupnp-aarch64' with pid 280,
2020-12-12 16:00:25,397 INFO exited: airupnp-aarch64 (exit status 127; not expected),
2020-12-12 16:00:25,405 INFO exited: airupnp-aarch64 (exit status 127; not expected),
2020-12-12 16:00:27,415 INFO spawned: 'airupnp-aarch64' with pid 281,
2020-12-12 16:00:27,424 INFO spawned: 'airupnp-aarch64' with pid 282,
2020-12-12 16:00:27,438 INFO exited: airupnp-aarch64 (exit status 127; not expected),
2020-12-12 16:00:27,441 INFO exited: airupnp-aarch64 (exit status 127; not expected),
2020-12-12 16:00:30,452 INFO spawned: 'airupnp-aarch64' with pid 283,
2020-12-12 16:00:30,461 INFO spawned: 'airupnp-aarch64' with pid 284,
2020-12-12 16:00:30,474 INFO exited: airupnp-aarch64 (exit status 127; not expected),
2020-12-12 16:00:30,478 INFO gave up: airupnp-aarch64 entered FATAL state, too many start retries too quickly,
2020-12-12 16:00:30,479 INFO exited: airupnp-aarch64 (exit status 127; not expected),
2020-12-12 16:00:31,481 INFO gave up: airupnp-aarch64 entered FATAL state, too many start retries too quickly,

When I connect to terminal of container and manually download and run aircast-arm-static it works fine so issue is clearly related to architecture mismatch

1activegeek commented 3 years ago

What is your docker run command? I'm a bit confused as it looks like you ran it indicating an aarch64, but then you mention using the terminal and running aircast-arm-static which is not the aarch64 version you tried to run the container with. It sounds like you can try running the container with the arm variable which will pull the aircast-arm binary. TBH I'm not sure the different between the arm and arm-static binary though.

Below is the bit that will grab the latest binary directly from the app author. If there is a binary mismatch issue, where the binary that is supposed to run on a specific architecture is not working on that architecture - then you may need to open an issue on the app developer's project. https://github.com/1activegeek/docker-airconnect/blob/c738c4f40f7bb47511cd82f1144b03a65154bec5/root/etc/cont-init.d/30-install#L20-L23

dmatora commented 3 years ago

Thanks for the tip! I switched to ENV tab, found ARCH_VAR var, changed aarch64 to arm and now it works! Didn't know Portainer can autofills vars, I certainly didn't put aarch64 there myself

dmatora commented 3 years ago

But now I get two (same name) airplay devices instead of one (I did restart docker container, but it didn't help)

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 30-install: executing... 
Checking for valid arch options
Proceeding with arm arch
--2020-12-12 17:55:34--  https://raw.githubusercontent.com/philippe44/AirConnect/master/bin/airupnp-arm
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.244.133
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|151.101.244.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 491048 (480K) [application/octet-stream]
Saving to: ‘/bin/airupnp-arm’

/bin/airupnp-arm      0%[                    ]       0  --.-KB/s               
/bin/airupnp-arm     14%[=>                  ]  68.28K   291KB/s               
/bin/airupnp-arm     35%[======>             ] 168.70K   367KB/s               
/bin/airupnp-arm     50%[=========>          ] 243.67K   343KB/s               
/bin/airupnp-arm     58%[==========>         ] 279.82K   306KB/s               
/bin/airupnp-arm     59%[==========>         ] 285.18K   248KB/s               
/bin/airupnp-arm     64%[===========>        ] 307.94K   226KB/s               
/bin/airupnp-arm     67%[============>       ] 321.33K   205KB/s               
/bin/airupnp-arm     69%[============>       ] 334.72K   186KB/s               
/bin/airupnp-arm     74%[=============>      ] 357.48K   178KB/s               
/bin/airupnp-arm     79%[==============>     ] 381.58K   168KB/s               
/bin/airupnp-arm     84%[===============>    ] 407.02K   164KB/s               
/bin/airupnp-arm     87%[================>   ] 421.74K   157KB/s               
/bin/airupnp-arm     93%[=================>  ] 448.52K   155KB/s               
/bin/airupnp-arm     96%[==================> ] 464.59K   141KB/s    eta 0s     
/bin/airupnp-arm    100%[===================>] 479.54K   143KB/s    in 3.3s    

2020-12-12 17:55:38 (143 KB/s) - ‘/bin/airupnp-arm’ saved [491048/491048]

--2020-12-12 17:55:38--  https://raw.githubusercontent.com/philippe44/AirConnect/master/bin/aircast-arm
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.244.133
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|151.101.244.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 413232 (404K) [application/octet-stream]
Saving to: ‘/bin/aircast-arm’

/bin/aircast-arm      0%[                    ]       0  --.-KB/s               
/bin/aircast-arm     24%[===>                ]  99.08K   490KB/s               
/bin/aircast-arm     58%[==========>         ] 235.64K   498KB/s               
/bin/aircast-arm     85%[================>   ] 346.77K   467KB/s               
/bin/aircast-arm    100%[===================>] 403.55K   469KB/s    in 0.9s    

2020-12-12 17:55:40 (469 KB/s) - ‘/bin/aircast-arm’ saved [413232/413232]

[cont-init.d] 30-install: 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.
2020-12-12 17:55:40,571 CRIT Supervisor running as root (no user in config file)
2020-12-12 17:55:40,578 INFO supervisord started with pid 274
2020-12-12 17:55:41,584 INFO spawned: 'airupnp-arm' with pid 277
2020-12-12 17:55:41,592 INFO spawned: 'airupnp-arm' with pid 278
2020-12-12 17:55:42,631 INFO success: airupnp-arm entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2020-12-12 17:55:42,631 INFO success: airupnp-arm entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
1activegeek commented 3 years ago

What is your docker run command? And have you persisted any volumes associated?

I see there is a duplication in my sed output. Must be a typo on my part. Surprised I didn't hear about this when people tested arch variables before. Either way, I can fix this. Thanks for finding.
https://github.com/1activegeek/docker-airconnect/blob/c738c4f40f7bb47511cd82f1144b03a65154bec5/root/etc/cont-init.d/30-install#L28-L30

dmatora commented 3 years ago

What is your docker run command?

My entry point is "/init" if that's what you're asking. I don't run docker from console, as I was saying I use portainer

image
1activegeek commented 3 years ago

Sorry I had space there on the markdown, was supposed to cross out that comment. I have identified what is likely the source here. Portainer is running a docker run command. There are ways to identify it, but in a nutshell, those items down bottom (command, volumes, network, etc) all go into the run command - Portainer just GUI-ifies them for you.

Updated build running through now (https://github.com/1activegeek/docker-airconnect/commit/75bb85706839641f58f98d0c652838ccac2f1c04). Give it about 10-15 minutes to complete and docker hub to pick it up. Then you should be able to do a fresh pull on the image and test.

dmatora commented 3 years ago

yeah, I now get

2020-12-13 14:34:38,205 INFO spawned: 'airupnp-arm' with pid 275
2020-12-13 14:34:38,214 INFO spawned: 'aircast-arm' with pid 276

still getting two airplay devices though is there an ENV var I could use to only run one of them?

1activegeek commented 3 years ago

Not sure why you may be seeing more than one device - mine only show up once. The 2 services that are running are 2 separate service - aircast is for true airplay for apple devices, and the other is for upnp playing with other non-apple devices (receivers, sonos, other smart home devices, etc). So the 2 services shouldn't be showing you 2 devices afaik. May be something to drop onto the dev project to see if there are similar reports.

dmatora commented 3 years ago

when I kill one of them (any) 2nd device goes away

1activegeek commented 3 years ago

Then perhaps the device you are viewing from is seeing both uPnP and AirPlay devices. Unfortunately this container does not have any variable to change this behavior of running both services. It was meant as a quick and easy way to run the default config from the developer. If I get some time and can look at modifying this, I will - chances right now are very low as I'm knee deep in dayjob work.

1activegeek commented 3 years ago

Going to close this now as it looks like the original issue is solved - and mention that the disable of uPnP has been requested before - it is the only other open item in the issues list #17.