iOS app - Download fails when photos access not granted #2836

Closed
opened 2026-02-05 07:06:09 +03:00 by OVERLORD · 0 comments
Owner

Originally created by @havekes on GitHub (Apr 10, 2024).

The bug

When trying to download files to my iPad, I had the following error.
Reinstalling the app and granting photos permissions fixed the issue.
I'm opening this bug in order to add a more insightful error message or even prompting for permission again if possible.

Error message

Error saving downloaded asset

Details

ApiException 400: HTTP connection failed: POST /download/asset/f662194f-ae3a-496a-83ba-64bc57d21a85 (Inner exception: Connection closed while receiving data)

#0      IOClient.send.<anonymous closure> (package:http/src/io_client.dart:82)
#1      Stream.handleError.<anonymous closure> (dart:async/stream.dart:931)
#2      _HandleErrorStream._handleError (dart:async/stream_pipe.dart:269)
#3      _ForwardingStreamSubscription._handleError (dart:async/stream_pipe.dart:157)
#4      _HttpClientResponse.listen.<anonymous closure> (dart:_http/http_impl.dart:720)
#5      _RootZone.runBinaryGuarded (dart:async/zone.dart:1606)
#6      _BufferingStreamSubscription._sendError.sendError (dart:async/stream_impl.dart:358)
#7      _BufferingStreamSubscription._sendError (dart:async/stream_impl.dart:376)
#8      _BufferingStreamSubscription._addError (dart:async/stream_impl.dart:280)
#9      _ForwardingStreamSubscription._addError (dart:async/stream_pipe.dart:128)
#10     _addErrorWithReplacement (dart:async/stream_pipe.dart:176)
#11     _HandleErrorStream._handleError (dart:async/stream_pipe.dart:274)
#12     _ForwardingStreamSubscription._handleError (dart:async/stream_pipe.dart:157)
#13     _RootZone.runBinaryGuarded (dart:async/zone.dart:1606)
#14     _BufferingStreamSubscription._sendError.sendError (dart:async/stream_impl.dart:358)
#15     _BufferingStreamSubscription._sendError (dart:async/stream_impl.dart:376)
#16     _BufferingStreamSubscription._addError (dart:async/stream_impl.dart:280)
#17     _SyncStreamControllerDispatch._sendError (dart:async/stream_controller.dart:788)
#18     _StreamController._addError (dart:async/stream_controller.dart:666)
#19     _StreamController.addError (dart:async/stream_controller.dart:620)
#20     _HttpParser._reportBodyError (dart:_http/http_parser.dart:1201)
#21     _HttpParser._onDone (dart:_http/http_parser.dart:899)
#22     _RootZone.runGuarded (dart:async/zone.dart:1582)
#23     _BufferingStreamSubscription._sendDone.sendDone (dart:async/stream_impl.dart:392)
#24     _BufferingStreamSubscription._sendDone (dart:async/stream_impl.dart:402)
#25     _BufferingStreamSubscription._close (dart:async/stream_impl.dart:291)
#26     _SyncStreamControllerDispatch._sendDone (dart:async/stream_controller.dart:792)
#27     _StreamController._closeUnchecked (dart:async/stream_controller.dart:647)
#28     _StreamController.close (dart:async/stream_controller.dart:640)
#29     _Socket._onError (dart:io-patch/socket_patch.dart:2471)
#30     _RootZone.runBinaryGuarded (dart:async/zone.dart:1606)
#31     _BufferingStreamSubscription._sendError.sendError (dart:async/stream_impl.dart:358)
#32     _BufferingStreamSubscription._sendError (dart:async/stream_impl.dart:373)
#33     _BufferingStreamSubscription._addError (dart:async/stream_impl.dart:280)
#34     _SyncStreamControllerDispatch._sendError (dart:async/stream_controller.dart:788)
#35     _StreamController._addError (dart:async/stream_controller.dart:666)
#36     _StreamController.addError (dart:async/stream_controller.dart:620)
#37     _RawSecureSocket._reportError (dart:io/secure_socket.dart:888)
#38     _RootZone.runBinaryGuarded (dart:async/zone.dart:1606)
#39     _BufferingStreamSubscription._sendError.sendError (dart:async/stream_impl.dart:358)
#40     _BufferingStreamSubscription._sendError (dart:async/stream_impl.dart:376)
#41     _DelayedError.perform (dart:async/stream_impl.dart:526)
#42     _PendingEvents.handleNext (dart:async/stream_impl.dart:620)
#43     _PendingEvents.schedule.<anonymous closure> (dart:async/stream_impl.dart:591)
#44     _microtaskLoop (dart:async/schedule_microtask.dart:40)
#45     _startMicrotaskLoop (dart:async/schedule_microtask.dart:49)

Stack trace

#0      ApiClient.invokeAPI (package:openapi/api_client.dart:125)
<asynchronous suspension>
#1      ImageViewerService.downloadAssetToDevice (package:immich_mobile/modules/asset_viewer/services/image_viewer.service.dart:76)
<asynchronous suspension>
#2      ImageViewerStateNotifier.downloadAsset (package:immich_mobile/modules/asset_viewer/providers/image_viewer_page_state.provider.dart:32)
<asynchronous suspension>

The OS that Immich Server is running on

iPad OS 17.4.1

Version of Immich Server

v1.101.0

Version of Immich Mobile App

v1.101.0

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

Not relevant

Your .env content

Not relevant

Reproduction steps

1. Upload picture on web or Android
2. Don't grant photos access on iOS app
3. Try to download picture from iOS app

Additional information

No response

Originally created by @havekes on GitHub (Apr 10, 2024). ### The bug When trying to download files to my iPad, I had the following error. Reinstalling the app and granting photos permissions fixed the issue. I'm opening this bug in order to add a more insightful error message or even prompting for permission again if possible. #### Error message ``` Error saving downloaded asset ``` #### Details ``` ApiException 400: HTTP connection failed: POST /download/asset/f662194f-ae3a-496a-83ba-64bc57d21a85 (Inner exception: Connection closed while receiving data) #0 IOClient.send.<anonymous closure> (package:http/src/io_client.dart:82) #1 Stream.handleError.<anonymous closure> (dart:async/stream.dart:931) #2 _HandleErrorStream._handleError (dart:async/stream_pipe.dart:269) #3 _ForwardingStreamSubscription._handleError (dart:async/stream_pipe.dart:157) #4 _HttpClientResponse.listen.<anonymous closure> (dart:_http/http_impl.dart:720) #5 _RootZone.runBinaryGuarded (dart:async/zone.dart:1606) #6 _BufferingStreamSubscription._sendError.sendError (dart:async/stream_impl.dart:358) #7 _BufferingStreamSubscription._sendError (dart:async/stream_impl.dart:376) #8 _BufferingStreamSubscription._addError (dart:async/stream_impl.dart:280) #9 _ForwardingStreamSubscription._addError (dart:async/stream_pipe.dart:128) #10 _addErrorWithReplacement (dart:async/stream_pipe.dart:176) #11 _HandleErrorStream._handleError (dart:async/stream_pipe.dart:274) #12 _ForwardingStreamSubscription._handleError (dart:async/stream_pipe.dart:157) #13 _RootZone.runBinaryGuarded (dart:async/zone.dart:1606) #14 _BufferingStreamSubscription._sendError.sendError (dart:async/stream_impl.dart:358) #15 _BufferingStreamSubscription._sendError (dart:async/stream_impl.dart:376) #16 _BufferingStreamSubscription._addError (dart:async/stream_impl.dart:280) #17 _SyncStreamControllerDispatch._sendError (dart:async/stream_controller.dart:788) #18 _StreamController._addError (dart:async/stream_controller.dart:666) #19 _StreamController.addError (dart:async/stream_controller.dart:620) #20 _HttpParser._reportBodyError (dart:_http/http_parser.dart:1201) #21 _HttpParser._onDone (dart:_http/http_parser.dart:899) #22 _RootZone.runGuarded (dart:async/zone.dart:1582) #23 _BufferingStreamSubscription._sendDone.sendDone (dart:async/stream_impl.dart:392) #24 _BufferingStreamSubscription._sendDone (dart:async/stream_impl.dart:402) #25 _BufferingStreamSubscription._close (dart:async/stream_impl.dart:291) #26 _SyncStreamControllerDispatch._sendDone (dart:async/stream_controller.dart:792) #27 _StreamController._closeUnchecked (dart:async/stream_controller.dart:647) #28 _StreamController.close (dart:async/stream_controller.dart:640) #29 _Socket._onError (dart:io-patch/socket_patch.dart:2471) #30 _RootZone.runBinaryGuarded (dart:async/zone.dart:1606) #31 _BufferingStreamSubscription._sendError.sendError (dart:async/stream_impl.dart:358) #32 _BufferingStreamSubscription._sendError (dart:async/stream_impl.dart:373) #33 _BufferingStreamSubscription._addError (dart:async/stream_impl.dart:280) #34 _SyncStreamControllerDispatch._sendError (dart:async/stream_controller.dart:788) #35 _StreamController._addError (dart:async/stream_controller.dart:666) #36 _StreamController.addError (dart:async/stream_controller.dart:620) #37 _RawSecureSocket._reportError (dart:io/secure_socket.dart:888) #38 _RootZone.runBinaryGuarded (dart:async/zone.dart:1606) #39 _BufferingStreamSubscription._sendError.sendError (dart:async/stream_impl.dart:358) #40 _BufferingStreamSubscription._sendError (dart:async/stream_impl.dart:376) #41 _DelayedError.perform (dart:async/stream_impl.dart:526) #42 _PendingEvents.handleNext (dart:async/stream_impl.dart:620) #43 _PendingEvents.schedule.<anonymous closure> (dart:async/stream_impl.dart:591) #44 _microtaskLoop (dart:async/schedule_microtask.dart:40) #45 _startMicrotaskLoop (dart:async/schedule_microtask.dart:49) ``` #### Stack trace ``` #0 ApiClient.invokeAPI (package:openapi/api_client.dart:125) <asynchronous suspension> #1 ImageViewerService.downloadAssetToDevice (package:immich_mobile/modules/asset_viewer/services/image_viewer.service.dart:76) <asynchronous suspension> #2 ImageViewerStateNotifier.downloadAsset (package:immich_mobile/modules/asset_viewer/providers/image_viewer_page_state.provider.dart:32) <asynchronous suspension> ``` ### The OS that Immich Server is running on iPad OS 17.4.1 ### Version of Immich Server v1.101.0 ### Version of Immich Mobile App v1.101.0 ### Platform with the issue - [ ] Server - [ ] Web - [X] Mobile ### Your docker-compose.yml content Not relevant ### Your .env content Not relevant ### Reproduction steps ```bash 1. Upload picture on web or Android 2. Don't grant photos access on iOS app 3. Try to download picture from iOS app ``` ### Additional information _No response_
OVERLORD added the 📱mobile label 2026-02-05 07:06:09 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#2836