jotta / jotta-cli-issues

45 stars 1 forks source link

Failed to backup with `scaninterval 0` (realtime mode) #148

Open bluet opened 3 years ago

bluet commented 3 years ago

Make sure you are running the latest version of jotta-cli before reporting an issue.

jotta-cli release (jotta-cli version): 0.10.44059

root@jottacloud:/src# jotta-cli version                                                                                                                          
-------------------------------------------                                                                                                                      
jottad executable : /usr/bin/jottad                                                                                                                              
jottad appdata    : /var/lib/jottad                                                                                                                              
jottad logfile    : /var/lib/jottad/jottabackup.log                                                                                                              
jottad version    : 0.10.44059                                                                                                                                   
jotta-cli version : 0.10.44059                                                                                                                                   
-------------------------------------------                                                                                                                      
OK                                                                                                                                                               

Description of problem: When it set to 0 (as mentioned in Document), it shows UNABLE TO FIND WATCH FOR /path/to/something and stopped backup.
(When scaninterval set to a time, everything works fine.)

Expected: Monitors files changes and backup files automatically.

jotta-cli status (jotta-cli status):

root@jottacloud:/src# jotta-cli status                                                                                                                           
------------------------------------------------------------------------------                                                                                   
 Account   : bluetraveler@gmail.com on Jottacloud                                                                                                                
 Usage     : 306.21GiB / ( Unlimited )                                                                                                                           
 Device    : SolidRock                                                                                                                                           
------------------------------------------------------------------------------                                                                                   
 Backups   :                                                                                                                                                     
------------------------------------------------------------------------------                                                                                   
   Path      : /backup/homes                                                                                                                                     
   Files     : 0 (0bytes)                                                                                                                                        
   Status    : Up to date - Sat Aug 31 06:49:41                                                                                                                  

------------------------------------------------------------------------------                                                                                   
OK                                                                                                                                                               

Relevant logs for the issue (~/.jottad/jottabackup.log or /var/lib/jotta/jottabackup.log )

pid:376 2021/05/21 07:37:25 UNABLE TO FIND WATCH FOR /backup/homes/@eaDir/SYNO@.fileindexdb/write.lock "/backup/homes/@eaDir/SYNO@.fileindexdb/write.lock": REMOVE
pid:376 2021/05/21 07:37:25 UNABLE TO FIND WATCH FOR /backup/homes/@eaDir/SYNO@.fileindexdb/term/write.lock "/backup/homes/@eaDir/SYNO@.fileindexdb/term/write.lock": REMOVE
pid:376 2021/05/21 07:37:25 UNABLE TO FIND WATCH FOR /backup/homes/@eaDir/SYNO@.fileindexdb/term/write.lock "/backup/homes/@eaDir/SYNO@.fileindexdb/term/write.lock": CREATE
pid:376 2021/05/21 07:37:25 UNABLE TO FIND WATCH FOR /backup/homes/@eaDir/SYNO@.fileindexdb/term/write.lock "/backup/homes/@eaDir/SYNO@.fileindexdb/term/write.lock": REMOVE
pid:376 2021/05/21 07:41:15 UNABLE TO FIND WATCH FOR /backup/homes/bluet/jottabackup.log "/backup/homes/bluet/jottabackup.log": CREATE
pid:376 2021/05/21 07:41:15 UNABLE TO FIND WATCH FOR /backup/homes/bluet/jottabackup.log "/backup/homes/bluet/jottabackup.log": WRITE
pid:376 2021/05/21 07:41:15 UNABLE TO FIND WATCH FOR /backup/homes/bluet/jottabackup.log "/backup/homes/bluet/jottabackup.log": WRITE
pid:376 2021/05/21 07:41:15 UNABLE TO FIND WATCH FOR /backup/homes/bluet/jottabackup.log "/backup/homes/bluet/jottabackup.log": WRITE
pid:376 2021/05/21 07:41:15 UNABLE TO FIND WATCH FOR /backup/homes/bluet/jottabackup.log "/backup/homes/bluet/jottabackup.log": WRITE
pid:376 2021/05/21 07:41:15 UNABLE TO FIND WATCH FOR /backup/homes/bluet/jottabackup.log "/backup/homes/bluet/jottabackup.log": WRITE
pid:376 2021/05/21 07:41:15 UNABLE TO FIND WATCH FOR /backup/homes/bluet/jottabackup.log "/backup/homes/bluet/jottabackup.log": WRITE
pid:376 2021/05/21 07:41:15 UNABLE TO FIND WATCH FOR /backup/homes/bluet/jottabackup.log "/backup/homes/bluet/jottabackup.log": WRITE

Traceback

Additional info:

I'm using docker container from https://hub.docker.com/r/mxml/jottadocker, host inotify setting:

bluet@SolidRock:/$ sudo sysctl -a|grep inotify
Password: 
fs.inotify.max_queued_events = 16384
fs.inotify.max_user_instances = 128
fs.inotify.max_user_watches = 8192
bluet commented 3 years ago

Setting host fs.inotify.max_user_watches did not fix the problem.

  1. Tried setting echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
  2. Restart jotta container.
  3. Rename a file.
  4. Same error.

2021-05-21 07-55-40 的螢幕擷圖

bluet commented 3 years ago

Sorry, after some testing, this seems to be belong to the docker container.

Everything works after few minor fixes. This one works https://hub.docker.com/r/bluet/jottacloud

bluet commented 3 years ago

FYI scaninterval=0 still has some issues:

  1. Cannot handle big folder tree (as mentioned in https://github.com/jotta/jotta-cli-issues/issues/94#issuecomment-845735351)
  2. Sometimes fails to detect, or only has partial sync, and might need to restart jotta client.
  3. Also have unsynced problem described in https://github.com/jotta/jotta-cli-issues/issues/149 (deleted locally, but still on jottacloud)
bluet commented 3 years ago

I see the same issue on newly build docker, too...

root@jotta:/src# tail /var/lib/jottad/jottabackup.log 
pid:340 2021/05/22 02:13:07 GET https://repo.jotta.us/archives/VERSION 200
pid:340 2021/05/22 02:13:07 jottad.init.loadedbackup /backup/homes => homes
pid:340 2021/05/22 02:13:09 unable to verify root of backup[/backup/homes] => [/backup/homes] is already added to backup
pid:340 2021/05/22 02:15:00 cfg.update.maxdownloads 2 => 4
pid:340 2021/05/22 02:15:00 UNABLE TO FIND WATCH FOR /backup/homes/@eaDir/SYNO@.fileindexdb/write.lock "/backup/homes/@eaDir/SYNO@.fileindexdb/write.lock": REMOVE
pid:340 2021/05/22 02:15:00 UNABLE TO FIND WATCH FOR /backup/homes/@eaDir/SYNO@.fileindexdb/write.lock "/backup/homes/@eaDir/SYNO@.fileindexdb/write.lock": CREATE
pid:340 2021/05/22 02:15:00 UNABLE TO FIND WATCH FOR /backup/homes/@eaDir/SYNO@.fileindexdb/write.lock "/backup/homes/@eaDir/SYNO@.fileindexdb/write.lock": REMOVE
pid:340 2021/05/22 02:15:00 UNABLE TO FIND WATCH FOR /backup/homes/@eaDir/SYNO@.fileindexdb/term/write.lock "/backup/homes/@eaDir/SYNO@.fileindexdb/term/write.lock": REMOVE
pid:340 2021/05/22 02:15:00 UNABLE TO FIND WATCH FOR /backup/homes/@eaDir/SYNO@.fileindexdb/term/write.lock "/backup/homes/@eaDir/SYNO@.fileindexdb/term/write.lock": CREATE
pid:340 2021/05/22 02:15:00 UNABLE TO FIND WATCH FOR /backup/homes/@eaDir/SYNO@.fileindexdb/term/write.lock "/backup/homes/@eaDir/SYNO@.fileindexdb/term/write.lock": REMOVE
coopersimon commented 3 years ago

Hi bluet, thanks for the report. We'll investigate and get it sorted. For now maybe just use regular scan intervals (if you aren't already).

bluet commented 3 years ago

@coopersimon Ok. Do you need more info from me to help on your investigations?

I've changed back to scaninterval=1h , every scan took more than an hour and my disks are making noise all the time lol