<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
Hello,
<div><br>
</div>
<div>With owncloud6-beta3 I have a similar issue:</div>
<div><br>
</div>
<div># curl -X GET --user X:Y <a href="http://localhost/owncloud/ocs/v1.php/apps/files_sharing/api/v1/shares">
http://localhost/owncloud/ocs/v1.php/apps/files_sharing/api/v1/shares</a></div>
<div><br>
</div>
<div>no output</div>
<div><br>
</div>
<div># tail /var/log/owncloud.log</div>
<div>...</div>
<div>{"app":"PHP","message":"Call to a member function getRoot() on a non-object at \/var\/www\/html\/owncloud\/lib\/private\/files\/filesystem.php#413","level":3,"time":"2013-11-08T15:35:46+00:00"}</div>
<div><br>
</div>
<div>Best regards,</div>
<div><br>
</div>
<div>kuba</div>
<div><br>
</div>
<div>--</div>
<div><br>
<div>
<div>On Nov 6, 2013, at 8:28 PM, Victor Dubiniuk <<a href="mailto:dubiniuk@owncloud.com">dubiniuk@owncloud.com</a>></div>
<div> wrote:</div>
<br class="Apple-interchange-newline">
<blockquote type="cite">
<div bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Hi Vincent,<br>
<br>
this issue looks like similar to yours <a class="moz-txt-link-freetext" href="https://github.com/owncloud/core/issues/5729">
https://github.com/owncloud/core/issues/5729</a><br>
You can update it with your details.<br>
<br>
Victor<br>
<br>
On 11/06/2013 06:56 PM, Vincent H wrote:<br>
</div>
<blockquote cite="mid:SNT148-W3292F4C99EECD6E12B760CC4F00@phx.gbl" type="cite"><style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style>
<div dir="ltr">
<div>Hi,</div>
<div><br>
</div>
<div>Sending this to the mailinglist on advice of Rancor:</div>
<div><br>
</div>
<div>After trying to use the sharing api (via REST) in oc5 (<a class="moz-txt-link-freetext" href="http://forum.owncloud.org/viewtopic.php?f=23&t=17952">http://forum.owncloud.org/viewtopic.php?f=23&t=17952</a>), which doesn't work, I am now trying it in oc6
beta 2. I think it is still a little buggy and I guess it has something to do with the user session/credentials.</div>
<div><br>
</div>
<div>Environment:Local</div>
<div>Server:Windows 7 with WAMP</div>
<div>Database: Mysql 5.5.24</div>
<div>Client: Firefox (and others)</div>
<div>OC-Version: 6 beta2</div>
<div>PHP-Version: Apache/2.2.22 (Win64) PHP/5.4.3</div>
<div><br>
</div>
<div>I installed oc6 (beta 2) out of the box and created a share on a folder. After that, I tried the following scenarios:</div>
<div><br>
</div>
<div>1. Not logged in to oc6 via the browser (so no existing session)</div>
<div>Call REST GET url: <a class="moz-txt-link-freetext" href="http://localhost/owncloud/ocs/v1.php/apps/files_sharing/api/v1/shares">
http://localhost/owncloud/ocs/v1.php/apps/files_sharing/api/v1/shares</a> </div>
<div>Credentials are asked by the browser (http basic authentication), after filling them in (correctly), the request breaks with Fatal error: Call to a member function getRoot() on a non-object in \owncloud\lib\private\files\filesystem.php on line 407</div>
<div><br>
</div>
<div>2. Logged in normally to oc6 via the browser and open a new tab and op en the REST url again</div>
<div>Call REST GET url: <a class="moz-txt-link-freetext" href="http://localhost/owncloud/ocs/v1.php/apps/files_sharing/api/v1/shares">
http://localhost/owncloud/ocs/v1.php/apps/files_sharing/api/v1/shares</a> </div>
<div>This works, I get a nice XML message with all info about existing shares</div>
<div><br>
</div>
<div>3. Now refresh the page with the REST GET url at step 2.</div>
<div>Now the page breaks with Fatal error: Call to a member function getRoot() on a non-object in \owncloud\lib\private\files\filesystem.php on line 407</div>
<div><br>
</div>
<div>If the page with the normal login to oc6 is refreshed a redirect is done to the login screen. After a new login and refreshing the shares url, this works again exactly 1 time.</div>
<div><br>
</div>
<div>It look like the REST call does something with the user session or something.</div>
<div><br>
</div>
<div>My goal is to share a folder from Java code, running it from there (via restlet) always results in the same Fatal error.</div>
<div><br>
</div>
<div>ClientResource resource = new ClientResource(<a class="moz-txt-link-rfc2396E" href="http://localhost/owncloud/ocs/v1.php/apps/files_sharing/api/v1/shares">"http://localhost/owncloud/ocs/v1.php/apps/files_sharing/api/v1/shares"</a>);</div>
<div>// Send an authenticated request using the Basic authentication scheme.</div>
<div>resource.setChallengeResponse(ChallengeScheme.HTTP_BASIC, "admin", "welcome1");</div>
<div>// Send the request</div>
<div>resource.get();</div>
<div>Representation content = resource.get();</div>
<div>System.out.println(content.getText());</div>
<div><br>
</div>
<div>When trying all the above steps with a basic call: <a class="moz-txt-link-freetext" href="http://localhost/owncloud/ocs/v1.php/cloud/user">
http://localhost/owncloud/ocs/v1.php/cloud/user</a> (also requires a user session, thus a login) all works out fine, including the call from Java code.</div>
<div><br>
</div>
<div>Any ideas? Or maybe another approach to achieve this via Java code?</div>
<div><br>
</div>
<div>Kind regards,</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset> <br>
<pre wrap="">_______________________________________________
Owncloud mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Owncloud@kde.org">Owncloud@kde.org</a>
<a class="moz-txt-link-freetext" href="https://mail.kde.org/mailman/listinfo/owncloud">https://mail.kde.org/mailman/listinfo/owncloud</a>
</pre>
</blockquote>
<br>
</div>
_______________________________________________<br>
Owncloud mailing list<br>
<a href="mailto:Owncloud@kde.org">Owncloud@kde.org</a><br>
https://mail.kde.org/mailman/listinfo/owncloud<br>
</blockquote>
</div>
<br>
</div>
</body>
</html>