What is the problem you are having with rclone?
I'm testing rclone json logging to see what outputs appear under predetermined circumstances.
In this case I told rclone to sync to a sftp site that it doesn't have LIST permission on, and it's putting non JSON formatted errors in the log.
Run the command 'rclone version' and share the full output of the command.
C:\Backup\Scripts>.\rclone\rclone version
rclone v1.67.0
os/version: Microsoft Windows Server 2019 Standard 1809 (64 bit)
os/kernel: 10.0.17763.6054 (x86_64)
os/type: windows
os/arch: amd64
go/version: go1.22.4
go/linking: static
go/tags: cmount
Which cloud storage system are you using? (eg Google Drive)
sftp
The command you were trying to run (eg rclone copy /tmp remote:tmp
)
rclone sync --size-only --progress --no-update-dir-modtime -v --log-file=ls.txt --use-json-log <source> host:<target>
A log from the command with the -vv
flag
{"level":"debug","msg":"Connection failed, closing: permission denied","object":"******","objectType":"*sftp.Fs","source":"sftp/sftp.go:782","time":"2024-07-10T11:18:14.572876-06:00"}
2024/07/10 11:18:14 Failed to create file system for "******": stat failed: permission denied
Note that's with -vv.
With -v I get:
2024/07/10 11:10:00 Failed to create file system for "host:<target>": stat failed: permission denied
Also note I believe this has been brought up before:
When using "--use-json-log" and "-q", I'm getting non-JSON'ed output where there is an error. For example:
2021/11/03 10:54:22 Failed to sync with 2 errors: last error was: failed to delete 1 files
It appears immediately after a similarly formatted JSON text:
{"level":"error","msg":"Attempt 3/3 failed with 2 errors and: failed to delete 1 files","source":"cmd/cmd.go:284","time":"2021-11-03T10:54:22.261325-04:00"}
This is borking some inline JSON processing (rclone->mqtt pub->mqtt sub via ja…
Lastly, what I'm trying to do is parse out stats from the log for reporting purposes. Parsing the log seems to be the only way to get it?
Also see Rclone trigger script on completion with variables
I'm not familiar with Go, else I'd create a pull request for this.
Thank you much,
Charles
ncw
(Nick Craig-Wood)
July 10, 2024, 10:58pm
2
There is a current issue about this at the moment
opened 12:42PM - 15 Mar 22 UTC
bug
<!--
We understand you are having a problem with rclone; we want to help you … with that!
**STOP and READ**
**YOUR POST WILL BE REMOVED IF IT IS LOW QUALITY**:
Please show the effort you've put into solving the problem and please be specific.
People are volunteering their time to help! Low effort posts are not likely to get good answers!
If you think you might have found a bug, try to replicate it with the latest beta (or stable).
The update instructions are available at https://rclone.org/commands/rclone_selfupdate/
If you can still replicate it or just got a question then please use the rclone forum:
https://forum.rclone.org/
for a quick response instead of filing an issue on this repo.
If nothing else helps, then please fill in the info below which helps us help you.
**DO NOT REDACT** any information except passwords/keys/personal info.
You should use 3 backticks to begin and end your paste to make it readable.
Make sure to include a log obtained with '-vv'.
You can also use '-vv --log-file bug.log' and a service such as https://pastebin.com or https://gist.github.com/
Thank you
The Rclone Developers
-->
#### The associated forum post URL from `https://forum.rclone.org`
https://forum.rclone.org/t/non-jsoned-output-when-using-use-json-log/27299/9
#### What is the problem you are having with rclone?
using follow command does not generating logfile in json format if fail, the log is plain text:
`rclone lsjson server: --low-level-retries 1 --contimeout 6s --use-json-log --log-file err.log`
#### What is your rclone version (output from `rclone version`)
rclone v1.57.0
- os/version: ubuntu 20.04 (64 bit)
- os/kernel: 5.4.0-100-generic (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.17.2
- go/linking: static
- go/tags: none
#### Which OS you are using and how many bits (e.g. Windows 7, 64 bit)
Linux Ubuntu 20.04
#### Which cloud storage system are you using? (e.g. Google Drive)
SFTP
#### A log from the command with the `-vv` flag (e.g. output from `rclone -vv copy /tmp remote:tmp`)
with -vv the log has json, but the last line is not a json
```
{"level":"debug","msg":"Version \"v1.57.0\" starting with parameters [\"rclone\" \"lsjson\" \"server:\" \"--low-level-retries\" \"1\" \"--contimeout\" \"6s\" \"--use-json-log\" \"--log-file\" \"err.log\" \"-vv\"]","object":"rclone","objectType":"string","source":"cmd/cmd.go:408","time":"2022-03-15T08:36:52.234974-04:00"}
{"level":"debug","msg":"Creating backend with remote \"server:\"","source":"fs/newfs.go:28","time":"2022-03-15T08:36:52.235601-04:00"}
{"level":"debug","msg":"Using config file from \"/home/localroot/.config/rclone/rclone.conf\"","source":"config/config.go:353","time":"2022-03-15T08:36:52.235786-04:00"}
{"level":"debug","msg":"low level retry 1/1 (error couldn't connect SSH: dial tcp: lookup REDACT: no such host)","object":"pacer","objectType":"string","source":"fs/pacer.go:90","time":"2022-03-15T08:36:52.236656-04:00"}
{"level":"debug","msg":"Rate limited, increasing sleep to 200ms","object":"pacer","objectType":"string","source":"fs/pacer.go:46","time":"2022-03-15T08:36:52.23675-04:00"}
2022/03/15 08:36:52 Failed to create file system for "server:": NewFs: couldn't connect SSH: dial tcp: lookup REDACT: no such host
```
#### How to use GitHub
* Please use the 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to show that you are affected by the same issue.
* Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
* Subscribe to receive notifications on status change and new comments.
The problem is that the fatal errors are not output with JSON
system
(system)
Closed
August 9, 2024, 10:58pm
3
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.