您的公共账户验证已被撤销或过期,请重新连接到该账户

刘超 6天前 ⋅ 159 阅读   编辑

一、描述

  使用Cloud Sync同步百度云文件,报如下错误

 

二、分析

  1、ssh连上Synology,然后通过ps查找sync,如下

root@host1:~#  ps -ef | grep sync
root     22217 22169  0 22:16 pts/8    00:00:00 grep --color=auto sync
root     23270     1  0 Jul11 ?        00:50:30 /var/packages/CloudSync/target/sbin/syno-cloud-syncd /volume1/@cloudsync/config/daemon.conf

  2、找到Cloud Sync配置文件(/volume1/@cloudsync/config/daemon.conf),查看该文件,如下

root@host1:/volume1/@cloudsync/config# cat daemon.conf 
log_file_path="/var/log/cloudsync/daemon.log"
log_level_file_path="/var/packages/CloudSync/target/etc/cloudsync.debug"
pid_file_path="/var/run/syno-cloud-syncd.pid"
repo_path="/volume1/@cloudsync"
socket_path="/tmp/cloud-sync-socket"
work_dir_name="cloud-syncd.work.dir"
worker_count="3"

  如上,我们可以知道Cloud Sync日志文件是/var/log/cloudsync/daemon.log

  3、查看Cloud Sync日志(/var/log/cloudsync/daemon.log),有如下信息

Jul 23 19:45:19 [ERROR] baidu.cpp(90): Server response not json format 
Jul 23 19:45:19 [ERROR] baidu.cpp(96): Server does not reply error code ()
Jul 23 19:45:19 [ERROR] baidu-api.cpp(606): Connect failed: http_code(500), error_code(128), server_code(0), msg(Parse Error: Server does not reply error code)
Jul 23 19:45:19 [ERROR] baidu-client-handler.cpp(290): Pull event failed, code=-700, msg=Parse Error: Server does not reply error code
Jul 23 19:45:19 [ERROR] delta-handler.cpp(116): PullEventTwoWay: Failed to pull event.
Jul 23 19:45:19 [ERROR] delta-handler.cpp(176): PullEvent: Failed to pull event '-8'.
Jul 23 19:45:19 [INFO] syncer.cpp(390): Syncer (8): HandleError: Server error.
Jul 23 19:45:19 [NOTE] syncer.cpp(399): Syncer (8): Set throttled to wait 5 seconds.
Jul 24 05:42:07 [ERROR] baidu-api.cpp(606): Connect failed: http_code(401), error_code(2), server_code(110), msg(Access token invalid or no longer valid)
Jul 24 05:42:07 [ERROR] baidu-client-handler.cpp(290): Pull event failed, code=-100, msg=Access token invalid or no longer valid
Jul 24 05:42:07 [ERROR] delta-handler.cpp(116): PullEventTwoWay: Failed to pull event.
Jul 24 05:42:07 [ERROR] delta-handler.cpp(176): PullEvent: Failed to pull event '-6'.
Jul 24 05:42:07 [INFO] syncer.cpp(390): Syncer (8): HandleError: Authentication failure.

  看着和Access token有关系

  4、停止Cloud Sync,执行kill -9 23270

  5、切换到/volume1/\@cloudsync/db目录(cd /volume1/\@cloudsync/db),然后登录sqlite3,如下

root@host1:~# cd /volume1/\@cloudsync/db/
root@host1:/volume1/@cloudsync/db# ll
total 124
drwxr-xr-x 1 root root   268 Jul 29 22:17 .
drwxr-xr-x 1 root root    50 Jul 11 14:33 ..
-rw-r--r-- 1 root root 23552 Jul 29 22:16 config.sqlite
-rw-r--r-- 1 root root  1024 Jul 11 14:33 history.sqlite
-rw-r--r-- 1 root root 32768 Jul 11 14:33 history.sqlite-shm
-rw-r--r-- 1 root root 18896 Jul 11 14:33 history.sqlite-wal
-rw-r--r-- 1 root root  1024 Jul 11 14:33 resume-info-db.sqlite
-rw-r--r-- 1 root root 32768 Jul 11 14:33 resume-info-db.sqlite-shm
-rw-r--r-- 1 root root  5272 Jul 11 14:33 resume-info-db.sqlite-wal
root@host1:/volume1/@cloudsync/db# rm -rf *.sqlite-shm
root@host1:/volume1/@cloudsync/db# rm -rf *.sqlite-wal
root@host1:/volume1/@cloudsync/db# ll
total 32
drwxr-xr-x 1 root root    96 Jul 29 22:20 .
drwxr-xr-x 1 root root    50 Jul 11 14:33 ..
-rw-r--r-- 1 root root 23552 Jul 29 22:16 config.sqlite
-rw-r--r-- 1 root root  1024 Jul 11 14:33 history.sqlite
-rw-r--r-- 1 root root  1024 Jul 11 14:33 resume-info-db.sqlite
admin@host1:/volume1/@cloudsync/db$ sqlite3 config.sqlite

  这里之所以删除.sqlite-shm、.sqlite-wal结尾的文件,是因为不删除这两类文件,在执行.databases时会报“Error: unable to open database file

  6、执行.databases、.tables,如下

sqlite> .databases
seq  name             file                                                      
---  ---------------  ----------------------------------------------------------
0    main             /volume1/@cloudsync/db/config.sqlite                      
sqlite> 
sqlite> .tables
config_table      connection_table  session_table   
sqlite> select * from connection_table;
2|1024|100|3|百度云|admin|a***3|Q6U8AjmBxKLLHH74IsFL2A/g6gYXKhEkkdddD9nUgXofMOMeEJhkfkwu75YdJjyuIMIPYxHpw/FqgoioMeSfKed/BgDFlb5ufJadfaNkueqscTW1MWz0/AFGDRH||4aFAF7hbNcQ72VZBXk7PoquynVVjFDzYekeNNj+AvjrOBj3dPRGAxoCl7cmB5ptGSfymTt4kKSrHagQvnKelUQCXABCDEFS|HKeuanTUEZA0gK1EDTYd4lKP|3809783093|0|0|||||||||||||||||||0|||0|0|0||0|10|0|||0|-6|/|||5|1|111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111

// 如上默认不显示字段名,执行以下命令
sqlite> .mode colum
sqlite> .header on

sqlite> select * from connection_table;
id          uid         gid         client_type  task_name   local_user_name  user_name   access_token                                                                                                                      resource    refresh_token                                                                                                                     client_id                 unique_id   attribute   sync_mode   public_url  openstack_encrypted_token  container_name  openstack_identity_service_url  openstack_identity_service_version  openstack_region  openstack_encrypted_api_key  openstack_encrypted_password  openstack_proj_id  openstack_tenant_id  openstack_tenant_name  openstack_domain_id  openstack_domain_name  access_key  secret_key  bucket_name  bucket_id   server_addr  auth_scheme  auth_user   auth_enc_pass  max_upload_speed  max_download_speed  part_size   storage_class  isSSE       pull_event_period  max_upload_size  content_url  metadata_url  status      error       root_folder_path  root_folder_id  download_url  last_sync_status  is_enabled_schedule  schedule_info                                                                                                                                                                                                              
2           1024        100         3            百度云   admin            。。。。。。

  sqlite默认不显示字段名,不方面我们查看,需要配置一下;我们也发现有config_table、connection_table、session_table这三张表

  7、我们看看每个表(config_table、connection_table、session_table)有啥东西,如下

sqlite> select * from config_table;
key         value     
----------  ----------
version     18        
admin_mode  1         
sqlite> select * from connection_table;
id          uid         gid         client_type  task_name   local_user_name  user_name   access_token                                                                                                                      resource    refresh_token                                                                                                                     client_id                 unique_id   attribute   sync_mode   public_url  openstack_encrypted_token  container_name  openstack_identity_service_url  openstack_identity_service_version  openstack_region  openstack_encrypted_api_key  openstack_encrypted_password  openstack_proj_id  openstack_tenant_id  openstack_tenant_name  openstack_domain_id  openstack_domain_name  access_key  secret_key  bucket_name  bucket_id   server_addr  auth_scheme  auth_user   auth_enc_pass  max_upload_speed  max_download_speed  part_size   storage_class  isSSE       pull_event_period  max_upload_size  content_url  metadata_url  status      error       root_folder_path  root_folder_id  download_url  last_sync_status  is_enabled_schedule  schedule_info                                                                                                                                                                                                           
2           1024        100         3            百度云   admin    。。。。。。。
sqlite> 
sqlite> select * from session_table;
id          conn_id     share_name  sync_folder  server_folder_id  server_folder_path      enable_server_encryption  server_encryption_password  status      error       create_time  removed_time  sync_attr_check_option  sync_direction  google_drive_convert_online_doc
----------  ----------  ----------  -----------  ----------------  ----------------------  ------------------------  --------------------------  ----------  ----------  -----------  ------------  ----------------------  --------------  -------------------------------
2           2           homes       /admin/data                    /资源/data  0                                                     1           0           1594449943                 0                       0               0     

  如上,没看出哪些信息对解决这个问题有用的???

  8、再次重新验证,一段时间后/var/log/cloudsync/daemon.log文件的第一个error是如下这样的,

Jul 31 11:14:01 [ERROR] baidu.cpp(90): Server response not json format 
Jul 31 11:14:01 [ERROR] baidu.cpp(96): Server does not reply error code ()
Jul 31 11:14:01 [ERROR] baidu-api.cpp(606): Connect failed: http_code(500), error_code(128), server_code(0), msg(Parse Error: Server does not reply error code)
Jul 31 11:14:01 [ERROR] baidu-client-handler.cpp(290): Pull event failed, code=-700, msg=Parse Error: Server does not reply error code
Jul 31 11:14:01 [ERROR] delta-handler.cpp(116): PullEventTwoWay: Failed to pull event.
Jul 31 11:14:01 [ERROR] delta-handler.cpp(176): PullEvent: Failed to pull event '-8'.

  看着像是response code解析不正确,baidu-client-handler.cpp、delta-handler.cpp、baidu-api.cpp、baidu.cpp这是啥

  9、find搜索这些文件,没找到啥有用信息

root@host1:/volume1/@cloudsync/db# find / -name "*baidu-client-handler*"
root@host1:/volume1/@cloudsync/db# find / -name "*delta-handler*"
root@host1:/volume1/@cloudsync/db# find / -name "*baidu-api*"
root@host1:/volume1/@cloudsync/db# find / -name "*baidu*"
/volume1/@appstore/CloudSync/etc/baidu.filter
root@host1:/volume1/@cloudsync/db# 

  /volume1/@appstore/CloudSync/etc/baidu.filter是一些配置信息

  10、

三、解决方法

  临时处理方法就是重新验证

四、参考文章

  1、http://www.spclidea.com/archives/Cloud-Sync-baidu.html 
  2、https://community.synology.com/enu/forum/1/post/120283 
  3、https://community.synology.com/enu/forum/17/post/105768?reply=353605  
  4、https://community.synology.com/enu/forum/17/post/113535
  5、https://community.synology.com/enu/forum/17/post/76089
  6、https://community.synology.com/enu/forum/17/post/77555
  7、https://www.backblaze.com/b2/docs/b2_authorize_account.html


注意:本文归作者所有,未经作者允许,不得转载

全部评论: 0

    我有话说: