osync icon indicating copy to clipboard operation
osync copied to clipboard

Suddenly updating target replica failed

Open sabbir14 opened this issue 5 years ago • 8 comments

Hello,

I have been using your osync script for around 3 months. It was working properly. But recently I found errors in updating target replica. Syncing has been stopped due to that. I am using quicksync with minimal options as a normal user "osync". This user has full permissions on both initiator and target nodes in the syncing directory. I am attaching my output below for your kind information:

My command: RSYNC_OPTIONAL_ARGS="--modify-window=2 --omit-dir-times" MINIMUM_SPACE=0 PRESERVE_ACL=no PRESERVE_XATTR=no SOFT_DELETE_DAYS=30 CONFLICT_BACKUP=no SOFT_MAX_EXEC_TIME=0 HARD_MAX_EXEC_TIME=0 RESUME_SYNC=no RESUME_TRY=2 REMOTE_HOST_PING=no /home/osync/osync/osync.sh --initiator="/var/web/html_new/pgw/securepay/stores" --target="ssh://[email protected]:2322//var/web/html_new/pgw/securepay/stores"

OUTPUT:

TIME: 1 - Starting synchronization task. TIME: 1 - Creating initiator replica file list [/var/web/html_new/pgw/securepay/stores/]. TIME: 1 - Creating target replica file list [/var/web/html_new/pgw/securepay/stores/]. TIME: 1 - Creating initiator replica deleted file list. TIME: 1 - Creating target replica deleted file list. TIME: 1 - Updating target replica. TIME: 2 - Updating target replica failed. Stopping execution. TIME: 2 - Rsync output: rsync: failed to set times on "/var/web/html_new/pgw/securepay/stores/qrmerchant/uploads/qrpdf/a2zinternational0live-qr.pdf": Operation not permitted (1) rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1179) [sender=3.1.2] TIME: 2 - osync finished with errors.

sabbir14 avatar Nov 03 '20 11:11 sabbir14

Pretty sure you need root privileges to change file system times on files you don't own. Can you verify permissions (and ACL permissions) on the given file ?

I also see you use --modify-window=2 rsync arg, which probably means you're using a network FS / FAT32 as target. If so, what FS is it ?

Do you use apparmor / SELinux ?

deajan avatar Nov 03 '20 14:11 deajan

Hii, Thanks for your reply. I am using user "osync" in both nodes to sync. "osync" has full permission on both initiator and target directory. Without root privilege, it was working fine. I am using xfs filesystem in both nodes. SELinux is disabled in both nodes. I am using your stable v1.2 This is the file permission set for "stores" directory in both nodes:

file: stores

owner: sslweb

group: pgwsslweb

flags: -s-

user::rwx user:sslweb:rwx user:osync:rwx group::rwx mask::rwx other::--- default:user::rwx default:user:sslweb:rwx default:user:osync:rwx default:group::rwx default:mask::rwx default:other::---

sabbir14 avatar Nov 04 '20 02:11 sabbir14

The problem does not seem to be osync related since rsync itself cannot set permissions.

How about the specific file /var/web/html_new/pgw/securepay/stores/qrmerchant/uploads/qrpdf/a2zinternational0live-qr.pdf ? What are it's permissions & ACL on both sides ?

deajan avatar Nov 04 '20 09:11 deajan

Permissions on both nodes:

file: a2zinternational0live-qr.pdf

owner: sslweb

group: pgwsslweb

user::rw- user:sslweb:rwx user:osync:rwx group::rwx mask::rwx other::---

sabbir14 avatar Nov 04 '20 09:11 sabbir14

Okay, to be honest, I don't have a clue, and as I said, this is not osync related. I could have a quick supervised look on your system if you want.

deajan avatar Nov 04 '20 18:11 deajan

hii, sorry for my late reply. How can you take access on my system ? I have checked all the related permissions but did not find any clue. It would be better if you give me some suggestions on that. Thanks in advance.

sabbir14 avatar Dec 20 '20 11:12 sabbir14

hii, I have just tried with another user now who has full privilege in the target. Now I am getting another error.

TIME: 1 - Starting synchronization task. TIME: 1 - Creating initiator replica file list [/var/web/html_new/pgw/securepay/stores/]. TIME: 1 - Creating target replica file list [/var/web/html_new/pgw/securepay/stores/]. TIME: 2 - Creating initiator replica deleted file list. TIME: 2 - Creating target replica deleted file list. TIME: 2 - Could not prepare initiator deletion list. TIME: 2 - Could not prepare target deletion list. TIME: 2 - osync finished with errors.

I have configured another directory for synchronization today which is running fine. But only this directory (/var/web/html_new/pgw/securepay/stores) is not working.

sabbir14 avatar Dec 20 '20 12:12 sabbir14

Can have a look on 28th december or somewhere that week. Easiest to do is a teamviewer session. Better would be a ssh session, I'd give you my IP for firewall settings beforehand.

deajan avatar Dec 22 '20 11:12 deajan