Can't create any file using file explorer on Windows machine
Closed this issue · 5 comments
rusaym commented
Describe the bug
I have a simple wsgidav server running on Ubuntu 22.04.1 LTS, also I have a Windows 10 Pro client machine connected to the same network, on the Windows machine I mounted the disk. There is no problems to create any folders on the disk, but when I'm trying to create a file or paste copied file, I got an error.
To Reproduce
- Server code:
from cheroot import wsgi
from wsgidav.wsgidav_app import WsgiDAVApp
from wsgidav.fs_dav_provider import FilesystemProvider
root_path = "./webdav"
provider = FilesystemProvider(root_path)
config = {
"host": "0.0.0.0",
"http_authenticator": {
"domain_controller": None
},
"port": 8080,
"lock_storage": False,
"simple_dc": {
"user_mapping": {
"*": True
}
},
"provider_mapping": {"/": provider},
"verbose": 1,
}
app = WsgiDAVApp(config)
server_args = {
"bind_addr": (config["host"], config["port"]),
"wsgi_app": app,
}
server = wsgi.Server(**server_args)
try:
server.start()
except KeyboardInterrupt:
server.stop()
After clicking "Ok" and refreshing current folder created files show up.
Environment:
WsgiDAV/4.0.1 Python/3.10.6(64 bit) Linux-5.15.0-52-generic-x86_64-with-glibc2.35
mar10 commented
Can you share the relevant lines from the server log file?
rusaym commented
Sure, can you please tell me where to find the log?
rusaym commented
I've added a logger same as in the documentation, here is what it says on creating file:
DEBUG:wsgidav.request_server:PUT: Content-Length == 0. Creating empty file...
INFO:wsgidav.wsgidav_app:192.168.230.1 - (anonymous) - [2022-11-01 19:32:25] "PUT /New folder/New Text Document.txt" length=0, connection="Keep-Alive", agent="Microsoft-WebDAV-MiniRedir/10.0.19044", elap=0.001sec -> 201 Created
ERROR:wsgidav.request_server:Invalid HTTP method 'LOCK'
DEBUG:wsgidav:Raising DAVError 405 Method Not Allowed
DEBUG:wsgidav.error_printer:Caught (405, None)
INFO:wsgidav.wsgidav_app:192.168.230.1 - (anonymous) - [2022-11-01 19:32:25] "LOCK /New folder/New Text Document.txt" length=212, connection="Keep-Alive", agent="Microsoft-WebDAV-MiniRedir/10.0.19044", elap=0.004sec -> 405 Method Not Allowed
rusaym commented
I tried to comment "lock_storage": False
and the error has gone
mar10 commented
Thanks for posting the solution 👍