mandarons / icloud-docker

Dockerized iCloud Client - make a local copy of your iCloud documents and photos, and keep it automatically up-to-date.
BSD 3-Clause "New" or "Revised" License
1.07k stars 50 forks source link

[BUG] retry_login_interval: -1 not working #247

Closed nicx closed 1 month ago

nicx commented 1 month ago

When configuring retry_login_interval: -1 I'll get the reauthentification every 1s instead of stopping the container after not reauthenticating. Using version 1.20.0

config:

app:
  logger:
    # level - debug, info, warning (default) or error
    level: "warning"
    # log filename icloud.log (default)
    filename: "/config/icloud.log"
  credentials:
    # iCloud drive username
    username: "***"
    # Retry login interval - default is 10 minutes (600)
    retry_login_interval: -1
  # Drive destination
  root: "/icloud"

logfile:

2024-07-22 11:53:49,792 :: ERROR :: icloudpy.base :: base.py :: 186 :: Authentication required for Account. (421)
2024-07-22 11:53:51,503 :: ERROR :: root :: sync.py :: 100 :: Error: 2FA is required. Please log in.
2024-07-22 11:53:51,503 :: INFO :: root :: config_parser.py :: 69 :: Retrying login every -1 seconds.
2024-07-22 11:53:51,503 :: INFO :: root :: sync.py :: 107 :: retry_login_interval is < 0, exiting ...
2024-07-22 11:53:54,284 :: ERROR :: icloudpy.base :: base.py :: 186 :: Authentication required for Account. (421)
2024-07-22 11:53:55,829 :: ERROR :: root :: sync.py :: 100 :: Error: 2FA is required. Please log in.
2024-07-22 11:53:55,829 :: INFO :: root :: config_parser.py :: 69 :: Retrying login every -1 seconds.
2024-07-22 11:53:55,829 :: INFO :: root :: sync.py :: 107 :: retry_login_interval is < 0, exiting ...
2024-07-22 11:53:59,739 :: ERROR :: icloudpy.base :: base.py :: 186 :: Authentication required for Account. (421)
2024-07-22 11:54:01,531 :: ERROR :: root :: sync.py :: 100 :: Error: 2FA is required. Please log in.
2024-07-22 11:54:01,531 :: INFO :: root :: config_parser.py :: 69 :: Retrying login every -1 seconds.
2024-07-22 11:54:01,531 :: INFO :: root :: sync.py :: 107 :: retry_login_interval is < 0, exiting ...
2024-07-22 11:54:04,274 :: ERROR :: icloudpy.base :: base.py :: 186 :: Authentication required for Account. (421)
2024-07-22 11:54:05,878 :: ERROR :: root :: sync.py :: 100 :: Error: 2FA is required. Please log in.
2024-07-22 11:54:05,878 :: INFO :: root :: config_parser.py :: 69 :: Retrying login every -1 seconds.
2024-07-22 11:54:05,878 :: INFO :: root :: sync.py :: 107 :: retry_login_interval is < 0, exiting ...
2024-07-22 11:54:08,645 :: ERROR :: icloudpy.base :: base.py :: 186 :: Authentication required for Account. (421)
2024-07-22 11:54:10,440 :: ERROR :: root :: sync.py :: 100 :: Error: 2FA is required. Please log in.
2024-07-22 11:54:10,440 :: INFO :: root :: config_parser.py :: 69 :: Retrying login every -1 seconds.
2024-07-22 11:54:10,440 :: INFO :: root :: sync.py :: 107 :: retry_login_interval is < 0, exiting ...
tymmej commented 1 month ago

sync_interval=-1 also does not work currently:

2024-07-26 12:12:44,498 :: INFO :: root :: sync.py :: 89 :: Syncing photos...                                         
2024-07-26 12:12:45,432 :: WARNING :: root :: config_parser.py :: 326 :: photos > filters > albums not found. Downloading all albums ...                                                                                                    
2024-07-26 12:12:45,433 :: WARNING :: root :: config_parser.py :: 360 :: photos > filters > extensions not found. Downloading all extensions ...                                                                                            
2024-07-26 12:12:45,434 :: INFO :: root :: config_parser.py :: 109 :: Syncing all albums.                             
2024-07-26 12:12:45,434 :: INFO :: root :: config_parser.py :: 397 :: Using format %Y/%m.                             
2024-07-26 12:12:47,447 :: INFO :: root :: sync_photos.py :: 175 :: Syncing All Photos                                
2024-07-26 12:18:07,784 :: INFO :: root :: sync.py :: 91 :: Photos synced                                             
2024-07-26 12:18:07,785 :: INFO :: root :: config_parser.py :: 99 :: Syncing photos every -1 seconds.                 
2024-07-26 12:18:07,785 :: INFO :: root :: sync.py :: 155 :: Resyncing at Fri Jul 26 12:18:06 2024 ...                
2024-07-26 12:18:07,786 :: INFO :: root :: config_parser.py :: 99 :: Syncing photos every -1 seconds.                 
2024-07-26 12:18:11,388 :: INFO :: root :: sync.py :: 89 :: Syncing photos...                                         
2024-07-26 12:18:12,216 :: WARNING :: root :: config_parser.py :: 326 :: photos > filters > albums not found. Downloading all albums ...                                                                                                    
2024-07-26 12:18:12,217 :: WARNING :: root :: config_parser.py :: 360 :: photos > filters > extensions not found. Downloading all extensions ...                                                                                            
2024-07-26 12:18:12,217 :: INFO :: root :: config_parser.py :: 109 :: Syncing all albums.                             
2024-07-26 12:18:12,217 :: INFO :: root :: config_parser.py :: 397 :: Using format %Y/%m

I have suspicion that app closes correctly, but something reopens it.

root@40097ea44cb6:/app# pstree -p # first sync
s6-svscan(1)-+-s6-supervise(15)---s6-linux-init-s(17)
             |-s6-supervise(35)---s6-ipcserverd(46)
             |-s6-supervise(36)
             |-s6-supervise(37)---busybox(137)
             `-s6-supervise(38)---init.sh(136)---python(141)
root@40097ea44cb6:/app# pstree -p # second sync
s6-svscan(1)-+-s6-supervise(15)---s6-linux-init-s(17)
             |-s6-supervise(35)---s6-ipcserverd(46)
             |-s6-supervise(36)
             |-s6-supervise(37)---busybox(137)
             `-s6-supervise(38)---init.sh(191)---python(193)
nicx commented 1 month ago

@mandarons unfortunately I get the following error with the new version:

s6-rc-compile: fatal: unable to open /etc/s6-overlay/s6-rc.d/svc-icd/up: No such file or directory
s6-rc: fatal: unable to take locks: No such file or directory
s6-linux-init-shutdownd: warning: /run/s6/basedir/scripts/rc.shutdown exited 111
s6-rc-compile: fatal: unable to open /etc/s6-overlay/s6-rc.d/svc-icd/up: No such file or directory

could you please have a look again? thanks!

robdejonge commented 1 week ago

@nicx The original bug raised mentions retry_login_interval but later on you mention sync_interval also does not work. Maybe update the issue title, to avoid people filing duplicates. I almost did, because I'm experiencing the latter as well.

2024-09-06 11:08:12,376 :: INFO :: root :: sync.py :: 77 :: Drive synced
2024-09-06 11:08:12,376 :: INFO :: root :: config_parser.py :: 83 :: Syncing drive every -1 seconds.
2024-09-06 11:08:12,376 :: INFO :: root :: sync.py :: 129 :: Resyncing at Fri Sep  6 11:08:11 2024 ...
2024-09-06 11:08:12,377 :: INFO :: root :: config_parser.py :: 83 :: Syncing drive every -1 seconds.

Note how the planned resync time is -1 from the log timestamp.

@mandarons It seems this code is not resolving to lead to a break.