Cannot upload content on Plone 5.2.2 over WebDAV

Environment

  • Environment type: Standalone Plone instance on a VMware Player VM
  • Plone version: 5.2.2
  • Python version: 3.7.3
  • Guest OS: Debian 10 Buster
  • VM hardware: 8 cores, 8 GB RAM, 2 GB free space
  • Physical OS: Debian 10 Buster, AMD64
  • Physical machine build: AMD FX 8350, 32 GB RAM, Nvidia Geforce GTX 1070, Asus M5A99X EVO R2.0 motherboard, 1 TB SSD

I am starting a Plone website and I need to upload a large number of files into my Plone instance. I have already made sure to enable the "WebDAV access" permission for all http://(my Plone instance address):9080/manage_access , and I can log in to my server over WebDAV and view my folders.

However, I cannot create or upload any content. I have tried so far with Linux MATE and with Windows 8.1's explorer.exe as WebDAV clients.

In MATE, on the same VM where I run Plone, whenever I try to paste something I get "Error while creating directory untitled folder - There was an error creating the directory in dav://(my username)@localhost:9080/(my site)/(my folder) - Not found" In Windows, meanwhile, I get "Could not find this item - This is no longer located in \\(VM IP address)@9080\DavWWWRoot\(my site). Verify the item's location and try again".

This is after having upgraded to Plone 5.2.2, after finding out that WebDAV was broken on Plone 5.2.1 and later fixed on 5.2.2.

Any idea of what I could be missing?

1 Like

You need to enable WebDAV on the WSGI level (wsgi.ini)...sorry, but I forgot how :slight_smile:

Having read documentations and manuals, here's what I have tried:

  1. Specify on <Plone root>/zinstance/buildout.cfg, under the [instance] section, the directive wsgi-ini-template = <Plone root>/zinstance/wsgi_webdav.ini.

  2. Locate the default wsgi.ini file and copy it to <Plone root>/zinstance/wsgi_webdav.ini

Now Buildout won't even complete. From the error output I can make out that I might be missing a wsgi-options parameter or section, but after having read the official documentation on WSGI on https://training.plone.org/5/wsgi/prz-recipe-options.html#wsgi-ini-template I still can't figure out how to put it on my Buildout configuration.

What else am I missing?

New updates on this issue:

I tried to set up this on buildout.cfg, according to the WebDAV guide on https://docs.plone.org/develop/plone/serving/webdav.html:

[instance]
[...]
wsgi = on
webdav-address = 1980
zope-conf-additional =
   <webdav-source-server>
   address localhost:1980
   force-connection-close off
   </webdav-source-server>

Then I added webdav to my eggs on the [buildout] section:

[buildout]
[...]
eggs =
[...]
    webdav

Still no luck with Buildout. This is what I get:

The following part definition lists the versions picked:
[versions]
psycopg2-binary = 2.8.6
webdav = 1.1.7
instance: Error: unknown type name: 'webdav-source-server'
(line 36 in file:///opt/plone/plone522/zinstance/parts/instance/etc/zope.conf)
For help, use /opt/plone/plone522/zinstance/bin/instance -h

New updates on this issue:

The wsgi-ini-template option simply will not work. Every time I put it, Buildout fails. I tried putting the following option under the [instance] section and still no luck:

wsgi-options =
   webdav-address 9080

At this point I'm going to have to call it quits and resort to using Plone as a headless CMS and migrate to an Apache server that connects to my Plone server because I just can't upload my content no matter what.

I recently restored webdav support on Python3: https://github.com/plone/plone.dexterity/pull/142
I have just tested uploading a file with plone.dexterity master and it works.

Let me know if that works and if it does not please let me know!

1 Like

For plain Zope this is working

Can all the setting be set in buildout.cfg ?

Only through a custom wsgi.ini template

So (in theory) I would need to edit wsgi.ini after every bin/buildout ?

I normally use webdav over the regular http port

How does that work? Do you have an example (config)
I just did a quick test with a site behind Apache, but on access from Cyberduck on OS X (not tried with anything else) I got the following error on connection (see below).

I got the same error when accessing server directly with a custom port ( myserver:9890/Plone ) but I can actually see the site in the browser under both ports (http://myserver:8080/Plone and http://myserver:9890/Plone )

  Traceback (most recent call last):
	File "/home/myname/instance8090/buildout-cache/eggs/waitress-1.4.3-py2.7.egg/waitress/channel.py", line 349, in service
	  task.service()
	File "/home/myname/instance8090/buildout-cache/eggs/waitress-1.4.3-py2.7.egg/waitress/task.py", line 169, in service
	  self.execute()
	File "/home/myname/instance8090/buildout-cache/eggs/waitress-1.4.3-py2.7.egg/waitress/task.py", line 439, in execute
	  app_iter = self.channel.server.application(environ, start_response)
	File "/home/myname/instance8090/buildout-cache/eggs/Paste-3.1.1-py2.7.egg/paste/translogger.py", line 69, in __call__
	  return self.application(environ, replacement_start_response)
	File "/home/myname/instance8090/buildout-cache/eggs/Zope-4.1.3-py2.7.egg/ZPublisher/httpexceptions.py", line 30, in __call__
	  return self.application(environ, start_response)
	File "/home/myname/instance8090/buildout-cache/eggs/Zope-4.1.3-py2.7.egg/ZPublisher/WSGIPublisher.py", line 357, in publish_module
	  start_response(status, headers)
	File "/home/myname/instance8090/buildout-cache/eggs/Paste-3.1.1-py2.7.egg/paste/translogger.py", line 68, in replacement_start_response
	  return start_response(status, headers)
	File "/home/myname/instance8090/buildout-cache/eggs/waitress-1.4.3-py2.7.egg/waitress/task.py", line 430, in start_response
	  "a WSGI application (see PEP 3333)" % k
  AssertionError: Connection is a "hop-by-hop" header; it cannot be used by a WSGI application (see PEP 3333)

For writing operations too?

Yes, try:

libreoffice https://demo-latest-py3.plone.org/en/attachment-eleven-pages-1.odt

Do you run this with Apache, Nginx ? in front ?

Do you have a config you can share, I can't find any info about this online (in fact I have not heard about "hop-by-hop" header before

I do not know how that site is published, but it works even connecting to 8080 locally.
Bear in mind that you need Plone 5.2.3 (i.e. something that contains the latest plone.dexterity, see my comment of the 9th of October).

But I get the error even trying to edit anything (on authentication) so I assume Dexterity version does not matter here (?)

Update: In Plone 5.2.2 (at least for my setup), it looks like the working syntax for defining the ports are now (http and dav) :

fast-listen = 0.0.0.0:8090 0.0.0.0:9890

It also turns out that the 'hop hop headers problem' is not affecting 5.2.2 default setup

Update: In Plone 5.2.2 (at least for my setup), it looks like the working syntax for defining the ports are now (http and dav) :

fast-listen = 0.0.0.0:8090 0.0.0.0:9890

It also turns out that the 'hop hop headers problem' is not affecting 5.2.2 default setup.

AS a bonus, I can now mount a site (as a disc) in OS X directly (which I have never managed before). I have only managed to mount it like this by bypassing Apache ( http://myZope/Plone:9890 )