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)
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.)
# 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"
try adding --file-perms=0777 to the rclone mount command.
make sure dir h: works
if that does not work, then
--- try @ole suggestions including testing using a simple .py script such as input('Zork is the greatest game of all time!')
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
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?
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.
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.