Input/Output Error - Rclone with Systemd on VPS and GDrive

What is the problem you are having with rclone?

hello everyone, I have Rclone mounted as a systemd service, every once in a while it suddenly dismounts for no reason, I have checked the log and it appears that I have a problem with the token, please help. I have to say that I use this same service in another vps and they have no problem, but in this vps it is strange, I don't know if it is because of the project type created in google console api, it is worth mentioning that the project is in test mode and I don't know if that could be a cause

This is my Rclone service.

[Unit]
Description=RClone Rocast
Wants=network-online.target
After=network-online.target

[Service]
Type=notify
Environment=RCLONE_CONFIG=/root/.config/rclone/rclone.conf

ExecStart=/usr/bin/rclone mount --allow-other --dir-cache-time 12h --log-level INFO --log-file /home/Server.log --timeout 30m --umask 002 --vfs-cache-mode writes --vfs-read-chunk-size 8M --vfs-read-chunk-size-limit off --tpslimit 08 --tpslimit-burst 8  Rocast1: /home/Server

ExecStop=/bin/fusermount -uz /home/Server
Restart=on-failure

[Install]
WantedBy=default.target

This is my Log.

2021/05/21 20:56:35 INFO  : vfs cache: cleaned: objects 0 (was 0) in use 0, to upload 0, uploading 0, total size 0 (was 0)
2021/05/21 20:57:35 INFO  : vfs cache: cleaned: objects 0 (was 0) in use 0, to upload 0, uploading 0, total size 0 (was 0)
2021/05/21 20:58:35 INFO  : vfs cache: cleaned: objects 0 (was 0) in use 0, to upload 0, uploading 0, total size 0 (was 0)
2021/05/21 20:59:35 INFO  : vfs cache: cleaned: objects 0 (was 0) in use 0, to upload 0, uploading 0, total size 0 (was 0)
2021/05/21 20:59:40 INFO  : Google drive root '': Change notify listener failure: Get "https://www.googleapis.com/drive/v3/changes?alt=json&driveId=0AGK8T2wos2BiUk9PVA&fields=nextPageToken%2CnewStartPageToken%2Cchanges%28fileId%2Cfile%28name%2Cparents%2CmimeType%29%29&includeItemsFromAllDrives=true&pageSize=1000&pageToken=1189994&prettyPrint=false&supportsAllDrives=true": couldn't fetch token - maybe it has expired? - refresh with "rclone config reconnect Rocast2:": oauth2: cannot fetch token: 400 Bad Request
Response: {
  "error": "invalid_grant",
  "error_description": "Token has been expired or revoked."
}
2021/05/21 21:00:35 INFO  : vfs cache: cleaned: objects 0 (was 0) in use 0, to upload 0, uploading 0, total size 0 (was 0)
2021/05/21 21:00:40 INFO  : Google drive root '': Failed to get StartPageToken: Get "https://www.googleapis.com/drive/v3/changes/startPageToken?alt=json&driveId=0AGK8T2wos2BiUk9PVA&prettyPrint=false&supportsAllDrives=true": couldn't fetch token - maybe it has expired? - refresh with "rclone config reconnect Rocast2:": oauth2: cannot fetch token: 400 Bad Request
Response: {
  "error": "invalid_grant",
  "error_description": "Token has been expired or revoked."
}
2021/05/21 21:01:35 INFO  : vfs cache: cleaned: objects 0 (was 0) in use 0, to upload 0, uploading 0, total size 0 (was 0)
2021/05/21 21:01:40 INFO  : Google drive root '': Failed to get StartPageToken: Get "https://www.googleapis.com/drive/v3/changes/startPageToken?alt=json&driveId=0AGK8T2wos2BiUk9PVA&prettyPrint=false&supportsAllDrives=true": couldn't fetch token - maybe it has expired? - refresh with "rclone config reconnect Rocast2:": oauth2: cannot fetch token: 400 Bad Request
Response: {
  "error": "invalid_grant",
  "error_description": "Token has been expired or revoked."
}
2021/05/21 21:02:35 INFO  : vfs cache: cleaned: objects 0 (was 0) in use 0, to upload 0, uploading 0, total size 0 (was 0)
2021/05/21 21:02:40 INFO  : Google drive root '': Failed to get StartPageToken: Get "https://www.googleapis.com/drive/v3/changes/startPageToken?alt=json&driveId=0AGK8T2wos2BiUk9PVA&prettyPrint=false&supportsAllDrives=true": couldn't fetch token - maybe it has expired? - refresh with "rclone config reconnect Rocast2:": oauth2: cannot fetch token: 400 Bad Request
Response: {
  "error": "invalid_grant",
  "error_description": "Token has been expired or revoked."
}
2021/05/21 21:03:35 INFO  : vfs cache: cleaned: objects 0 (was 0) in use 0, to upload 0, uploading 0, total size 0 (was 0)
2021/05/21 21:03:40 INFO  : Google drive root '': Failed to get StartPageToken: Get "https://www.googleapis.com/drive/v3/changes/startPageToken?alt=json&driveId=0AGK8T2wos2BiUk9PVA&prettyPrint=false&supportsAllDrives=true": couldn't fetch token - maybe it has expired? - refresh with "rclone config reconnect Rocast2:": oauth2: cannot fetch token: 400 Bad Request
Response: {
  "error": "invalid_grant",
  "error_description": "Token has been expired or revoked."

What is your rclone version (output from rclone version)

rclone v1.55.1

  • os/type: linux
  • os/arch: amd64
  • go/version: go1.16.3
  • go/linking: static
  • go/tags: none

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

Linux Ubuntu 18.04

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)

Description=RClone Rocast
Wants=network-online.target
After=network-online.target

[Service]
Type=notify
Environment=RCLONE_CONFIG=/root/.config/rclone/rclone.conf

ExecStart=/usr/bin/rclone mount --allow-other --dir-cache-time 12h --log-level INFO --log-file /home/Server.log --timeout 30m --umask 002 --vfs-cache-mode writes --vfs-read-chunk-size 8M --vfs-read-chunk-size-limit off --tpslimit 08 --tpslimit-burst 8  Rocast1: /home/Server

ExecStop=/bin/fusermount -uz /home/Server
Restart=on-failure

[Install]
WantedBy=default.target

The rclone config contents with secrets removed.

Paste config here

A log from the command with the -vv flag

Paste  log here

Since you are missing key parts, it's tough to tell but I'd say you need to reconnect to your remote.

https://rclone.org/commands/rclone_config_reconnect/

Thanks for answering, I tried to reconnect the remote, but when I authenticated, I got the 403 error on the google screen, quota limit exceeded, I think I'm making too many calls to the api for this to happen to me, however I don't know I could do to make fewer calls to the api. Could you help me please? My plex has 12 friends

Best way to help is to use the template and share all the required information. It's hard to guess what's going on with out details.

I would like to send all information but i dunno how do it. :frowning:

  • to send my rclone config. (i dunno how do it)
  • to send my log with -vv flag (i dunno too.) :frowning:

but i would like to give you more information, it happends just when i scan my plex library, when i try to reconnect again with the same project just changing the secret client i saw the message from google, it says


i was reading about it in google's api documents and it says:


maybe these images can help more to understand me. the last is my Gdrive api from my project.

Regarding my rclone config, I have my own id and my own secret client in full access and mounted as teamdrive.

If I modify my rclone, do you think I could solve that problem? Apparently this happens because when it scans it makes too many calls and I don't know what kind of quota is being exceeded, at the moment the only thing I did was create another project so that I can solve it but I imagine that the problem will happen again. Thank you in advance for your response.

You look at your config file and share it minus the secret keys and password.

That's your file location.

You can also run

rclone config show

You can replace the word INFO with DEBUG in your mount command which is the same as changing from -v to -vv

Getting a 403 error in GDrive is common as the log matters as there are a bunch of different 403s. Some are standard "slow down" and some are upload/download quota related. Without a log file, it's hard to say what the issue is.

It would depend on what the log is saying as you don't need another project as you aren't hitting 1 billion API calls per day.

Mine as an example:

Hi there!. i was looking for more information about this problem and i found more information:

I was looking at the google api metrics and the quotas and indeed I have not reached any limit on that side. But reading about the topic that many have also had the problem of "Token has been expired or revoked." I think it is the same that I am having.

To solve the previous problem I had to create a new project this time in production mode but without verifying with a free gmail account, (7 days ago) but again the token expired message came out, Error 403: rate_limit_exceeded,

This is the message: "This app has not yet been verified to support the use of "access with google". if you are a developer of this application send a verification request to re-enable "Access with google"

image
so to summarize the problem is happening in external projects both in test mode and in production mode.
for now I'm testing with my google works space account and with internal projects at producction mode to see if the problem is solved, this time I already changed to debug mode to be able to send you all the information.

"This already looks like THE RING movie, (SEVEN DAYS), Lol"