Why does rclone log retry errors to stdout?

What is the problem you are having with rclone?

rclone seems to log all non-fatal retry errors to stdout instead of stderr. Is this normal behaviour? According to the docs (https://rclone.org/docs/#logging), all logs goes to stderr.
The log I posted below is the results of running rclone inside a script with the stderr redirected, so the terminal is only displaying stdout output. I couldn't post the logs with '-vv' because I initially didn't use that and I'm not sure when I will encounter a retry error again.

What is your rclone version (output from rclone version)

rclone v1.52.2

  • os/arch: windows/amd64
  • go version: go1.14.4

Which OS you are using and how many bits (eg Windows 7, 64 bit)

Microsoft Windows [Version 10.0.18362.900] 64-bit

Which cloud storage system are you using? (eg Google Drive)

Mega

The command you were trying to run (eg rclone copy /tmp remote:tmp)

rclone -P copy :mega: C:\path\to\file --mega-user [username] --mega-pass [password]

The rclone config contents with secrets removed.

I'm running rclone without config, so rclone should be using the default config values

A log from the command

2020-07-12 17:43:15 ERROR : file: Failed to copy: upload file failed to create session: Try again
2020-07-12 17:43:16 ERROR : Attempt 1/3 failed with 1 errors and: upload file failed to create session: Try again
Transferred:      861.500M / 2.921 GBytes, 29%, 148.778 kBytes/s, ETA 4h4m14s
Transferred:            0 / 1, 0%
Elapsed time:   1h38m49.4s
Transferring:
 *            file: 28% /2.921G, 121.395k/s, 4h59m20s

hello and welcome to the forum,

trying to understand.

that log you posted,
is it stdout
or
a snippet from the stderr redirect log?

The log I posted is from stdout.
Also one thing to add, since I'm using no config, rclone logs the following to stderr in the beginning:

2020/07/10 20:18:35 NOTICE: Config file "C:\\Users\\ntqr\\.config\\rclone\\rclone.conf" not found - using defaults

And I'm not seeing it in the terminal, which means that stderr is being redirected properly

so is there a problem?

Yes, my question is why was this message (in OP) sent to stdout instead of stderr? Even non-'Error' level messages (like that 'Notice' level message about config files) get logged to stderr, so why is this particular 'Error' level message being sent to stdout? Is there anything about this in the docs?

"and still see the normal output of rclone commands"
https://rclone.org/docs/#logging

some output can and does goto stdout and stderr.
it is not a mutually exclusive situation.

we know that the error occured at
2020-07-12 17:43:15
have you searched the stderr redirected log and then did not find an error at that time?

Yes the message got sent to stdout alongside the progress status.

good, that is expected.

I understand some output gets to go to stdout, but a log message isn't part of the normal output of a command right? Progress status being sent to stdout is understandable, but not an error message.
The error message I posted is explicitly a log message. And supposedly, by default, rclone logs to standard error.
Even the notice message about config files got sent to stderr after all, so I'm pretty confused.

you are using this flag, which will display log messages.
https://rclone.org/docs/#p-progress
Any log messages will scroll above the static block. Log messages will push the static block down to the bottom of the terminal where it will stay.

Hmm that's interesting. So if I didn't use -P, would that mean that the log message about retrying will go to stderr?

i am not very interested in non-fatal retries, which are very common.
i just need to know if the rclone command completed without a fatal error.
i do not rely on stdout and --progress to determine success or failure of a rclone command.

i do the following

Yes, I'm already checking the exit codes, I might try using the log file option too. It's just that this unexpected behavior tripped me up and got me worried, so I wanted to clarify a few things. I hope that this -P behavior does not happen to actual fatal errors though (haven't encountered one so far)

you can test this by disconnecting your network card, let rclone fail with fatal error and see what happens.
but if you are not saving the stderr output, not sure what you expect to prove.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.