mar10 / wsgidav

A generic and extendable WebDAV server based on WSGI

Home Page:https://wsgidav.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

can NOT write file

andrewchenshx opened this issue · comments

Describe the bug
creating a file ends with an error and a file with size 0

To Reproduce
Steps to reproduce the behavior:

  1. start the server with anonymous authentication
  2. map a network drive X
  3. with explorer, open x:, right click and create a file
  4. See error

Expected behavior
a file is created without error

Screenshots, Log-Files, Stacktrace

01:14:10.056 - ERROR   : Error parsing XML string. If lxml is not available, and unicode is involved, then installing lxml _may_ solve this issue.
01:14:10.056 - ERROR   : XML source: b'<?xml version=\'1.0\' encoding=\'UTF-8\'?>\n<D:owner xmlns:D="DAV:"><D:href>dddd\\user1</D:href></D:owner></D:lockinfo>'
01:14:10.117 - ERROR   : Traceback (most recent call last):
  File "C:\Users\user1\Anaconda3\lib\site-packages\wsgidav\error_printer.py", line 50, in __call__
    for v in app_iter:
  File "C:\Users\user1\Anaconda3\lib\site-packages\wsgidav\request_resolver.py", line 224, in __call__
    for v in app_iter:
  File "C:\Users\user1\Anaconda3\lib\site-packages\wsgidav\request_server.py", line 127, in __call__
    app_iter = provider.custom_request_handler(environ, start_response, method)
  File "C:\Users\user1\Anaconda3\lib\site-packages\wsgidav\dav_provider.py", line 1584, in custom_request_handler
    return default_handler(environ, start_response)
  File "C:\Users\user1\Anaconda3\lib\site-packages\wsgidav\request_server.py", line 1354, in do_LOCK
    lockdiscovery_el = res.get_property_value("{DAV:}lockdiscovery")
  File "C:\Users\user1\Anaconda3\lib\site-packages\wsgidav\dav_provider.py", line 647, in get_property_value
    ownerEL = xml_tools.string_to_xml(lock["owner"])
  File "C:\Users\user1\Anaconda3\lib\site-packages\wsgidav\xml_tools.py", line 52, in string_to_xml
    return etree.XML(text)
  File "src/lxml/etree.pyx", line 3216, in lxml.etree.XML
  File "src/lxml/parser.pxi", line 1896, in lxml.etree._parseMemoryDocument
  File "src/lxml/parser.pxi", line 1784, in lxml.etree._parseDoc
  File "<string>", line 2
lxml.etree.XMLSyntaxError: Extra content at the end of the document, line 2, column 67

If applicable, add screenshots to help explain your problem.
If applicable, add a log file (consider --verbose).

Environment:

4.0.1

Which WSGI server was used (cheroot, ext-wsgiutils, gevent, gunicorn, paste, uvicorn, wsgiref, ...)? cheroot

Which WebDAV client was used (MS File Explorer, MS Office, macOS Finder, WinSCP, Windows, file mapping, ...)?
MS File Explorer
Additional context
Add any other context about the problem here.

Which Windows version are you using?
Does it happen with all files, or just some, e.g. when on-ascii characters are involved?

Tried on Windows 11 and it worked for me.
Please add -v -v and send the relevant logfile parts

sorry for late response.

Which Windows version are you using?

win10 64bit.

Does it happen with all files, or just some, e.g. when on-ascii characters are involved?

i've tried .txt, .xlsx, and .jpg files.

20:43:29.051 - INFO    : 127.0.0.1 - (anonymous) - [2022-07-30 12:43:29] "PROPFIND /123.jpg" length=0, depth=0, connection="Keep-Alive", agent="Microsoft-WebDAV-MiniRedir/10.0.14393", elap=0.000sec -> 404 Not Found
20:43:29.051 - INFO    : Got OPTIONS '/' request
20:43:29.051 - INFO    : 127.0.0.1 - (anonymous) - [2022-07-30 12:43:29] "PROPFIND /" length=0, depth=0, connection="Keep-Alive", agent="Microsoft-WebDAV-MiniRedir/10.0.14393", elap=0.000sec -> 207 Multi-Status
20:43:29.114 - DEBUG   : check_write_permission(/, 0, [], )
20:43:29.115 - DEBUG   :   checking /
20:43:29.117 - DEBUG   : PUT: Content-Length == 0. Creating empty file...
20:43:29.120 - INFO    : 127.0.0.1 - (anonymous) - [2022-07-30 12:43:29] "PUT /123.jpg" length=0, connection="Keep-Alive", agent="Microsoft-WebDAV-MiniRedir/10.0.14393", elap=0.006sec -> 201 Created
20:43:29.120 - DEBUG   : checkLockPermission(/123.jpg, exclusive, infinity, )
20:43:29.120 - DEBUG   : LockStorageDict.set('/123.jpg'): Lock(<ae9c..>, '/123.jpg', , exclusive, depth-infinity, until 2022-07-30 13:43:29 (in 3600.0 seconds)
20:43:29.120 - ERROR   : Error parsing XML string. If lxml is not available, and unicode is involved, then installing lxml _may_ solve this issue.
20:43:29.120 - ERROR   : XML source: b'<?xml version=\'1.0\' encoding=\'UTF-8\'?>\n<D:owner xmlns:D="DAV:"><D:href>dddd\\user1</D:href></D:owner></D:lockinfo>'
20:43:29.120 - ERROR   : Traceback (most recent call last):
  File "C:\Users\user1\Anaconda3\lib\site-packages\wsgidav\error_printer.py", line 50, in __call__
    for v in app_iter:
  File "C:\Users\user1\Anaconda3\lib\site-packages\wsgidav\request_resolver.py", line 224, in __call__
    for v in app_iter:
  File "C:\Users\user1\Anaconda3\lib\site-packages\wsgidav\request_server.py", line 127, in __call__
    app_iter = provider.custom_request_handler(environ, start_response, method)
  File "C:\Users\user1\Anaconda3\lib\site-packages\wsgidav\dav_provider.py", line 1584, in custom_request_handler
    return default_handler(environ, start_response)
  File "C:\Users\user1\Anaconda3\lib\site-packages\wsgidav\request_server.py", line 1354, in do_LOCK
    lockdiscovery_el = res.get_property_value("{DAV:}lockdiscovery")
  File "C:\Users\user1\Anaconda3\lib\site-packages\wsgidav\dav_provider.py", line 647, in get_property_value
    ownerEL = xml_tools.string_to_xml(lock["owner"])
  File "C:\Users\user1\Anaconda3\lib\site-packages\wsgidav\xml_tools.py", line 52, in string_to_xml
    return etree.XML(text)
  File "src/lxml/etree.pyx", line 3216, in lxml.etree.XML
  File "src/lxml/parser.pxi", line 1896, in lxml.etree._parseMemoryDocument
  File "src/lxml/parser.pxi", line 1784, in lxml.etree._parseDoc
  File "<string>", line 2
lxml.etree.XMLSyntaxError: Extra content at the end of the document, line 2, column 67

20:43:29.120 - DEBUG   : Caught 500
20:43:29.120 - ERROR   : Caught HTTPRequestException(HTTP_INTERNAL_ERROR)
Traceback (most recent call last):
  File "C:\Users\user1\Anaconda3\lib\site-packages\wsgidav\error_printer.py", line 50, in __call__
    for v in app_iter:
  File "C:\Users\user1\Anaconda3\lib\site-packages\wsgidav\request_resolver.py", line 224, in __call__
    for v in app_iter:
  File "C:\Users\user1\Anaconda3\lib\site-packages\wsgidav\request_server.py", line 127, in __call__
    app_iter = provider.custom_request_handler(environ, start_response, method)
  File "C:\Users\user1\Anaconda3\lib\site-packages\wsgidav\dav_provider.py", line 1584, in custom_request_handler
    return default_handler(environ, start_response)
  File "C:\Users\user1\Anaconda3\lib\site-packages\wsgidav\request_server.py", line 1354, in do_LOCK
    lockdiscovery_el = res.get_property_value("{DAV:}lockdiscovery")
  File "C:\Users\user1\Anaconda3\lib\site-packages\wsgidav\dav_provider.py", line 647, in get_property_value
    ownerEL = xml_tools.string_to_xml(lock["owner"])
  File "C:\Users\user1\Anaconda3\lib\site-packages\wsgidav\xml_tools.py", line 52, in string_to_xml
    return etree.XML(text)
  File "src/lxml/etree.pyx", line 3216, in lxml.etree.XML
  File "src/lxml/parser.pxi", line 1896, in lxml.etree._parseMemoryDocument
  File "src/lxml/parser.pxi", line 1784, in lxml.etree._parseDoc
  File "<string>", line 2
lxml.etree.XMLSyntaxError: Extra content at the end of the document, line 2, column 67

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\user1\Anaconda3\lib\site-packages\wsgidav\error_printer.py", line 83, in __call__
    raise as_DAVError(e)
wsgidav.dav_error.DAVError: 500

20:43:29.120 - ERROR   : e.src_exception:
Extra content at the end of the document, line 2, column 67 (<string>, line 2)
20:43:29.120 - INFO    : 127.0.0.1 - (anonymous) - [2022-07-30 12:43:29] "LOCK /123.jpg" length=206, depth=infinity, connection="Keep-Alive", agent="Microsoft-WebDAV-MiniRedir/10.0.14393", elap=0.000sec -> 500 Internal Server Error
20:43:29.120 - ERROR   : Error parsing XML string. If lxml is not available, and unicode is involved, then installing lxml _may_ solve this issue.
20:43:29.120 - ERROR   : XML source: b'<?xml version=\'1.0\' encoding=\'UTF-8\'?>\n<D:owner xmlns:D="DAV:"><D:href>dddd\\user1</D:href></D:owner></D:lockinfo>'
Traceback (most recent call last):
  File "C:\Users\user1\Anaconda3\lib\site-packages\wsgidav\dav_provider.py", line 590, in get_properties
    value = self.get_property_value(name)
  File "C:\Users\user1\Anaconda3\lib\site-packages\wsgidav\dav_provider.py", line 647, in get_property_value
    ownerEL = xml_tools.string_to_xml(lock["owner"])
  File "C:\Users\user1\Anaconda3\lib\site-packages\wsgidav\xml_tools.py", line 52, in string_to_xml
    return etree.XML(text)
  File "src/lxml/etree.pyx", line 3216, in lxml.etree.XML
  File "src/lxml/parser.pxi", line 1896, in lxml.etree._parseMemoryDocument
  File "src/lxml/parser.pxi", line 1784, in lxml.etree._parseDoc
  File "src/lxml/parser.pxi", line 1141, in lxml.etree._BaseParser._parseDoc
  File "src/lxml/parser.pxi", line 615, in lxml.etree._ParserContext._handleParseResultDoc
  File "src/lxml/parser.pxi", line 725, in lxml.etree._handleParseResult
  File "src/lxml/parser.pxi", line 654, in lxml.etree._raiseParseError
  File "<string>", line 2
lxml.etree.XMLSyntaxError: Extra content at the end of the document, line 2, column 67
20:43:29.144 - INFO    : 127.0.0.1 - (anonymous) - [2022-07-30 12:43:29] "PROPFIND /123.jpg" length=0, depth=0, connection="Keep-Alive", agent="Microsoft-WebDAV-MiniRedir/10.0.14393", elap=0.025sec -> 207 Multi-Status
20:43:29.144 - ERROR   : Error parsing XML string. If lxml is not available, and unicode is involved, then installing lxml _may_ solve this issue.
20:43:29.144 - ERROR   : XML source: b'<?xml version=\'1.0\' encoding=\'UTF-8\'?>\n<D:owner xmlns:D="DAV:"><D:href>dddd\\user1</D:href></D:owner></D:lockinfo>'
Traceback (most recent call last):
  File "C:\Users\user1\Anaconda3\lib\site-packages\wsgidav\dav_provider.py", line 590, in get_properties
    value = self.get_property_value(name)
  File "C:\Users\user1\Anaconda3\lib\site-packages\wsgidav\dav_provider.py", line 647, in get_property_value
    ownerEL = xml_tools.string_to_xml(lock["owner"])
  File "C:\Users\user1\Anaconda3\lib\site-packages\wsgidav\xml_tools.py", line 52, in string_to_xml
    return etree.XML(text)
  File "src/lxml/etree.pyx", line 3216, in lxml.etree.XML
  File "src/lxml/parser.pxi", line 1896, in lxml.etree._parseMemoryDocument
  File "src/lxml/parser.pxi", line 1784, in lxml.etree._parseDoc
  File "src/lxml/parser.pxi", line 1141, in lxml.etree._BaseParser._parseDoc
  File "src/lxml/parser.pxi", line 615, in lxml.etree._ParserContext._handleParseResultDoc
  File "src/lxml/parser.pxi", line 725, in lxml.etree._handleParseResult
  File "src/lxml/parser.pxi", line 654, in lxml.etree._raiseParseError
  File "<string>", line 2
lxml.etree.XMLSyntaxError: Extra content at the end of the document, line 2, column 67

Strange. I think we need the

  • complete log file (with double verbose: -vv)
  • the exact command line that you executed,
  • and the configuration file (wsgidav.yaml)
  • How did you install WsgiDAV?
  • Please run pip list from the Python environment and share it if possible

There is also a new 4.0.2 release, you could try that as well...

(1)install with pip

pip install -U wsgidav

(2)command executed

wsgidav -vv -r . --auth=anonymous

(3)complete log
Command line args:
            port: None
            host: None
       root_path: C:\Users\user1
            auth: anonymous
          server: None
     ssl_adapter: None
         verbose: 5
     config_file: None
       no_config: False
          browse: False
         version: False
Running without configuration file.
Configuration(None):
{'_config_file': None,
 '_config_root': 'C:\\Users\\user1',
 'add_header_MS_Author_Via': True,
 'dir_browser': {'davmount': True,
                 'davmount_links': False,
                 'enable': True,
                 'htdocs_path': None,
                 'icon': True,
                 'ignore': ['.DS_Store', '._*', 'Thumbs.db'],
                 'libre_office_support': True,
                 'ms_sharepoint_support': True,
                 'response_trailer': True,
                 'show_user': True},
 'host': 'localhost',
 'hotfixes': {'emulate_win32_lastmod': False,
              're_encode_path_info': True,
              'unquote_path_info': False},
 'http_authenticator': {'accept_basic': True,
                        'accept_digest': True,
                        'default_to_digest': True,
                        'domain_controller': None,
                        'trusted_auth_header': None},
 'lock_storage': True,
 'logging': {'debug_methods': [],
             'enable_loggers': [],
             'logger_date_format': '%H:%M:%S',
             'logger_format': '%(asctime)s.%(msecs)03d - %(levelname)-8s: '
                              '%(message)s'},
 'middleware_stack': [,
                      ,
                      ,
                      ,
                      ],
 'mount_path': None,
 'mutable_live_props': [],
 'port': 8080,
 'property_manager': None,
 'provider_mapping': {'/': FilesystemProvider for path 'C:\Users\user1' (Read-Write)},
 'server': 'cheroot',
 'server_args': {},
 'simple_dc': {'user_mapping': {}},
 'verbose': 5}
19:37:48.207 - WARNING : App wsgidav.mw.cors.Cors(None).is_disabled() returned True: skipping.
19:37:50.053 - INFO    : WsgiDAV/4.0.2 Python/3.9.7 Windows-10-10.0.14393-SP0
19:37:50.053 - INFO    : Default encoding: 'utf-8' (file system: 'utf-8')
19:37:50.054 - INFO    : Lock manager:      LockManager(LockStorageDict)
19:37:50.055 - INFO    : Property manager:  None
19:37:50.056 - INFO    : Domain controller: SimpleDomainController()
19:37:50.057 - INFO    : Middleware stack:
19:37:50.058 - INFO    :   - wsgidav.error_printer.ErrorPrinter
19:37:50.058 - INFO    :   - wsgidav.http_authenticator.HTTPAuthenticator
19:37:50.060 - INFO    :   - wsgidav.dir_browser._dir_browser.WsgiDavDirBrowser
19:37:50.060 - INFO    :   - wsgidav.request_resolver.RequestResolver
19:37:50.061 - INFO    : Registered DAV providers by route:
19:37:50.062 - INFO    :   - '/:dir_browser': FilesystemProvider for path 'C:\Users\user1\Anaconda3\lib\site-packages\wsgidav\dir_browser\htdocs' (Read-Only) (anonymous)
19:37:50.063 - INFO    :   - '/': FilesystemProvider for path 'C:\Users\user1' (Read-Write) (anonymous)
19:37:50.063 - WARNING : Basic authentication is enabled: It is highly recommended to enable SSL.
19:37:50.064 - WARNING : Share '/' will allow anonymous write access.
19:37:50.065 - WARNING : Share '/:dir_browser' will allow anonymous read access.
19:37:50.785 - INFO    : Running WsgiDAV/4.0.2 Cheroot/8.6.0 Python 3.9.7
19:37:50.785 - INFO    : Serving on http://localhost:8080 ...
19:38:10.758 - INFO    : Got OPTIONS '/' request
19:38:10.773 - INFO    : 127.0.0.1 - (anonymous) - [2022-08-04 11:38:10] "PROPFIND /" length=0, depth=0, connection="Keep-Alive", agent="Microsoft-WebDAV-MiniRedir/10.0.14393", elap=0.016sec -> 207 Multi-Status
19:38:10.773 - DEBUG   : Raising DAVError 404 Not Found: /.git
19:38:10.773 - DEBUG   : Caught (404, '/.git')
19:38:10.773 - INFO    : 127.0.0.1 - (anonymous) - [2022-08-04 11:38:10] "PROPFIND /.git" length=0, depth=0, connection="Keep-Alive", agent="Microsoft-WebDAV-MiniRedir/10.0.14393", elap=0.000sec -> 404 Not Found
19:38:10.773 - DEBUG   : Raising DAVError 404 Not Found: /HEAD
19:38:10.773 - DEBUG   : Caught (404, '/HEAD')
19:38:10.773 - INFO    : 127.0.0.1 - (anonymous) - [2022-08-04 11:38:10] "PROPFIND /HEAD" length=0, depth=0, connection="Keep-Alive", agent="Microsoft-WebDAV-MiniRedir/10.0.14393", elap=0.000sec -> 404 Not Found
19:38:40.091 - DEBUG   : Raising DAVError 404 Not Found: /123.txt
19:38:40.091 - DEBUG   : Caught (404, '/123.txt')
19:38:40.091 - INFO    : 127.0.0.1 - (anonymous) - [2022-08-04 11:38:40] "PROPFIND /123.txt" length=0, depth=0, connection="Keep-Alive", agent="Microsoft-WebDAV-MiniRedir/10.0.14393", elap=0.000sec -> 404 Not Found
19:38:40.107 - INFO    : Got OPTIONS '/' request
19:38:40.107 - INFO    : 127.0.0.1 - (anonymous) - [2022-08-04 11:38:40] "PROPFIND /" length=0, depth=0, connection="Keep-Alive", agent="Microsoft-WebDAV-MiniRedir/10.0.14393", elap=0.000sec -> 207 Multi-Status
19:38:40.170 - DEBUG   : check_write_permission(/, 0, [], )
19:38:40.170 - DEBUG   :   checking /
19:38:40.170 - DEBUG   : PUT: Content-Length == 0. Creating empty file...
19:38:40.170 - INFO    : 127.0.0.1 - (anonymous) - [2022-08-04 11:38:40] "PUT /123.txt" length=0, connection="Keep-Alive", agent="Microsoft-WebDAV-MiniRedir/10.0.14393", elap=0.000sec -> 201 Created
19:38:40.170 - DEBUG   : checkLockPermission(/123.txt, exclusive, infinity, )
19:38:40.170 - DEBUG   : LockStorageDict.set('/123.txt'): Lock(<4b18..>, '/123.txt', , exclusive, depth-infinity, until 2022-08-04 12:38:40 (in 3600.0 seconds)
19:38:40.170 - ERROR   : Error parsing XML string. If lxml is not available, and unicode is involved, then installing lxml _may_ solve this issue.
19:38:40.170 - ERROR   : XML source: b'\ndddd\\user1'
19:38:40.185 - ERROR   : Traceback (most recent call last):
  File "C:\Users\user1\Anaconda3\lib\site-packages\wsgidav\error_printer.py", line 50, in __call__
    for v in app_iter:
  File "C:\Users\user1\Anaconda3\lib\site-packages\wsgidav\request_resolver.py", line 224, in __call__
    for v in app_iter:
  File "C:\Users\user1\Anaconda3\lib\site-packages\wsgidav\request_server.py", line 127, in __call__
    app_iter = provider.custom_request_handler(environ, start_response, method)
  File "C:\Users\user1\Anaconda3\lib\site-packages\wsgidav\dav_provider.py", line 1591, in custom_request_handler
    return default_handler(environ, start_response)
  File "C:\Users\user1\Anaconda3\lib\site-packages\wsgidav\request_server.py", line 1357, in do_LOCK
    lockdiscovery_el = res.get_property_value("{DAV:}lockdiscovery")
  File "C:\Users\user1\Anaconda3\lib\site-packages\wsgidav\dav_provider.py", line 647, in get_property_value
    ownerEL = xml_tools.string_to_xml(lock["owner"])
  File "C:\Users\user1\Anaconda3\lib\site-packages\wsgidav\xml_tools.py", line 52, in string_to_xml
    return etree.XML(text)
  File "src/lxml/etree.pyx", line 3216, in lxml.etree.XML
  File "src/lxml/parser.pxi", line 1896, in lxml.etree._parseMemoryDocument
  File "src/lxml/parser.pxi", line 1784, in lxml.etree._parseDoc
  File "", line 2
lxml.etree.XMLSyntaxError: Extra content at the end of the document, line 2, column 67

19:38:40.185 - DEBUG : Caught 500
19:38:40.185 - ERROR : Caught HTTPRequestException(HTTP_INTERNAL_ERROR)
Traceback (most recent call last):
File "C:\Users\user1\Anaconda3\lib\site-packages\wsgidav\error_printer.py", line 50, in call
for v in app_iter:
File "C:\Users\user1\Anaconda3\lib\site-packages\wsgidav\request_resolver.py", line 224, in call
for v in app_iter:
File "C:\Users\user1\Anaconda3\lib\site-packages\wsgidav\request_server.py", line 127, in call
app_iter = provider.custom_request_handler(environ, start_response, method)
File "C:\Users\user1\Anaconda3\lib\site-packages\wsgidav\dav_provider.py", line 1591, in custom_request_handler
return default_handler(environ, start_response)
File "C:\Users\user1\Anaconda3\lib\site-packages\wsgidav\request_server.py", line 1357, in do_LOCK
lockdiscovery_el = res.get_property_value("{DAV:}lockdiscovery")
File "C:\Users\user1\Anaconda3\lib\site-packages\wsgidav\dav_provider.py", line 647, in get_property_value
ownerEL = xml_tools.string_to_xml(lock["owner"])
File "C:\Users\user1\Anaconda3\lib\site-packages\wsgidav\xml_tools.py", line 52, in string_to_xml
return etree.XML(text)
File "src/lxml/etree.pyx", line 3216, in lxml.etree.XML
File "src/lxml/parser.pxi", line 1896, in lxml.etree._parseMemoryDocument
File "src/lxml/parser.pxi", line 1784, in lxml.etree._parseDoc
File "", line 2
lxml.etree.XMLSyntaxError: Extra content at the end of the document, line 2, column 67

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\user1\Anaconda3\lib\site-packages\wsgidav\error_printer.py", line 83, in call
raise as_DAVError(e)
wsgidav.dav_error.DAVError: 500

19:38:40.185 - ERROR : e.src_exception:
Extra content at the end of the document, line 2, column 67 (, line 2)
19:38:40.185 - INFO : 127.0.0.1 - (anonymous) - [2022-08-04 11:38:40] "LOCK /123.txt" length=206, depth=infinity, connection="Keep-Alive", agent="Microsoft-WebDAV-MiniRedir/10.0.14393", elap=0.016sec -> 500 Internal Server Error
19:38:40.337 - ERROR : Error parsing XML string. If lxml is not available, and unicode is involved, then installing lxml may solve this issue.
19:38:40.337 - ERROR : XML source: b'\n<D:owner xmlns:D="DAV:"><D:href>dddd\user1</D:href></D:owner></D:lockinfo>'
Traceback (most recent call last):
File "C:\Users\user1\Anaconda3\lib\site-packages\wsgidav\dav_provider.py", line 590, in get_properties
value = self.get_property_value(name)
File "C:\Users\user1\Anaconda3\lib\site-packages\wsgidav\dav_provider.py", line 647, in get_property_value
ownerEL = xml_tools.string_to_xml(lock["owner"])
File "C:\Users\user1\Anaconda3\lib\site-packages\wsgidav\xml_tools.py", line 52, in string_to_xml
return etree.XML(text)
File "src/lxml/etree.pyx", line 3216, in lxml.etree.XML
File "src/lxml/parser.pxi", line 1896, in lxml.etree._parseMemoryDocument
File "src/lxml/parser.pxi", line 1784, in lxml.etree._parseDoc
File "src/lxml/parser.pxi", line 1141, in lxml.etree._BaseParser._parseDoc
File "src/lxml/parser.pxi", line 615, in lxml.etree._ParserContext._handleParseResultDoc
File "src/lxml/parser.pxi", line 725, in lxml.etree._handleParseResult
File "src/lxml/parser.pxi", line 654, in lxml.etree._raiseParseError
File "", line 2
lxml.etree.XMLSyntaxError: Extra content at the end of the document, line 2, column 67
19:38:40.337 - INFO : 127.0.0.1 - (anonymous) - [2022-08-04 11:38:40] "PROPFIND /123.txt" length=0, depth=0, connection="Keep-Alive", agent="Microsoft-WebDAV-MiniRedir/10.0.14393", elap=0.152sec -> 207 Multi-Status
19:38:40.337 - ERROR : Error parsing XML string. If lxml is not available, and unicode is involved, then installing lxml may solve this issue.
19:38:40.337 - ERROR : XML source: b'\n<D:owner xmlns:D="DAV:"><D:href>dddd\user1</D:href></D:owner></D:lockinfo>'
Traceback (most recent call last):
File "C:\Users\user1\Anaconda3\lib\site-packages\wsgidav\dav_provider.py", line 590, in get_properties
value = self.get_property_value(name)
File "C:\Users\user1\Anaconda3\lib\site-packages\wsgidav\dav_provider.py", line 647, in get_property_value
ownerEL = xml_tools.string_to_xml(lock["owner"])
File "C:\Users\user1\Anaconda3\lib\site-packages\wsgidav\xml_tools.py", line 52, in string_to_xml
return etree.XML(text)
File "src/lxml/etree.pyx", line 3216, in lxml.etree.XML
File "src/lxml/parser.pxi", line 1896, in lxml.etree._parseMemoryDocument
File "src/lxml/parser.pxi", line 1784, in lxml.etree._parseDoc
File "src/lxml/parser.pxi", line 1141, in lxml.etree._BaseParser._parseDoc
File "src/lxml/parser.pxi", line 615, in lxml.etree._ParserContext._handleParseResultDoc
File "src/lxml/parser.pxi", line 725, in lxml.etree._handleParseResult
File "src/lxml/parser.pxi", line 654, in lxml.etree._raiseParseError
File "", line 2
lxml.etree.XMLSyntaxError: Extra content at the end of the document, line 2, column 67
19:38:40.337 - INFO : 127.0.0.1 - (anonymous) - [2022-08-04 11:38:40] "PROPFIND /123.txt" length=0, depth=0, connection="Keep-Alive", agent="Microsoft-WebDAV-MiniRedir/10.0.14393", elap=0.000sec -> 207 Multi-Status
19:38:40.357 - ERROR : Error parsing XML string. If lxml is not available, and unicode is involved, then installing lxml may solve this issue.
19:38:40.357 - ERROR : XML source: b'\n<D:owner xmlns:D="DAV:"><D:href>dddd\user1</D:href></D:owner></D:lockinfo>'
Traceback (most recent call last):
File "C:\Users\user1\Anaconda3\lib\site-packages\wsgidav\dav_provider.py", line 590, in get_properties
value = self.get_property_value(name)
File "C:\Users\user1\Anaconda3\lib\site-packages\wsgidav\dav_provider.py", line 647, in get_property_value
ownerEL = xml_tools.string_to_xml(lock["owner"])
File "C:\Users\user1\Anaconda3\lib\site-packages\wsgidav\xml_tools.py", line 52, in string_to_xml
return etree.XML(text)
File "src/lxml/etree.pyx", line 3216, in lxml.etree.XML
File "src/lxml/parser.pxi", line 1896, in lxml.etree._parseMemoryDocument
File "src/lxml/parser.pxi", line 1784, in lxml.etree._parseDoc
File "src/lxml/parser.pxi", line 1141, in lxml.etree._BaseParser._parseDoc
File "src/lxml/parser.pxi", line 615, in lxml.etree._ParserContext._handleParseResultDoc
File "src/lxml/parser.pxi", line 725, in lxml.etree._handleParseResult
File "src/lxml/parser.pxi", line 654, in lxml.etree._raiseParseError
File "", line 2
lxml.etree.XMLSyntaxError: Extra content at the end of the document, line 2, column 67
19:38:40.357 - INFO : 127.0.0.1 - (anonymous) - [2022-08-04 11:38:40] "PROPFIND /123.txt" length=0, depth=0, connection="Keep-Alive", agent="Microsoft-WebDAV-MiniRedir/10.0.14393", elap=0.000sec -> 207 Multi-Status
19:38:44.405 - DEBUG : Raising DAVError 404 Not Found: /123 (2).txt
19:38:44.405 - DEBUG : Caught (404, '/123 (2).txt')
19:38:44.405 - INFO : 127.0.0.1 - (anonymous) - [2022-08-04 11:38:44] "PROPFIND /123 (2).txt" length=0, depth=0, connection="Keep-Alive", agent="Microsoft-WebDAV-MiniRedir/10.0.14393", elap=0.000sec -> 404 Not Found
19:38:44.420 - DEBUG : checkLockPermission(/123.txt, exclusive, infinity, )
19:38:44.420 - DEBUG : check parent /123.txt, Lock(<4b18..>, '/123.txt', , exclusive, depth-infinity, until 2022-08-04 12:38:40 (in 3595.7492303848267 seconds)
19:38:44.420 - DEBUG : -> DENIED due to locked parent Lock(<4b18..>, '/123.txt', , exclusive, depth-infinity, until 2022-08-04 12:38:40 (in 3595.7492303848267 seconds)
19:38:44.420 - DEBUG : Caught 423
19:38:44.420 - INFO : 127.0.0.1 - (anonymous) - [2022-08-04 11:38:44] "LOCK /123.txt" length=206, depth=infinity, connection="Keep-Alive", agent="Microsoft-WebDAV-MiniRedir/10.0.14393", elap=0.000sec -> 423 Locked
19:38:44.420 - ERROR : Error parsing XML string. If lxml is not available, and unicode is involved, then installing lxml may solve this issue.
19:38:44.420 - ERROR : XML source: b'\n<D:owner xmlns:D="DAV:"><D:href>dddd\user1</D:href></D:owner></D:lockinfo>'
Traceback (most recent call last):
File "C:\Users\user1\Anaconda3\lib\site-packages\wsgidav\dav_provider.py", line 590, in get_properties
value = self.get_property_value(name)
File "C:\Users\user1\Anaconda3\lib\site-packages\wsgidav\dav_provider.py", line 647, in get_property_value
ownerEL = xml_tools.string_to_xml(lock["owner"])
File "C:\Users\user1\Anaconda3\lib\site-packages\wsgidav\xml_tools.py", line 52, in string_to_xml
return etree.XML(text)
File "src/lxml/etree.pyx", line 3216, in lxml.etree.XML
File "src/lxml/parser.pxi", line 1896, in lxml.etree._parseMemoryDocument
File "src/lxml/parser.pxi", line 1784, in lxml.etree._parseDoc
File "src/lxml/parser.pxi", line 1141, in lxml.etree._BaseParser._parseDoc
File "src/lxml/parser.pxi", line 615, in lxml.etree._ParserContext._handleParseResultDoc
File "src/lxml/parser.pxi", line 725, in lxml.etree._handleParseResult
File "src/lxml/parser.pxi", line 654, in lxml.etree._raiseParseError
File "", line 2
lxml.etree.XMLSyntaxError: Extra content at the end of the document, line 2, column 67
19:38:44.441 - INFO : 127.0.0.1 - (anonymous) - [2022-08-04 11:38:44] "PROPFIND /123.txt" length=0, depth=0, connection="Keep-Alive", agent="Microsoft-WebDAV-MiniRedir/10.0.14393", elap=0.021sec -> 207 Multi-Status
19:38:44.483 - DEBUG : checkLockPermission(/123.txt, exclusive, infinity, )
19:38:44.483 - DEBUG : check parent /123.txt, Lock(<4b18..>, '/123.txt', , exclusive, depth-infinity, until 2022-08-04 12:38:40 (in 3595.686671257019 seconds)
19:38:44.483 - DEBUG : -> DENIED due to locked parent Lock(<4b18..>, '/123.txt', , exclusive, depth-infinity, until 2022-08-04 12:38:40 (in 3595.686671257019 seconds)
19:38:44.483 - DEBUG : Caught 423
19:38:44.483 - INFO : 127.0.0.1 - (anonymous) - [2022-08-04 11:38:44] "LOCK /123.txt" length=206, depth=infinity, connection="Keep-Alive", agent="Microsoft-WebDAV-MiniRedir/10.0.14393", elap=0.000sec -> 423 Locked
19:38:44.483 - ERROR : Error parsing XML string. If lxml is not available, and unicode is involved, then installing lxml may solve this issue.
19:38:44.483 - ERROR : XML source: b'\n<D:owner xmlns:D="DAV:"><D:href>dddd\user1</D:href></D:owner></D:lockinfo>'
Traceback (most recent call last):
File "C:\Users\user1\Anaconda3\lib\site-packages\wsgidav\dav_provider.py", line 590, in get_properties
value = self.get_property_value(name)
File "C:\Users\user1\Anaconda3\lib\site-packages\wsgidav\dav_provider.py", line 647, in get_property_value
ownerEL = xml_tools.string_to_xml(lock["owner"])
File "C:\Users\user1\Anaconda3\lib\site-packages\wsgidav\xml_tools.py", line 52, in string_to_xml
return etree.XML(text)
File "src/lxml/etree.pyx", line 3216, in lxml.etree.XML
File "src/lxml/parser.pxi", line 1896, in lxml.etree._parseMemoryDocument
File "src/lxml/parser.pxi", line 1784, in lxml.etree._parseDoc
File "src/lxml/parser.pxi", line 1141, in lxml.etree._BaseParser._parseDoc
File "src/lxml/parser.pxi", line 615, in lxml.etree._ParserContext._handleParseResultDoc
File "src/lxml/parser.pxi", line 725, in lxml.etree._handleParseResult
File "src/lxml/parser.pxi", line 654, in lxml.etree._raiseParseError
File "", line 2
lxml.etree.XMLSyntaxError: Extra content at the end of the document, line 2, column 67
19:38:44.483 - INFO : 127.0.0.1 - (anonymous) - [2022-08-04 11:38:44] "PROPFIND /123.txt" length=0, depth=0, connection="Keep-Alive", agent="Microsoft-WebDAV-MiniRedir/10.0.14393", elap=0.000sec -> 207 Multi-Status
19:38:44.561 - DEBUG : checkLockPermission(/123.txt, exclusive, infinity, )
19:38:44.561 - DEBUG : check parent /123.txt, Lock(<4b18..>, '/123.txt', , exclusive, depth-infinity, until 2022-08-04 12:38:40 (in 3595.6085555553436 seconds)
19:38:44.561 - DEBUG : -> DENIED due to locked parent Lock(<4b18..>, '/123.txt', , exclusive, depth-infinity, until 2022-08-04 12:38:40 (in 3595.6085555553436 seconds)
19:38:44.561 - DEBUG : Caught 423
19:38:44.561 - INFO : 127.0.0.1 - (anonymous) - [2022-08-04 11:38:44] "LOCK /123.txt" length=206, depth=infinity, connection="Keep-Alive", agent="Microsoft-WebDAV-MiniRedir/10.0.14393", elap=0.000sec -> 423 Locked

(4)pip list
Package                            Version              Location
---------------------------------- -------------------- -----------------------------------------
alabaster                          0.7.12
anaconda-client                    1.9.0
anaconda-navigator                 2.1.1
anaconda-project                   0.10.1
anyio                              2.2.0
appdirs                            1.4.4
argh                               0.26.2
argon2-cffi                        20.1.0
arrow                              0.13.1
asn1crypto                         1.4.0
astroid                            2.6.6
astropy                            4.3.1
asttokens                          2.0.5
async-generator                    1.10
atomicwrites                       1.4.0
attrs                              21.2.0
autopep8                           1.5.7
Babel                              2.9.1
backcall                           0.2.0
backports.functools-lru-cache      1.6.4
backports.shutil-get-terminal-size 1.0.0
backports.tempfile                 1.0
backports.weakref                  1.0.post1
bcrypt                             3.2.0
beautifulsoup4                     4.10.0
binaryornot                        0.4.4
bitarray                           2.3.0
bkcharts                           0.2
black                              19.10b0
bleach                             4.0.0
bokeh                              2.4.1
boto                               2.49.0
Bottleneck                         1.3.2
brotlipy                           0.7.0
build                              0.8.0
cached-property                    1.5.2
certifi                            2021.10.8
cffi                               1.14.6
chardet                            4.0.0
charset-normalizer                 2.0.4
cheroot                            8.6.0
click                              8.0.3
cloudpickle                        2.0.0
clyent                             1.2.2
colorama                           0.4.4
comtypes                           1.1.10
conda                              4.10.3
conda-build                        3.21.6
conda-content-trust                0+unknown
conda-pack                         0.6.0
conda-package-handling             1.7.3
conda-repo-cli                     1.0.4
conda-token                        0.3.0
conda-verify                       3.4.2
contextlib2                        0.6.0.post1
cookiecutter                       1.7.2
cryptography                       3.4.8
cycler                             0.10.0
Cython                             0.29.24
cytoolz                            0.11.0
daal4py                            2021.3.0
dask                               2021.10.0
dbfread                            2.0.7
debugpy                            1.4.1
decorator                          5.1.0
defusedxml                         0.7.1
dialite                            0.5.3
diff-match-patch                   20200713
distributed                        2021.10.0
docutils                           0.17.1
entrypoints                        0.3
et-xmlfile                         1.1.0
fastcache                          1.1.0
filelock                           3.3.1
flake8                             3.9.2
Flask                              1.1.2
flexx                              0.8.4
fonttools                          4.25.0
fsspec                             2021.10.1
future                             0.18.2
gevent                             21.8.0
glob2                              0.7
greenlet                           1.1.1
h5py                               3.2.1
HeapDict                           1.0.1
html5lib                           1.1
idna                               3.2
imagecodecs                        2021.8.26
imageio                            2.9.0
imagesize                          1.2.0
importlib-metadata                 4.8.1
inflection                         0.5.1
iniconfig                          1.1.1
intervaltree                       3.1.0
ipykernel                          6.4.1
ipython                            7.29.0
ipython-genutils                   0.2.0
ipywidgets                         7.6.5
isort                              5.9.3
itsdangerous                       2.0.1
jaraco.functools                   3.5.0
jdcal                              1.4.1
jedi                               0.18.0
Jinja2                             2.11.3
jinja2-time                        0.2.0
joblib                             1.1.0
json5                              0.8.5
jsonschema                         3.2.0
jupyter                            1.0.0
jupyter-client                     6.1.12
jupyter-console                    6.4.0
jupyter-core                       4.8.1
jupyter-server                     1.4.1
jupyterlab                         3.2.1
jupyterlab-pygments                0.1.2
jupyterlab-server                  2.8.2
jupyterlab-widgets                 1.0.0
keyring                            23.1.0
kiwisolver                         1.3.1
lazy-object-proxy                  1.6.0
libarchive-c                       2.9
llvmlite                           0.37.0
locket                             0.2.1
lxml                               4.6.3
MarkupSafe                         1.1.1
matplotlib                         3.4.3
matplotlib-inline                  0.1.2
mccabe                             0.6.1
menuinst                           1.4.18
meta                               1.0.2
mistune                            0.8.4
mkl-fft                            1.3.1
mkl-random                         1.2.2
mkl-service                        2.4.0
mock                               4.0.3
more-itertools                     8.10.0
mpmath                             1.2.1
msgpack                            1.0.2
multipledispatch                   0.6.0
munkres                            1.1.4
mypy-extensions                    0.4.3
navigator-updater                  0.2.1
nbclassic                          0.2.6
nbclient                           0.5.3
nbconvert                          6.1.0
nbformat                           5.1.3
nest-asyncio                       1.5.1
networkx                           2.6.3
nltk                               3.6.5
nose                               1.3.7
notebook                           6.4.5
numba                              0.54.1
numexpr                            2.7.3
numpy                              1.20.3
numpydoc                           1.1.0
olefile                            0.46
openpyxl                           3.0.9
packaging                          21.0
pandas                             1.3.4
pandocfilters                      1.4.3
paramiko                           2.7.2
parso                              0.8.2
partd                              1.2.0
path                               16.0.0
pathlib2                           2.3.6
pathspec                           0.7.0
patsy                              0.5.2
pep517                             0.12.0
pep8                               1.7.1
pexpect                            4.8.0
pickleshare                        0.7.5
Pillow                             8.4.0
pip                                21.2.4
pkginfo                            1.7.1
pluggy                             0.13.1
ply                                3.11
poyo                               0.5.0
prometheus-client                  0.11.0
prompt-toolkit                     3.0.20
pscript                            0.7.7
psutil                             5.8.0
ptyprocess                         0.7.0
py                                 1.10.0
pycodestyle                        2.7.0
pycosat                            0.6.3
pycparser                          2.20
pycurl                             7.44.1
pydocstyle                         6.1.1
pyenchant                          3.2.2
pyerfa                             2.0.0
pyflakes                           2.3.1
Pygments                           2.10.0
PyJWT                              2.1.0
pylint                             2.9.6
pyls-spyder                        0.4.0
PyNaCl                             1.4.0
pyodbc                             4.0.0-unsupported
pyOpenSSL                          21.0.0
pyparsing                          3.0.4
PyQt5                              5.15.7
PyQt5-Qt5                          5.15.2
PyQt5-sip                          12.11.0
PyQtWebEngine                      5.15.6
PyQtWebEngine-Qt5                  5.15.2
pyreadline                         2.1
pyrsistent                         0.18.0
pyshortcuts                        1.8.2
PySocks                            1.7.1
pytest                             6.2.4
python-dateutil                    2.8.2
python-lsp-black                   1.0.0
python-lsp-jsonrpc                 1.0.0
python-lsp-server                  1.2.4
python-pam                         1.8.4
python-slugify                     5.0.2
pytz                               2021.3
PyWavelets                         1.1.1
pywin32                            228
pywin32-ctypes                     0.2.0
pywinpty                           0.5.7
PyYAML                             6.0
pyzmq                              22.2.1
QDarkStyle                         3.0.2
qstylizer                          0.1.10
QtAwesome                          1.0.2
qtconsole                          5.1.1
QtPy                               1.10.0
regex                              2021.8.3
requests                           2.26.0
rope                               0.19.0
Rtree                              0.9.7
ruamel-yaml-conda                  0.15.100
schedule                           1.1.0
scikit-image                       0.18.3
scikit-learn                       0.24.2
scikit-learn-intelex               2021.20210714.120553
scipy                              1.7.1
seaborn                            0.11.2
Send2Trash                         1.8.0
setuptools                         58.0.4
simplegeneric                      0.8.1
singledispatch                     3.7.0
sip                                4.19.13
six                                1.16.0
sniffio                            1.2.0
snowballstemmer                    2.1.0
sortedcollections                  2.1.0
sortedcontainers                   2.4.0
soupsieve                          2.2.1
Sphinx                             4.2.0
sphinxcontrib-applehelp            1.0.2
sphinxcontrib-devhelp              1.0.2
sphinxcontrib-htmlhelp             2.0.0
sphinxcontrib-jsmath               1.0.1
sphinxcontrib-qthelp               1.0.3
sphinxcontrib-serializinghtml      1.1.5
sphinxcontrib-websupport           1.2.4
spyder                             5.1.5
spyder-kernels                     2.1.3
SQLAlchemy                         1.4.22
statsmodels                        0.12.2
sympy                              1.9
tables                             3.6.1
TBB                                0.2
tblib                              1.7.0
terminado                          0.9.4
testpath                           0.5.0
text-unidecode                     1.3
textdistance                       4.2.1
threadpoolctl                      2.2.0
three-merge                        0.1.1
tifffile                           2021.7.2
tinycss                            0.4
tk                                 0.1.0
toml                               0.10.2
tomli                              2.0.1
toolz                              0.11.1
tornado                            6.1
tqdm                               4.62.3
traitlets                          5.1.0
typed-ast                          1.4.3
typing-extensions                  3.10.0.2
ujson                              4.0.2
unicodecsv                         0.14.1
Unidecode                          1.2.0
urllib3                            1.26.7
watchdog                           2.1.3
wcwidth                            0.2.5
webencodings                       0.5.1
webruntime                         0.5.8
Werkzeug                           2.0.2
wheel                              0.37.0
whichcraft                         0.6.1
widgetsnbextension                 3.5.1
win-inet-pton                      1.1.0
win-unicode-console                0.5
wincertstore                       0.2
windows-curses                     2.3.0
wrapt                              1.12.1
WsgiDAV                            4.0.2
xlrd                               2.0.1
XlsxWriter                         3.0.1
xlwings                            0.24.9
xlwt                               1.3.0
xmltodict                          0.12.0
yapf                               0.31.0
zict                               2.0.0
zipp                               3.6.0
zope.event                         4.5.0
zope.interface                     5.4.0

Thanks for taking the time to collect the information and sorry for the late response 😕
It seem you are using a simple configuration, basically what I used when I tried to reproduce without success.

Obviously, the stored locking information is corrupted:

20:43:29.120 - ERROR   : XML source: b'<?xml version=\'1.0\' encoding=\'UTF-8\'?>\n<D:owner xmlns:D="DAV:"><D:href>dddd\\user1</D:href></D:owner></D:lockinfo>'
Traceback (most recent call last):
  File "C:\Users\user1\Anaconda3\lib\site-packages\wsgidav\dav_provider.py", line 590, in get_properties
    value = self.get_property_value(name)
  File "C:\Users\user1\Anaconda3\lib\site-packages\wsgidav\dav_provider.py", line 647, in get_property_value
    ownerEL = xml_tools.string_to_xml(lock["owner"])
  File "C:\Users\user1\Anaconda3\lib\site-packages\wsgidav\xml_tools.py", line 52, in string_to_xml
    return etree.XML(text)
 ...
lxml.etree.XMLSyntaxError: Extra content at the end of the document, line 2, column 67

There is no matching opening tag for the closing </D:lockinfo>:
<?xml version=\'1.0\' encoding=\'UTF-8\'?>\n<D:owner xmlns:D="DAV:"><D:href>dddd\\user1</D:href></D:owner></D:lockinfo>

The relevant code is in

    def do_LOCK(self, environ, start_response):
        ...
        # may be something goes wrong here, when reading the request body.
        # due to invalid content_length header, wrong encoding, bytes/str confusion, ...
        lockinfo_el = util.parse_xml_body(environ, allow_empty=True)

        # or the following code breaks for similar reasons

Any chance you can set a breakpoint there and have a look at the vars?

I’m having the same issue on Windows 11 64 but also have noticed it with using FE Explorer on iOS sometimes. I’m currently on 4.0.0 though, hosting through a FreeBSD 13.1 server and have my instance only accessible through my Wireguard VPN

This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs.
Thank you for your contributions.