Skip to content

Mediaserver WebDAV-CGI not working. #2034

@JedMeister

Description

@JedMeister

The issue is a 500 "Internal Server Error". A quick look at the Apache error log shows these 2 lines which seem to be related to the issue:

Wide character in subroutine entry at /var/www/webdavcgi/lib/perl/WebInterface.pm line 379.
[<timestamp, etc>] End of script output before headers: smbwrapper, referer: http://xxx.xxx.xxx.xxx/

I've had a quick investigation and couldn't see the issue. There were a few things that are worth mentioning:

  • WebDAV-CGI install comes from common - samba-dav overlay & conf
  • upstream repo is here: https://github.com/DanRohde/webdavcgi
  • I'm 99% sure that it worked fine in the previous v18.x release(s) - but I haven't confirmed (I'd be very surprised if it didn't)
  • neither the WebDAV-CGI upstream code nor the relevant common code have been touched since the last release (actually neither have changed for some time) - so probably either a side effect of something else we've changed in common, or perhaps a regression in a Debian package update?
  • the conf script does note a commit id but it doesn't actually force use of that. It just gives a warning if it doesn't match - which it doesn't. Considering the age of the last commit to WebDAV-CGI upstream though I'm pretty sure that we were using that same commit in the previous v18.x builds
  • the upstream docs have a troubleshooting section
  • also here is a stackoverflow post that has lots of ideas on things to check/try.

Some other unrelated things that are worth having a look at once the above is resolved:

  • We might be able to revert to using the Debian libfilesys-smbclient-perl package (or at least the Filesys::SmbClient perl package from cpan), rather than needing to build it from source? That would make the build much quicker. The context to me thinking that is:
    • the last upstream change was to lib/perl/Backend/SMB/Driver.pm with the message "fixed hopeully problems with davfs2 driver"
    • the install docs explicitly note libfilesys-smbclient-perl (Filesys::SmbClient) as a dependency when installing on Debian.
    • OTOH it looks like the docs haven't been updated for a while, so perhaps not?!
  • Move the conf file (in the overlay) to /etc - as per the install instructions. Will also require updating the overlay Apache conf to point to the new conf location (currently in /var/www/wabdavcgi)
  • Consider whether the "basic" auth we're currently using is the best choice, or whether we should move to the built in "session" based auth? Seems like there are some tradeoffs, but might be a better option? See docs here: https://danrohde.github.io/webdavcgi/session.html also there is a relevant note re security: https://danrohde.github.io/webdavcgi/doc.html#security
  • Update the default config we ship to:
    • explicitly include the "maximum post size" config noted in the fileserver/webdavcgi website docs.
    • put a comment at the top noting the location of the "complete" config file, i.e. /var/www/webdavcgi/etc/webdav.conf.complete
    • update the $MIMEFILE line to use the OS /etc/mime.types file (as per install instructions)

There's probably other stuff too, but fixing the actual bug is priority. Any things noted here that we don't get to this time, can be moved to a new feature request issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions