Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running on Raspberry Pi - container starts but iPhone can't find Altserver #2

Open
cwells427 opened this issue Aug 9, 2024 · 26 comments

Comments

@cwells427
Copy link

I tried connecting via a USB cable to the pi and trusting it, then inputting the 6-digit code on my phone when prompted, but the iPhone still can't find Altserver. My apps are already installed via AltServer on Windows - do they need to be reinstalled via this server?

@dreth
Copy link
Owner

dreth commented Aug 9, 2024

do they need to be reinstalled via this server?

As far as I know they don't need to be reinstalled, you can just refresh them as soon as your altserver is up.

but the iPhone still can't find Altserver.

what's the specific error message you're getting?

Can you post your altserver error logs? they should be under logs/altserver.err.log file, if you want you can also post your logs/altserver.out.log file to check it out

@cwells427
Copy link
Author

cwells427 commented Aug 9, 2024

what's the specific error message you're getting?

On the iPhone, AltStore reports 'Failed to Refresh AltStore : AltServer could not be found'

Logs attached. Thanks for the help!

[deleted the logs for privacy reasons]

@dreth
Copy link
Owner

dreth commented Aug 9, 2024

I deleted the logs after downloading them as I have a feeling they might contain personal information of your device (i don't know if they do but better safe than sorry).

Do the logs for netmuxd show you device being added/removed?

@cwells427
Copy link
Author

cwells427 commented Aug 9, 2024

Only thing in either netmuxd log is

Starting netmuxd
Starting mDNS discovery for _apple-mobdev2._tcp.local with mdns
Listening on /var/run/usbmuxd

@dreth
Copy link
Owner

dreth commented Aug 9, 2024

Yep, this means the device is not being detected by netmuxd, are you running usbmuxd in the host machine? are the idevice and the machine in the same wifi network?

@cwells427
Copy link
Author

Sorry - still pretty new to Linux and Docker generally - I haven't set up usbmuxd separately, and doesn't look like it was contained in the docker image (at least doesn't show in /bin/)?

Both devices are on the same network

@dreth
Copy link
Owner

dreth commented Aug 9, 2024

usbmuxd is installed in the building process of the image:

# Install necessary system dependencies
RUN apt-get update && apt-get install -y \
    libavahi-compat-libdnssd-dev \
    libusb-1.0-0-dev \
    libclang-dev \
    libusbmuxd-dev \
    libimobiledevice-utils \
    ideviceinstaller \
    usbmuxd \
    avahi-daemon \
    avahi-utils \
    libnss-mdns \
    avahi-discover \
    curl \
    screen \
    dbus \
    jq \
    supervisor \
    xz-utils \
    && apt-get clean

So it won't show up in bin, it should be running if you didn't make any changes to this. My question is regarding the host system, so not the container, but the raspberry pi itself.

I wouldn't know which OS is installed in your rpi but I believe rpi OS is based on debian, so you should be able to check if usbmuxd is running in the host by running systemctl status usbmuxd (I'm assuming you're running rpi OS).

If it's not running, that's good, it's not supposed to be running in the host OS.

However, the host OS should be running the avahi daemon, so check if it's running with systemctl status avahi-daemon.service

@cwells427
Copy link
Author

Can confirm, running rpi OS - usbmuxd is not found, avahi-daemon is running

@dreth
Copy link
Owner

dreth commented Aug 9, 2024

Can you spot any errors when you check the container logs? Did any of the services fail to start?

You can check with docker logs altserver, post those logs here if possible, they should contain no information about your device.

If nothing seems out of order, then try a clean slate:

  1. Close altstore on your device (don't leave it running in the background, close it)
  2. Bring down the container stack, if you're using docker-compose (which i recommend), bring it down with docker compose down, otherwise you can docker stop altserver && docker rm altserver && docker compose up -d (which also brings it up again at the end)
  3. Open altstore on your device and try to refresh
  4. Receive the code to re-authorize the device and let the refresh happen (fingers crossed it works)

@cwells427
Copy link
Author

Brought down the stack just in case, then brought back up and retried on my phone, got the popup for iCloud code, entered it, still getting 'AltServer could not be found'

altserver docker logs :

Getting binaries...
AltStore is up to date.
AltServer is up to date.
netmuxd is up to date.
anisette-server is up to date.
Making scripts executable...
Starting avahi-daemon service...
Purging logs...
Decompressing required libs for Provision...
tar: lib/aarch64: Not found in archive
tar: Exiting with failure status due to previous errors
lib/x86_64/
lib/x86_64/libstoreservicescore.so
lib/x86_64/libCoreADI.so
Starting supervisord...
2024-08-09 22:44:04,153 INFO Set uid to user 0 succeeded
2024-08-09 22:44:04,162 INFO RPC interface 'supervisor' initialized
2024-08-09 22:44:04,162 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2024-08-09 22:44:04,163 INFO supervisord started with pid 1
2024-08-09 22:44:05,167 INFO spawned: 'usbmuxd' with pid 65
2024-08-09 22:44:05,172 INFO spawned: 'anisette-server' with pid 66
2024-08-09 22:44:05,177 INFO spawned: 'netmuxd' with pid 67
2024-08-09 22:44:05,183 INFO spawned: 'altserver' with pid 68
2024-08-09 22:44:06,827 INFO success: usbmuxd entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-08-09 22:44:06,828 INFO success: anisette-server entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-08-09 22:44:06,828 INFO success: netmuxd entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-08-09 22:44:06,828 INFO success: altserver entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

@dreth
Copy link
Owner

dreth commented Aug 9, 2024

Hmm interesting, I see that your architecture doesn't match any in the provision dirs

Just to check and see if it makes sense to make this addition and if it helps fix the issue, can you (temporarily) modify the scripts/docker-entrypoint.sh script to add:

# Detect the system architecture
ARCH=$(uname -m)

# in case of aarch64, map it to arm64-v8a
if [ "$ARCH" = "aarch64" ]; then
    ARCH="arm64-v8a"
fi

after line 26 and start from a clean slate again? I doubt this is the issue, but can't hurt to try

@cwells427
Copy link
Author

Added that in, still getting 'Altserver could not be found' unfortunately. Again, thanks for the help diagnosing this

@dreth
Copy link
Owner

dreth commented Aug 9, 2024

I think I didn't tell you you should sudo rm ./lib (be very careful to INCLUDE the dot) and ideally post the logs from the container (docker logs altserver) when you run it again: docker stop altserver && docker rm altserver && docker compose up -d

And it's no problem ✌🏼

@cwells427
Copy link
Author

removed ./lib then rebuilt the stack (do you prefer that written route or compose down? Used that command set just in case)

logs here:

Getting binaries...
AltStore is up to date.
AltServer is up to date.
netmuxd is up to date.
anisette-server is up to date.
Making scripts executable...
Starting avahi-daemon service...
Purging logs...
Decompressing required libs for Provision...
tar: lib/aarch64: Not found in archive
tar: Exiting with failure status due to previous errors
lib/x86_64/
lib/x86_64/libstoreservicescore.so
lib/x86_64/libCoreADI.so
Starting supervisord...
2024-08-09 23:17:45,387 INFO Set uid to user 0 succeeded
2024-08-09 23:17:45,396 INFO RPC interface 'supervisor' initialized
2024-08-09 23:17:45,397 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2024-08-09 23:17:45,397 INFO supervisord started with pid 1
2024-08-09 23:17:46,404 INFO spawned: 'usbmuxd' with pid 65
2024-08-09 23:17:46,413 INFO spawned: 'anisette-server' with pid 66
2024-08-09 23:17:46,421 INFO spawned: 'netmuxd' with pid 67
2024-08-09 23:17:46,430 INFO spawned: 'altserver' with pid 68
2024-08-09 23:17:47,530 INFO success: usbmuxd entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-08-09 23:17:47,530 INFO success: anisette-server entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-08-09 23:17:47,530 INFO success: netmuxd entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-08-09 23:17:47,530 INFO success: altserver entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

@dreth
Copy link
Owner

dreth commented Aug 9, 2024

Okay i see that the line we added didn't really change anything, try to bring it up using docker compose up -d --build --force-recreate and post the logs here. Also docker compose down is fine too, should have the same effect, so up to you

@cwells427
Copy link
Author

New logs, still no altstore success

Getting binaries...
AltStore is up to date.
AltServer is up to date.
netmuxd is up to date.
anisette-server is up to date.
Making scripts executable...
Starting avahi-daemon service...
Purging logs...
Decompressing required libs for Provision...
lib/arm64-v8a/
lib/arm64-v8a/libstoreservicescore.so
lib/arm64-v8a/libCoreADI.so
Starting supervisord...
2024-08-09 23:25:45,133 INFO Set uid to user 0 succeeded
2024-08-09 23:25:45,141 INFO RPC interface 'supervisor' initialized
2024-08-09 23:25:45,141 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2024-08-09 23:25:45,142 INFO supervisord started with pid 1
2024-08-09 23:25:46,147 INFO spawned: 'usbmuxd' with pid 65
2024-08-09 23:25:46,152 INFO spawned: 'anisette-server' with pid 66
2024-08-09 23:25:46,157 INFO spawned: 'netmuxd' with pid 67
2024-08-09 23:25:46,162 INFO spawned: 'altserver' with pid 68

@dreth
Copy link
Owner

dreth commented Aug 9, 2024

hm okay, you can revert the changes to the docker entrypoint script, i'll commit that to the repo anyway

last thing i can think of is maybe try rebooting both the rpi and the idevice and try again

because this is running in docker it's likely your system will start the container automatically

let me know how it goes

@cwells427
Copy link
Author

rebooted the iPhone and the pi, started everything up and tried again, still not seeing AltServer, damn

@dreth
Copy link
Owner

dreth commented Aug 9, 2024

How old is this rpi? what model is it?

@cwells427
Copy link
Author

rpi is a 2019 Pi 4 Model B, so not too old or underpowered

@dreth
Copy link
Owner

dreth commented Aug 9, 2024

OK i was just asking because of the architecture, you should be fine in this regard as that pi has ARMv8 architecture, so the bundled libraries should function well.

unfortunately I'm not sure what's going on ): I will do some more research tomorrow but sadly I don't have an arm machine or an rpi to test this

maybe lastly can you check the netmuxd logs? maybe it's got 'added' logs and something else is failing

@cwells427
Copy link
Author

No worries, thanks for the attempts anyways!

Not seeing anything in netmuxd.err and the only thing in netmuxd.out is
Starting netmuxd Starting mDNS discovery for _apple-mobdev2._tcp.local with mdns Listening on /var/run/usbmuxd

Just to confirm through all of this - I've been checking AltStore wirelessly, not via USB connection, is the USB-connected option something that might work instead somehow?

@dreth
Copy link
Owner

dreth commented Aug 10, 2024

USB might work, i have't teste
if you don't mind using USB every time you want to refresh then you can try that

@cwells427
Copy link
Author

USB didn't work, it is what it is.

I've been using Windows AltServer but I've got it running on a laptop, which doesn't gracefully let me do wifi or auto refresh despite always being plugged in (probably because of Modern Standby tbh). Was hoping to find a way to get the Pi I have running Home Assistant and Klipper to also handle this. Not a huge issue but a bummer it's being weird and not working.

Thanks again for the attemps!

@dreth
Copy link
Owner

dreth commented Aug 10, 2024

it's quite strange because in your case absolutely everything works except netmuxd, and i have this feeling that it could be because your device doesn't 'trust' your rpi yet, when you connect it via USB are you never prompted to trust it? like if your device is unlocked and you connect it to your rpi, does it ever prompt to trust it or has it ever prompted to trust it?

I made a few changes to see if this project can better support arm systems, so maybe try this:

  • install usbmuxd and run it on your host system (systemctl start usbmuxd), with the docker stack down
  • connect your device and see if you're prompted to trust it
  • if prompted, trust it
  • stop usbmuxd in the host system: systemctl stop usbmuxd
  • git pull on the repo or just delete the dir you cloned it in altogether and clone the project again
  • set the env var OVERRIDE_ANISETTE_ARCH=arm64-v8a in the docker compose yaml, basically just uncomment the environment: key and the OVERRIDE_ANISETTE_ARCH env var and change it to what i suggested
  • run the stack and wait a few secs so it downloads all the binaries again
  • monitor the netmuxd.out.log file to see if your device shows added like Adding device XXXXXX... with your device ID.

let me know if this works

@danperks
Copy link

danperks commented Sep 20, 2024

I’m also facing this, on a Mac Mini (Intel) running Ubuntu, when trying to install AltStore to my device:

Failed to install DeveloperDiskImage.dmg to Name: Dan’s iPhone UDID: XXXXXXX-XXXXXXXXXXXXX. AltServer could not find the device.

Tried hard coding the architecture, as that wasn’t setting correctly, followed by rebuilding the container but that’s not helped.

Nothing in the container logs, nor anything suspicious in the command output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants