RC API: vfs/stats fails with "more than one VFS active" for multiple mounts, but rejects unique suffixes from vfs/list

What is the problem you are having with rclone?

I am working with the Rclone RC API to manage VFS instances. I have encountered an issue when the same remote is mounted (or served) multiple times.

When multiple VFS instances exist for the same remote, vfs/list returns them with unique suffixes (e.g., Google Drive:[0], Google Drive:[1]). However, the vfs/stats endpoint does not accept these suffixed names.

  1. If I use the base name (Google Drive:), it fails with 500 Internal Server Error: more than one VFS active.
  2. If I use the name returned by list (Google Drive:[1]), it fails with 500 Internal Server Error: no VFS found.

This makes it impossible to query stats for specific VFS instances when duplicates exist via the RC API.

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

rclone v1.72.0
- os/version: arch (64 bit)
- os/kernel: 6.17.9-2-cachyos (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.25.4 X:nodwarf5
- go/linking: dynamic
- go/tags: none

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)

I am using the RC API via curl. Here is the sequence of commands:

  1. List VFS instances:

    curl -X POST http://127.0.0.1:51900/vfs/list
    
  2. Try to get stats using the base name:

    curl -X POST http://127.0.0.1:51900/vfs/stats \
      -H "Content-Type: application/json" \
      -d '{"fs": "Google Drive:"}'
    
  3. Try to get stats using the specific ID from the list:

    curl -X POST http://127.0.0.1:51900/vfs/stats \
      -H "Content-Type: application/json" \
      -d '{"fs": "Google Drive:[1]"}'
    

Please run 'rclone config redacted' and share the full output. If you get command not found, please make sure to update rclone.

[Google Drive]
type = drive
name = Google Drive
team_drive = 
token = XXX
client_id = XXX
client_secret = XXX
export_formats = docx,xlsx,pptx,svg

A log from the command that you were trying to run with the -vv flag

Here are the responses from the API calls:

Response from vfs/list (Shows suffixes):

{
    "vfses": [
        "Google Drive:[0]",
        "Google Drive:[1]"
    ]
}

Response from vfs/stats using "Google Drive:" (Ambiguous error):

{
    "error": "more than one VFS active with name \"Google Drive:\"",
    "input": {
        "fs": "Google Drive:"
    },
    "path": "vfs/stats",
    "status": 500
}

Response from vfs/stats using "Google Drive:[1]" (Not found error):

{
    "error": "no VFS found with name \"Google Drive:[1]\"",
    "input": {
        "fs": "Google Drive:[1]"
    },
    "path": "vfs/stats",
    "status": 500
}

How are you creating the VFSes that you are creating more than one for the same remote?

I don't think I've ever needed to do that.

I have a memory that the VFS is supposed to be shared like the backends are, but I guess that doesn't work if the configs are different.

VFSes don't have a name or id at the moment, but maybe they should...

I am creating them via the RC API. In this specific scenario, I have one mount running and one serve (FTP) running concurrently on the same remote (Google Drive:).

You mentioned that VFSes are shared if configs are identical, I suspect they are splitting here because I am passing specific vfsOpt parameters to the serve command, which likely differs from the mount configuration.
Here is the output showing the active Mount, the active Serve, and the resulting VFS list:

1. Active Mount:

// POST http://127.0.0.1:51900/mount/listmounts
{
    "mountPoints": [
        {
            "Fs": "Google Drive:",
            "MountPoint": "/home/hakan/Test Folder",
            "MountedOn": "2025-12-03T10:00:36.47361407+03:00"
        }
    ]
}

2. Active Serve (FTP):

// POST http://127.0.0.1:51900/serve/list
{
    "list": [
        {
            "id": "ftp-7655826f",
            "addr": "[::1]:2121",
            "params": {
                "fs": "Google Drive:",
                "pass": "123",
                "type": "ftp",
                "user": "123",
                "vfsOpt": {
                    "vfs_cache_mode": "full"
                }
            }
        }
    ]
}

3. Resulting VFS List:

// POST http://127.0.0.1:51900/vfs/list
{
    "vfses": [
        "Google Drive:test",
        "Google Drive:[0]",
        "Google Drive:[1]"
    ]
}

Regarding Google Drive:test I previously started a serve session via serve/start and stopped it using serve/stop, but the VFS seems to have persisted as a "zombie" instance.