Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

propfind on webdav root results in a http 500 internal error when fc share is unavailable #15430

Closed
jvillafanez opened this issue Apr 7, 2015 · 19 comments · Fixed by #15521 or #15530
Closed

Comments

@jvillafanez
Copy link
Member

Steps to reproduce

  1. Do a PROPFIND on the webDAV root - something like "http://server/owncloud/remote.php/webdav/"
    Also checked with curl -u <username>:<password> -X PROPFIND -H "Content-Type: text/xml" -d "<?xml version='1.0' encoding='utf-8' ?><D:propfind xmlns:D='DAV:'><D:allprop/></D:propfind>" <owncloud-server-url>/remote.php/webdav/

Expected behaviour

Valid webdav response

Actual behaviour

Internal error

Server configuration

Operating system: ubuntu 14.04

Web server: apache 2.4.7

Database: mysql

PHP version: 5.5.4

ownCloud version: OC 8.0.3RC1

Updated from an older ownCloud or fresh install: fresh install

Logs

ownCloud log (data/owncloud.log)

{"reqId":"06cce899959355c34f6a11854494fde7","remoteAddr":"10.40.30.21","app":"remote","message":"The passed data is not valid XML","level":4,"time":"2015-04-07T09:02:42+00:00"}
{"reqId":"dfa929d07bd6993351e2fc8230411a16","remoteAddr":"10.40.10.254","app":"remote","message":"The passed data is not valid XML","level":4,"time":"2015-04-07T09:10:10+00:00"}

PROPFIND response

<!DOCTYPE html>
<!--[if lt IE 7]><html class="ng-csp ie ie6 lte9 lte8 lte7" data-placeholder-focus="false" lang="en"><![endif]-->
<!--[if IE 7]><html class="ng-csp ie ie7 lte9 lte8 lte7" data-placeholder-focus="false" lang="en" ><![endif]-->
<!--[if IE 8]><html class="ng-csp ie ie8 lte9 lte8" data-placeholder-focus="false" lang="en" ><![endif]-->
<!--[if IE 9]><html class="ng-csp ie ie9 lte9" data-placeholder-focus="false" lang="en" ><![endif]-->
<!--[if gt IE 9]><html class="ng-csp ie" data-placeholder-focus="false" lang="en" ><![endif]-->
<!--[if !IE]><!--><html class="ng-csp" data-placeholder-focus="false" lang="en" ><!--<![endif]-->

    <head data-requesttoken="">
        <title>
        ownCloud        </title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
        <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0">
        <meta name="apple-itunes-app" content="app-id=543672169">
        <link rel="shortcut icon" type="image/png" href="/core/img/favicon.png" />
        <link rel="apple-touch-icon-precomposed" href="/core/img/favicon-touch.png" />
                    <link rel="stylesheet" href="/core/css/styles.css?v=80fedb79ee9a6aa51604bbf8ccf137e8" type="text/css" media="screen" />
                    <link rel="stylesheet" href="/core/css/header.css?v=80fedb79ee9a6aa51604bbf8ccf137e8" type="text/css" media="screen" />
                    <link rel="stylesheet" href="/core/css/mobile.css?v=80fedb79ee9a6aa51604bbf8ccf137e8" type="text/css" media="screen" />
                    <link rel="stylesheet" href="/core/css/icons.css?v=80fedb79ee9a6aa51604bbf8ccf137e8" type="text/css" media="screen" />
                    <link rel="stylesheet" href="/core/css/fonts.css?v=80fedb79ee9a6aa51604bbf8ccf137e8" type="text/css" media="screen" />
                    <link rel="stylesheet" href="/core/css/apps.css?v=80fedb79ee9a6aa51604bbf8ccf137e8" type="text/css" media="screen" />
                    <link rel="stylesheet" href="/core/css/fixes.css?v=80fedb79ee9a6aa51604bbf8ccf137e8" type="text/css" media="screen" />
                    <link rel="stylesheet" href="/core/css/multiselect.css?v=80fedb79ee9a6aa51604bbf8ccf137e8" type="text/css" media="screen" />
                    <link rel="stylesheet" href="/core/vendor/jquery-ui/themes/base/jquery-ui.css?v=80fedb79ee9a6aa51604bbf8ccf137e8" type="text/css" media="screen" />
                    <link rel="stylesheet" href="/core/css/jquery-ui-fixes.css?v=80fedb79ee9a6aa51604bbf8ccf137e8" type="text/css" media="screen" />
                    <link rel="stylesheet" href="/core/css/jquery-tipsy.css?v=80fedb79ee9a6aa51604bbf8ccf137e8" type="text/css" media="screen" />
                    <link rel="stylesheet" href="/core/css/jquery.ocdialog.css?v=80fedb79ee9a6aa51604bbf8ccf137e8" type="text/css" media="screen" />
                    <link rel="stylesheet" href="/core/css/share.css?v=80fedb79ee9a6aa51604bbf8ccf137e8" type="text/css" media="screen" />
                    <link rel="stylesheet" href="/apps/files_versions/css/versions.css?v=80fedb79ee9a6aa51604bbf8ccf137e8" type="text/css" media="screen" />
                    <link rel="stylesheet" href="/core/css/styles.css?v=80fedb79ee9a6aa51604bbf8ccf137e8" type="text/css" media="screen" />
                    <link rel="stylesheet" href="/core/css/header.css?v=80fedb79ee9a6aa51604bbf8ccf137e8" type="text/css" media="screen" />
                            <script type="text/javascript" src="/core/vendor/jquery/jquery.min.js?v=80fedb79ee9a6aa51604bbf8ccf137e8"></script>
                    <script type="text/javascript" src="/core/vendor/jquery/jquery-migrate.min.js?v=80fedb79ee9a6aa51604bbf8ccf137e8"></script>
                    <script type="text/javascript" src="/core/vendor/jquery-ui/ui/jquery-ui.custom.js?v=80fedb79ee9a6aa51604bbf8ccf137e8"></script>
                    <script type="text/javascript" src="/core/vendor/underscore/underscore.js?v=80fedb79ee9a6aa51604bbf8ccf137e8"></script>
                    <script type="text/javascript" src="/core/vendor/moment/min/moment-with-locales.js?v=80fedb79ee9a6aa51604bbf8ccf137e8"></script>
                    <script type="text/javascript" src="/core/vendor/handlebars/handlebars.js?v=80fedb79ee9a6aa51604bbf8ccf137e8"></script>
                    <script type="text/javascript" src="/core/js/placeholders.js?v=80fedb79ee9a6aa51604bbf8ccf137e8"></script>
                    <script type="text/javascript" src="/core/js/jquery-tipsy.js?v=80fedb79ee9a6aa51604bbf8ccf137e8"></script>
                    <script type="text/javascript" src="/core/js/compatibility.js?v=80fedb79ee9a6aa51604bbf8ccf137e8"></script>
                    <script type="text/javascript" src="/core/js/jquery.ocdialog.js?v=80fedb79ee9a6aa51604bbf8ccf137e8"></script>
                    <script type="text/javascript" src="/core/js/oc-dialogs.js?v=80fedb79ee9a6aa51604bbf8ccf137e8"></script>
                    <script type="text/javascript" src="/core/js/js.js?v=80fedb79ee9a6aa51604bbf8ccf137e8"></script>
                    <script type="text/javascript" src="/core/js/l10n.js?v=80fedb79ee9a6aa51604bbf8ccf137e8"></script>
                    <script type="text/javascript" src="/core/js/octemplate.js?v=80fedb79ee9a6aa51604bbf8ccf137e8"></script>
                    <script type="text/javascript" src="/core/js/eventsource.js?v=80fedb79ee9a6aa51604bbf8ccf137e8"></script>
                    <script type="text/javascript" src="/core/js/config.js?v=80fedb79ee9a6aa51604bbf8ccf137e8"></script>
                    <script type="text/javascript" src="/core/search/js/search.js?v=80fedb79ee9a6aa51604bbf8ccf137e8"></script>
                    <script type="text/javascript" src="/core/js/oc-requesttoken.js?v=80fedb79ee9a6aa51604bbf8ccf137e8"></script>
                    <script type="text/javascript" src="/core/js/apps.js?v=80fedb79ee9a6aa51604bbf8ccf137e8"></script>
                    <script type="text/javascript" src="/core/vendor/snapjs/dist/latest/snap.js?v=80fedb79ee9a6aa51604bbf8ccf137e8"></script>
                    <script type="text/javascript" src="/core/js/placeholder.js?v=80fedb79ee9a6aa51604bbf8ccf137e8"></script>
                    <script type="text/javascript" src="/core/vendor/blueimp-md5/js/md5.js?v=80fedb79ee9a6aa51604bbf8ccf137e8"></script>
                    <script type="text/javascript" src="/core/js/jquery.avatar.js?v=80fedb79ee9a6aa51604bbf8ccf137e8"></script>
                    <script type="text/javascript" src="/core/js/avatar.js?v=80fedb79ee9a6aa51604bbf8ccf137e8"></script>
                    <script type="text/javascript" src="/core/js/backgroundjobs.js?v=80fedb79ee9a6aa51604bbf8ccf137e8"></script>
                    <script type="text/javascript" src="/core/js/share.js?v=80fedb79ee9a6aa51604bbf8ccf137e8"></script>
                    <script type="text/javascript" src="/apps/files_sharing/js/share.js?v=80fedb79ee9a6aa51604bbf8ccf137e8"></script>
                    <script type="text/javascript" src="/apps/files_sharing/js/external.js?v=80fedb79ee9a6aa51604bbf8ccf137e8"></script>
                    <script type="text/javascript" src="/apps/files_versions/js/versions.js?v=80fedb79ee9a6aa51604bbf8ccf137e8"></script>
                    </head>
    <body id="body-login">
        <noscript><div id="nojavascript"><div>This application requires JavaScript for correct operation. Please <a href="http://enable-javascript.com/" target="_blank">enable JavaScript</a> and reload the page.</div></div></noscript>
        <div class="wrapper"><!-- for sticky footer -->
            <div class="v-align"><!-- vertically centred box -->
                                    <header>
                        <div id="header">
                            <div class="logo svg">
                                <h1 class="hidden-visually">
                                    ownCloud                                </h1>
                            </div>
                            <div id="logo-claim" style="display:none;"></div>
                        </div>
                    </header>
                                <span class="error error-wide">
    <h2><strong>Internal Server Error</strong></h2>
        <p>The server encountered an internal error and was unable to complete your request.</p>
        <p>Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.</p>
        <p>More details can be found in the server log.</p>
    <br />

    <h2><strong>Technical details</strong></h2>
    <ul>
        <li>Remote Address: 10.40.30.21</li>
        <li>Request ID: 06cce899959355c34f6a11854494fde7</li>
                    <li>Code: 0</li>
            <li>Message: The passed data is not valid XML</li>
            <li>File: /home/jvillafanez/src/owncloud/owncloud2/3rdparty/sabre/dav/lib/Sabre/DAV/Client.php</li>
            <li>Line: 542</li>
            </ul>

            <br />
        <h2><strong>Trace</strong></h2>
        <pre>#0 /home/jvillafanez/src/owncloud/owncloud2/3rdparty/sabre/dav/lib/Sabre/DAV/Client.php(181): Sabre\DAV\Client-&gt;parseMultiStatus(&#039;&lt;!DOCTYPE html&gt;...&#039;)
#1 /home/jvillafanez/src/owncloud/owncloud2/lib/private/files/storage/dav.php(550): Sabre\DAV\Client-&gt;propFind(&#039;&#039;, Array)
#2 /home/jvillafanez/src/owncloud/owncloud2/apps/files_sharing/lib/external/storage.php(144): OC\Files\Storage\DAV-&gt;hasUpdated(&#039;&#039;, 1424774464)
#3 /home/jvillafanez/src/owncloud/owncloud2/lib/private/files/storage/wrapper/wrapper.php(357): OCA\Files_Sharing\External\Storage-&gt;hasUpdated(&#039;&#039;, 1424774464)
#4 /home/jvillafanez/src/owncloud/owncloud2/lib/private/files/cache/watcher.php(67): OC\Files\Storage\Wrapper\Wrapper-&gt;hasUpdated(&#039;&#039;, 1424774464)
#5 /home/jvillafanez/src/owncloud/owncloud2/lib/private/files/view.php(976): OC\Files\Cache\Watcher-&gt;checkUpdate(&#039;&#039;, Array)
#6 /home/jvillafanez/src/owncloud/owncloud2/lib/private/files/filesystem.php(793): OC\Files\View-&gt;getFileInfo(&#039;/pics&#039;, false)
#7 /home/jvillafanez/src/owncloud/owncloud2/lib/private/helper.php(923): OC\Files\Filesystem::getFileInfo(&#039;/pics&#039;, false)
#8 /home/jvillafanez/src/owncloud/owncloud2/lib/private/connector/sabre/directory.php(235): OC_Helper::getStorageInfo(&#039;/pics&#039;)
#9 /home/jvillafanez/src/owncloud/owncloud2/lib/private/connector/sabre/server.php(247): OC_Connector_Sabre_Directory-&gt;getQuotaInfo()
#10 /home/jvillafanez/src/owncloud/owncloud2/lib/private/connector/sabre/server.php(104): OC_Connector_Sabre_Server-&gt;getPropertiesForPath(&#039;&#039;, Array, 1)
#11 [internal function]: OC_Connector_Sabre_Server-&gt;httpPropfind(&#039;&#039;)
#12 /home/jvillafanez/src/owncloud/owncloud2/3rdparty/sabre/dav/lib/Sabre/DAV/Server.php(474): call_user_func(Array, &#039;&#039;)
#13 /home/jvillafanez/src/owncloud/owncloud2/3rdparty/sabre/dav/lib/Sabre/DAV/Server.php(214): Sabre\DAV\Server-&gt;invokeMethod(&#039;PROPFIND&#039;, &#039;&#039;)
#14 /home/jvillafanez/src/owncloud/owncloud2/apps/files/appinfo/remote.php(61): Sabre\DAV\Server-&gt;exec()
#15 /home/jvillafanez/src/owncloud/owncloud2/remote.php(54): require_once(&#039;/home/jvillafan...&#039;)
#16 {main}</pre>
    </span>
                <div class="push"></div><!-- for sticky footer -->
            </div>
        </div>

        <footer>
            <p class="info">
                <a href="https://owncloud.org" target="_blank">ownCloud</a> – web services under your control         </p>
        </footer>
    </body>
</html>

Notes

This bug is preventing the correct functions of mobile apps, and probably the desktop apps

@nickvergessen
Copy link
Contributor

That's a known issue. There is an idea to make a second entry point to check the etag of the root folder. @icewind1991 made a quick PoC for that IIRC.

Ignore above, I think that was a different topic

@davivel
Copy link

davivel commented Apr 7, 2015

If it's a known issue, is it in any repository registered as an issue?

EDIT: this is a showstopper for mobile apps

@jvillafanez
Copy link
Member Author

Adding more information:

screenshot from 2015-04-07 12 49 16

"pics" folder is shared with another server. That server is down. I've tried to enter the folder, with the "unknow error" shown in the image.

@DeepDiver1975
Copy link
Member

"pics" folder is shared with another server. That server is down. I've tried to enter the folder, with the "unknow error" shown in the image.

AHA - this is the root cause!

@DeepDiver1975
Copy link
Member

This also explains the error message: "message":"The passed data is not valid XML"

@SergioBertolinSG
Copy link
Contributor

Tried with an unmounted external storage folder (S3), no problems there.

@DeepDiver1975
Copy link
Member

Tried with an unmounted external storage folder (S3), no problems there.

sure - this is specific to s2s

@nickvergessen nickvergessen changed the title propfind on webdav root results in a http 500 internal error propfind on webdav root results in a http 500 internal error when fc share is unavailable Apr 7, 2015
@PVince81
Copy link
Contributor

PVince81 commented Apr 7, 2015

I thought this was fixed. If you do a PROPFIND on "remote.php/webdav", if any of the subfolders is not available, you should still get a correct response.

@PVince81
Copy link
Contributor

PVince81 commented Apr 7, 2015

@jvillafanez in what way is the remote share unavailable ? How did you setup the target server ? Is it in maintenance mode, or did you delete ownCloud ? This is important because it can affect the response returned by the target server.

@PVince81
Copy link
Contributor

PVince81 commented Apr 7, 2015

Normally the exception should be "StorageNotAvailableException" but for some reason the local code didn't properly detect the unavailability of the remote. We should probably catch any XML parse error too and interpret them as "storage not available".

Still, I'd like to know your target ownCloud's setup (and in what way did you make the target folder appear unavailable)

@PVince81 PVince81 self-assigned this Apr 8, 2015
@PVince81 PVince81 added this to the 8.0.3-current-maintenance milestone Apr 8, 2015
@PVince81
Copy link
Contributor

PVince81 commented Apr 9, 2015

Am able to reproduce this on master too against an ownCloud EE with expired license.
This is the WebDAV response:

  % curl -X PROPFIND http://root:admin@localhost/owncloud/remote.php/webdav/
<?xml version="1.0" encoding="utf-8"?>
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
  <s:exception>GuzzleHttp\Exception\ServerException</s:exception>
  <s:message>Server error response [url] http://localhost/owncloud-enterprise/index.php/apps/files_sharing/shareinfo?t=W405QAVLOQdMUvq [status code] 503 [reason phrase] Service Unavailable</s:message>
</d:error>

This is very wrong. It should return the list instead.

@PVince81
Copy link
Contributor

PVince81 commented Apr 9, 2015

Fix for master is here: #15521

I'll prepare one for stable8 it too, it will probably be different because we didn't use Guzzle there.

@PVince81
Copy link
Contributor

PVince81 commented Apr 9, 2015

@jvillafanez how did you mount it ? Did you use server to server share or did you use "add to ownCloud" from a public link ?

I cannot reproduce the issue on stable8 / 8.0.3 RC1.
The PROPFIND works correctly.

I suspect that in your case it's a slightly different code path, maybe from when the share wasn't scanned yet or something.

@PVince81
Copy link
Contributor

PVince81 commented Apr 9, 2015

Still cannot reproduce the reported issue on stable8.
I hooked the debugger and see that it goes in the same code path, doing the PROPFIND to the backend server which itself returns an "Internal Server Error". Then this error gets converted to StorageNotAvailableException which is properly ignored by the frontend PROPFIND. I then see the correct PROPFIND response with the folder contents (using curl: curl -X PROPFIND http://root:admin@localhost/owncloud/remote.php/webdav)

Maybe the response of your backend server is different than mine. What version were you using there ?

@jvillafanez
Copy link
Member Author

@PVince81 I added it in OC 8.0.3RC1 using the "add to ownCloud" from public link. The source file is in OC 7.0.5.

Maybe the 7.0.5 server returns something wrong.

@PVince81
Copy link
Contributor

Looks like it, I was able to reproduce it when connecting to a OC 7 EE server with invalid license.

@PVince81
Copy link
Contributor

I have a fix for master: #15530

I'll try and backport it to stable8 but it will need more changes as we neither had Guzzle nor Sabre 2.1 exceptions.

@PVince81 PVince81 reopened this Apr 10, 2015
@PVince81
Copy link
Contributor

stable8 fix here: #15533

@MorrisJobke MorrisJobke modified the milestones: 8.0.4-next-maintenance, 8.0.3-current-maintenance Apr 10, 2015
@MorrisJobke
Copy link
Contributor

WIll be closed once it is in stable8

@MorrisJobke MorrisJobke reopened this Apr 10, 2015
@lock lock bot locked as resolved and limited conversation to collaborators Aug 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.