OSError: [WinError 1005] The volume does not contain a recognized file system

What is the problem you are having with rclone?

Running python remotely from RClone mounted google drive
(May be a python issue but I am not that convinced)

Python exceptions above ^^^

OSError: [WinError 1005] The volume does not contain a recognized file system.
Please make sure that all required file system drivers are loaded and that the volume is not corrupted: 'h:\\Coding proj\\Ra1n Bot'

What is your rclone version (output from rclone version)

C:\rclone>rclone version
rclone v1.57.0
- os/version: Microsoft Windows 10 Pro 2009 (64 bit)
- os/kernel: 10.0.19044.1415 (x86_64)
- os/type: windows
- os/arch: amd64
- go/version: go1.17.2
- 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)

PS H:\Coding proj\Ra1n Bot> & C:/Users/amynj/AppData/Local/Programs/Python/Python310/python.exe "h:/Coding proj/Ra1n Bot/main.py"

The rclone config contents with secrets removed.

--------------------
[CM_GDrive]
type = drive
scope = drive
token = {"access_token":"","token_type":"Bearer","refresh_token":"","expiry":"2021-12-20T05:23:54.7074294-05:00"}
team_drive =
--------------------

A log from the command with the -vv flag

C:\rclone>rclone config -vv
2021/12/20 05:22:16 DEBUG : rclone: Version "v1.57.0" starting with parameters ["rclone" "config" "-vv"]
2021/12/20 05:22:16 DEBUG : Using config file from "C:\\Users\\amynj\\AppData\\Roaming\\rclone\\rclone.conf"

Hi Nullifii,

You may well be right that your Python program isn’t causing the issue, but it is a possibility that probably keeps most rcloners from helping you.

I therefore suggest you try reproducing the issue without your Python program and then post a full rclone debug log where the issue can be seen.

If you happen to prove that rclone has an issue when called from Python, then please create and share a minimal Python program that will allow us to reproduce the issue - including basic info on your Python environment (version, packages, etc.)

Here are a few ideas to narrow down the issue:

# Eliminate your own Python program by trying with a simple hello.py
PS H:\Coding proj\Ra1n Bot> & C:/Users/amynj/AppData/Local/Programs/Python/Python310/python.exe "h:/Coding proj/hello.py"

# Eliminate the rclone mount (h:) by starting the command from C:
PS C:\Users\amynj> & C:/Users/amynj/AppData/Local/Programs/Python/Python310/python.exe "h:/Coding proj/hello.py"

# Further eliminate the rclone mount (h:) by also storing the program on C:
PS C:\Users\amynj> & C:/Users/amynj/AppData/Local/Programs/Python/Python310/python.exe "C:/Users/amynj/hello.py"

hello and welcome to the forum,

image

Running a test python program before the "Ra1n Bot" directory the program executed as expected. Again, trying a different python execution method, it still came up with that error.

The second method you suggested also worked with my "hello.py" program but not with my "main.py" program.

Eliminating RClone execution and my program worked as expected.

Unfortunately updating my file permissions did not solve the issue. I am using a VBS file to run RClone in the back round due to the --daemon flag being disabled on windows. This is what I am using for that:

Set oShell = CreateObject ("Wscript.Shell") 
Dim strArgs
strArgs = "cmd /c title RClone runtime && cd C:\rclone && rclone mount --vfs-cache-mode full CM_GDrive:/ H: --volname CMGdrive --file-perms=0777"
oShell.Run strArgs, 0, false

imho, way too complicated. need to start with the simplest test case.

  1. create a .cmd file to run the simplest rclone mount command.
    C:\rclone\rclone mount CM_GDrive: H: --file-perms=0777

  2. on the rclone mount, run the simplest .cmd
    pause

Using this new command, my "main.py" program which is in the "Ra1n Bot" directory still does not want to execute. With my "hello.py" program which is just running the line of print("Hello!") works perfectly fine. When trying to edit my program, I am now unable to save my edited program. Looking in the cmd window it had come up with a log saying

2021/12/21 17:27:18 ERROR : Coding proj/hello.py: WriteFileHandle: Can't open for write without O_TRUNC on existing file without --vfs-cache-mode >= writes
2021/12/21 17:27:19 ERROR : IO error: open file failed: googleapi: Error 416: Request range not satisfiable, requestedRangeNotSatisfiable

Could this be with your suggestion of changing the file permissions?

  • first, as i suggested, start with the simplest test case.
    create that simplest.cmd on local, copy to mount and run it.

  • Can't open for write without O_TRUNC on existing file without --vfs-cache-mode >= writes
    add --vfs-cache-mode=writes to the rclone mount command.

Wrote that command along with the extra flag, worked on my hello.py program but not with my main.py program. Still throwing the same WinError.

the issue is that a rclone mount is a not a real file system, such as ntfs and python is not liking that.

Ok then I will go to python forums thank you for your help!

  • i do a lot of programming in python.
    if you can post the part of the script that generates the error, i can take a look.
    i think i have a workaround.

  • fwiw, i use pycharm and able to run/debug a .py on the rclone mount, no problem.

Here is the full exception list

Traceback (most recent call last):
  File "C:\Users\amynj\AppData\Local\Programs\Python\Python310\lib\site-packages\pkg_resources\__init__.py", line 2346, in _normalize_cached
    return _cache[filename]
KeyError: 'h:\\Coding proj\\Ra1n Bot'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\amynj\AppData\Local\Programs\Python\Python310\lib\ntpath.py", line 660, in realpath
    path = _getfinalpathname(path)
OSError: [WinError 1005] The volume does not contain a recognized file system.
Please make sure that all required file system drivers are loaded and that the volume is not corrupted: 'h:\\Coding proj\\Ra1n Bot'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "h:\Coding proj\Ra1n Bot\main.py", line 1, in <module>
    from apscheduler.executors.pool import ThreadPoolExecutor, ProcessPoolExecutor
  File "C:\Users\amynj\AppData\Local\Programs\Python\Python310\lib\site-packages\apscheduler\__init__.py", line 1, in <module>
    from pkg_resources import get_distribution, DistributionNotFound
  File "C:\Users\amynj\AppData\Local\Programs\Python\Python310\lib\site-packages\pkg_resources\__init__.py", line 3243, in <module>
    def _initialize_master_working_set():
  File "C:\Users\amynj\AppData\Local\Programs\Python\Python310\lib\site-packages\pkg_resources\__init__.py", line 3226, in _call_aside
    f(*args, **kwargs)
  File "C:\Users\amynj\AppData\Local\Programs\Python\Python310\lib\site-packages\pkg_resources\__init__.py", line 3255, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "C:\Users\amynj\AppData\Local\Programs\Python\Python310\lib\site-packages\pkg_resources\__init__.py", line 559, in _build_master
    ws = cls()
  File "C:\Users\amynj\AppData\Local\Programs\Python\Python310\lib\site-packages\pkg_resources\__init__.py", line 552, in __init__
    self.add_entry(entry)
  File "C:\Users\amynj\AppData\Local\Programs\Python\Python310\lib\site-packages\pkg_resources\__init__.py", line 608, in add_entry
    for dist in find_distributions(entry, True):
  File "C:\Users\amynj\AppData\Local\Programs\Python\Python310\lib\site-packages\pkg_resources\__init__.py", line 2034, in find_on_path
    path_item = _normalize_cached(path_item)
  File "C:\Users\amynj\AppData\Local\Programs\Python\Python310\lib\site-packages\pkg_resources\__init__.py", line 2348, in _normalize_cached
    _cache[filename] = result = normalize_path(filename)
  File "C:\Users\amynj\AppData\Local\Programs\Python\Python310\lib\site-packages\pkg_resources\__init__.py", line 2329, in normalize_path
    return os.path.normcase(os.path.realpath(os.path.normpath(
  File "C:\Users\amynj\AppData\Local\Programs\Python\Python310\lib\ntpath.py", line 666, in realpath
    path = _getfinalpathname_nonstrict(path)
  File "C:\Users\amynj\AppData\Local\Programs\Python\Python310\lib\ntpath.py", line 614, in _getfinalpathname_nonstrict
    path = _getfinalpathname(path)

I am currently running python ver. 3.10.1 could that be my issue? I am using VSC.

i think that issue is that you can run a simple .py but your main.py does not work, correct?

Yes however, it is in a different directory. I will try to move my main.py to the upper directory.

After moving directories, I still get the same error.

  • at this point, there is something in main.py that is causing the problem whereas hello.py did not.
    so you need to debug and find that exact code.
    if you can post it, i can try to replicate it.

  • one option is try a command like this
    rclone mount CM_GDrive h: --network-mode --volname \\server\share --file-perms=0777 --vfs-cache-mode=full
    in addition to the h: drive, rclone will create a fake netshare of \\server\share
    try to run main.py from \\server\share

if that does not work, i have a complex workaround that i am very sure will work.

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