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

USBMUX keeps returning a broken pipe error #1566

Open
wtibbitts opened this issue May 6, 2024 · 0 comments
Open

USBMUX keeps returning a broken pipe error #1566

wtibbitts opened this issue May 6, 2024 · 0 comments

Comments

@wtibbitts
Copy link

I'm working with some code that is used to fetch mdm profiles from a device and do some additional configuring. It uses the device_ink_service to send a request to list profiles, but it always get a broken pipe error. I have tried adding device_link_service_send_ping() call before the request to check the state, but that also returns a broken pipe error.

The client is created with:

LIBIMOBILEDEVICE_API mobileconfig_error_t mobileconfig_client_new(idevice_t device, lockdownd_service_descriptor_t service, mobileconfig_client_t * client) {
    debug_info("mobileconfig_client_new\n");
    if (!device || !service || service->port == 0 || !client || *client)
        return MOBILECONFIG_E_INVALID_ARG;

    device_link_service_client_t dlclient = NULL;
    mobileconfig_error_t ret = mobileconfig_error(device_link_service_client_new(device, service, &dlclient));

    if (ret != MOBILECONFIG_E_SUCCESS) {
        fprintf(stderr,"ret: %d\n", ret);
        return ret;
    }

    mobileconfig_client_t client_loc = (mobileconfig_client_t) malloc(sizeof(struct mobileconfig_client_private));
    client_loc->parent = dlclient;

    *client = client_loc;
    return ret;
}

Below are the debug logs from the request

14:10:07 lockdown.c:434 lockdownd_get_value(): success
14:10:07 lockdown.c:445 lockdownd_get_value(): has a value
14:10:07 property_list_service.c:132 internal_plist_send(): sending 100 bytes
14:10:07 service.c:144 service_send(): sending 4 bytes
14:10:07 idevice.c:653 internal_connection_send(): ERROR: usbmuxd_send returned -32 (Broken pipe)
14:10:07 idevice.c:723 idevice_connection_send(): internal_connection_send 4, sent 0
14:10:07 service.c:147 service_send(): ERROR: sending to device failed.
14:10:07 property_list_service.c:147 internal_plist_send(): ERROR: sending to device failed.
14:10:07 mobileconfig.c:240 mobileconfig_send_list_profile_request(): ping resp: -3
14:10:07 mobileconfig.c:244 mobileconfig_send_list_profile_request(): property list dict before:

could not read data, res: -256<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>RequestType</key>
	<string>GetProfileList</string>
</dict>
</plist>

14:10:07 property_list_service.c:132 internal_plist_send(): sending 245 bytes
14:10:07 service.c:144 service_send(): sending 4 bytes
14:10:07 idevice.c:653 internal_connection_send(): ERROR: usbmuxd_send returned -32 (Broken pipe)
14:10:07 idevice.c:723 idevice_connection_send(): internal_connection_send 4, sent 0
14:10:07 service.c:147 service_send(): ERROR: sending to device failed.
14:10:07 property_list_service.c:147 internal_plist_send(): ERROR: sending to device failed.
14:10:07 mobileconfig.c:337 mobileconfig_receive(): mobileconfig_receive
14:10:07 idevice.c:769 internal_connection_receive_timeout(): ERROR: usbmuxd_recv_timeout returned -54 (Connection reset by peer)
14:10:07 service.c:167 service_receive_with_timeout(): could not read data
14:10:07 property_list_service.c:197 internal_plist_receive_timeout(): initial read failed!
pls receive plist err: -256
plist or *plist is NULL
received mc ret: -2
mdm_ret: -2
could not read data, res: -256

How do I fix this broken pipe error?

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

1 participant