EDIT: OK - I was wrong to think that here we might have a possible rclone bug. At worse, we have a bug or limitation of the program called script
. I solved the problem by doing the following.
export rl_UserMain
#shellcheck disable=2155
export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u "$rl_UserMain")/bus
if su "$rl_UserMain" "$fullPathToScript"
then
rl_dropPrivileges_success
else
rl_dropPrivileges_fail "$fullPathToScript"
fi
[End edit.]
What is the problem you are having with rclone?
I have a library I wrote in bash and several bash scripts that use the library. The purpose of all that stuff is to run backups via rclone. One of my scripts works fine when run normally. However, when run as root, it fails with a 'HTTP/1.x transport connection broken' error. More exactly: when run as root, my script relaunches itself as a normal user - and it is under those circumstances (was root, but then dropped privileges) that I get the problem. I have had a problem a few times now, and on two computers.
The Rclone log suggests that 'typescript' is somehow to blame. So here it is relevant to add the code that I use to re-run my script as another user. That code is as follows.
script -q -c "su $rl_UserMain $fullPathToScript"
What is your rclone version (output from rclone version
)
rclone v1.52.3
- os/arch: linux/amd64
- go version: go1.14.7
Which OS you are using and how many bits (eg Windows 7, 64 bit)
Linux Mint 20 x64 Cinnamon
Which cloud storage system are you using? (eg Google Drive)
b2
The command you were trying to run (eg rclone copy /tmp remote:tmp
)
rclone sync /home/<me> enc-b2:/X230/current/home/<me> --drive-chunk-size=256K --log-level=DEBUG --checkers 9 --fast-list --local-no-check-updated --one-file-system --retries=3 --timeout=2m --tpslimit 0 --tpslimit-burst 1 --skip-links --transfers 32 --exclude .dropbox-dist/** --filter-from /home/<me>/<myDir>/Backup/BackupSetup/rclone/lists/dots_filter-from --max-depth=7 --max-size 20M --bwlimit=3M --backup-dir=enc-b2:/X230/old/m08d20 --log-file /tmp/rclone_daily_OQA -P --stats=0 --stats-one-line>
The rclone config contents with secrets removed.
[box]
type = box
token = [redacted]
[b2]
type = b2
account = [redacted]
key = [redacted]
hard_delete = true
[enc-b2]
type = crypt
remote = b2:x1-everything
filename_encryption = standard
password = [redacted]
password2 = [redacted]
A log from the command with the -vv
flag
EDIT: There was some sort of problem with PasteBin. So here's the log:
2020/08/19 16:08:05 ERROR : typescript: Failed to copy: Post
+"https://pod-000-1144-10.backblaze.com/b2api/v1/b2_upload_file/4569e0e5e4ebb996667b071a/c001_v0001144_t0011": net/http: HTTP/1.x
+transport connection broken: http: ContentLength=24624 with Body length 36912
2020/08/19 16:08:09 ERROR : Encrypted drive 'enc-b2:/X230/current/home/<me>': not deleting files as there were IO errors
2020/08/19 16:08:09 ERROR : Encrypted drive 'enc-b2:/X230/current/home/<me>': not deleting directories as there were IO errors
2020/08/19 16:08:09 ERROR : Attempt 1/3 failed with 1 errors and: Post
+"https://pod-000-1144-10.backblaze.com/b2api/v1/b2_upload_file/4569e0e5e4ebb996667b071a/c001_v0001144_t0011": net/http: HTTP/1.x
+transport connection broken: http: ContentLength=24624 with Body length 36912
2020/08/19 16:10:07 ERROR : typescript: Failed to copy: Post
+"https://pod-000-1013-06.backblaze.com/b2api/v1/b2_upload_file/4569e0e5e4ebb996667b071a/c001_v0001013_t0017": net/http: HTTP/1.x
+transport connection broken: http: ContentLength=36912 with Body length 53296
2020/08/19 16:10:07 ERROR : Encrypted drive 'enc-b2:/X230/current/home/<me>': not deleting files as there were IO errors
2020/08/19 16:10:07 ERROR : Encrypted drive 'enc-b2:/X230/current/home/<me>': not deleting directories as there were IO errors
2020/08/19 16:10:07 ERROR : Attempt 2/3 failed with 1 errors and: Post
-N F- 1/22: <me> Rclone: script <rclone_daily>; job <sync_dots> - FAILED with code 1 -- (62%)