Spurious linefeed character in log output

What is the problem you are having with rclone?

A spurious linefeed character is inserted into the last log line, which then spills into a new line that doesn't have the timestamp information. This breaks my log parser.

2022/06/10 22:51:05 INFO  : 2022/06/10 22:51:05 -     1.434 GiB / 1.434 GiB, 100%, 35.604 KiB/s, ETA 0s
2022/06/10 22:51:05 DEBUG : 51 go routines active
2022/06/10 22:51:05 Failed to copy: failed to open source object: open file failed: googleapi: got HTTP response code 400 with body: <!DOCTYPE html><html lang="en"><head><meta name="description" content="Web word processing, presentations and spreadsheets"><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0"><link rel="shortcut icon" href="//docs.google.com/favicon.ico"><title>Page Not Found</title><meta name="referrer" content="origin"><link href="//fonts.googleapis.com/css?family=Product+Sans" rel="stylesheet" type="text/css" nonce="LsGGyqgHB2g_ggdhNj9DBQ"><style nonce="LsGGyqgHB2g_ggdhNj9DBQ">/* Copyright 2022 Google Inc. All Rights Reserved. */
.goog-inline-block{position:relative;display:-moz-inline-box;display:inline-block}* html .goog-inline-block{display:inline}*:first-child+html .goog-inline-block{display:inline}#drive-logo{margin:18px 0;position:absolute;white-space:nowrap}.docs-drivelogo-img{background-image:url('//ssl.gstatic.com/images/branding/googlelogo/1x/googlelogo_color_116x41dp.png');background-size:116px 41px;display:inline-block;height:41px;vertical-align:bottom;width:116px}.docs-drivelogo-text{color:#000;display:inline-block;opacity:0.54;text-decoration:none;font-family:'Product Sans',Arial,Helvetica,sans-serif;font-size:32px;text-rendering:optimizeLegibility;position:relative;top:-6px;left:-7px;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}@media (-webkit-min-device-pixel-ratio:1.5),(min-resolution:144dpi){.docs-drivelogo-img{background-image:url('//ssl.gstatic.com/images/branding/googlelogo/2x/googlelogo_color_116x41dp.png')}}</style><style type="text/css" nonce="LsGGyqgHB2g_ggdhNj9DBQ">body {background-color: #fff; font-family: Arial,sans-serif; font-size: 13px; margin: 0; padding: 0;}a, a:link, a:visited {color: #112ABB;}</style><style type="text/css" nonce="LsGGyqgHB2g_ggdhNj9DBQ">.errorMessage {font-size: 12pt; font-weight: bold; line-height: 150%;}</style></head><body><div id="outerContainer"><div id="innerContainer"><div style="position: absolute; top: -80px;"><div style="margin: 18px 0; position: absolute; white-space: nowrap;"><a href="//support.google.com/docs/"><img height="35px" src="//ssl.gstatic.com/docs/common/product/spreadsheets_lockup2.png" alt="Google logo"/></a></div></div><div align="center"><p class="errorMessage" style="padding-top: 50px">Sorry, unable to open the file at this time.</p><p> Please check the address and try again. </p><div style="background: #F0F6FF; border: 1px solid black; margin-top: 35px; padding: 10px 125px; width: 300px;"><p><strong>Get stuff done with Google Drive</strong></p><p>Apps in Google Drive make it easy to create, store and share online documents, spreadsheets, presentations and more.</p><p>Learn more at <a href="https://drive.google.com/start/apps">drive.google.com/start/apps</a>.</p></div></div></div></div></body><style nonce="LsGGyqgHB2g_ggdhNj9DBQ">html {height: 100%; overflow: auto;}body {height: 100%; overflow: auto;}#outerContainer {margin: auto; max-width: 750px;}#innerContainer {margin-bottom: 20px; margin-left: 40px; margin-right: 40px; margin-top: 80px; position: relative;}</style></html>

Run the command 'rclone version' and share the full output of the command.

rclone v1.58.1
- os/version: Microsoft Windows 10 Pro 21H2 (64 bit)
- os/kernel: 10.0.19044.1706 (x86_64)
- os/type: windows
- os/arch: amd64
- go/version: go1.17.9
- go/linking: dynamic
- go/tags: cmount

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

Google Drive

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

2022/06/10 22:41:12 DEBUG : rclone: Version "v1.58.1" starting with parameters ["C:\\bin\\rclone.exe" "copy" "--check-first" "--config" "C:\\Users\\Administrator\\AppData\\Local\\Temp\\tmp4A90.tmp" "--drive-skip-dangling-shortcuts" "--log-file" "C:\\Temp\\user.log" "--order-by" "size,mixed" "--retries" "1" "--stats" "5s" "--stats-one-line-date" "--update" "--log-level" "DEBUG" "--drive-skip-shortcuts" "--create-empty-src-dirs" "Source:" "Target:"]

The rclone config contents with secrets removed.

[Source]
type = drive
scope = drive.readonly
service_account_file = C:\Temp\source.json
impersonate = ...
[Target]
type = drive
scope = drive
service_account_file = C:\Temp\target.json
impersonate = ...

A log from the command with the -vv flag

See above.

I have also an error without timestamp.

fatal error: runtime: out of memory

So it seems that you should handle this case in your parser...

I think that error message comes from the drive SDK...

If you want to guarantee parsable logs you should use --use-json-log

1 Like

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