-
Notifications
You must be signed in to change notification settings - Fork 219
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
Getting StreamClosedError(f'Got {frame}')
when using the same RSD tunnel simulataneously
#571
Comments
It seens the device decided to close your connection. I'm familiar with it happening only during browse for new devices - that's exactly what the Please try to close any instance of XCode/Instruments. |
Oh, makes sense since I'm literally polling for devices while profiling! |
Any updates? Closing the Xcode related stuff solved this? |
The problem persists, actually the only way for me to make this work is by retrying |
I don't have an idea how to reproduce your problem. Does this error also occur from pymobiledevice3 builtin CLI aswell? |
I didn't try to reproduce this on the CLI, has to be something about polling all these different services at the same time. |
I believe I discovered the cause (though wasn't able to reproduce). Just created #572 which should solve this. Please update if this fix solves the issue |
I still have this problem, could be something about handling multiple RemoteServiceDiscoveryService instances like this? def connection_context(self, callback):
if self.version_is_17_or_greater():
# Use Remote XPC Tunnel Address and Port
remote_tunnel = RemoteXPC().get_rsd()
if remote_tunnel:
host, port = (remote_tunnel["address"], remote_tunnel["port"])
with RemoteServiceDiscoveryService((host, port)) as rsd:
with DvtSecureSocketProxyService(rsd) as dvt:
callback(dvt)
else:
logger.error("An error occurred getting XPC rsd...")
else:
# Use USB Mux
lockdown = self.get_lockdown()
with DvtSecureSocketProxyService(lockdown=lockdown) as dvt:
callback(dvt)
def monitor_thread(self):
while base_profiler.running:
try:
self.device.connection_context(self.monitor_logic)
except StreamClosedError:
pass
except Exception as exc:
logger.exception(f'An error occurred executing {self.__class__.__name__}. {exc}')
def monitor_logic(self, dvt):
# When creating a new monitor you may want to override this method with your
# own logic
pass
-----------------------------------
**Examples**
class IOSDisplayMonitor(IOSGenericMonitor):
def monitor_logic(self, dvt):
self.file_manager.create_tsv_from_model(IOSFPSModel())
with Graphics(dvt) as graphics:
for stats in graphics:
**The same for each of these**
self.monitor_system()
self.monitor_display()
self.monitor_syslog()
self.monitor_xcode_energy() |
This code doesn't show how you handled the |
Sorry, here it is: https://github.com/morellexf13/ios-remote-xpc-tunnel-creator/ |
Ok so I misunderstood. The exception occurs NOT during the tunnel creation, but using the newly created one. I this should happen as you described ONLY when trying to connect to the untrsuted RSD. |
All I can see differently is this other error. I can't find the cause yet :/ |
Update: I was using just ONE rsd address to handle all the monitors. with RemoteServiceDiscoveryService(rsd_address) as rsd:
with DvtSecureSocketProxyService(rsd) as dvt:
callback(dvt) rsd here was ALWAYS the same only address for each of these contexts (we have 5 monitors running at the same time). |
Okay I finally got what the problem was (and was able to reproduce thanks to that). It's not a bug in in pmd3, but the same issue as with the This can be considered a bug in |
StreamClosedError(f'Got {frame}')
when using the same RSD tunnel simulataneously
Hi @doronz88,
When I use the above logic I get this error almost all times:
What could be the problem here?
Edit: I have added a retry logic
and based on logs, apparently always fails at least 1 time:
Originally posted by @morellexf13 in #562 (comment)
The text was updated successfully, but these errors were encountered: