nextcloud / sharepoint

💾 Nextcloud SharePoint Backend for External storages
https://apps.nextcloud.com/apps/sharepoint
GNU Affero General Public License v3.0
25 stars 18 forks source link

Can't mount SharePoint. #3

Closed dronmaxman closed 4 years ago

dronmaxman commented 7 years ago

Can't mount SharePoint. SharePoint public name https://info.mydomain.com DNS SharePoint server name vs-kv-web-sp01.mydomain.com

Configuration personal - nextcloud 2017-05-24 11-59-33

Error: screen shot 2017-05-24 at 11 56 10 am

blizzz commented 7 years ago

can you get the trace stack for "Call to a member function getTimestamp() on null"? Click on the arrow next to it (or use the issue template app https://apps.nextcloud.com/apps/issuetemplate).

Does it work when you provide the public name instead as host?

blizzz commented 7 years ago

Any update @dronmaxman ?

pierrejochem commented 7 years ago
Error: Call to a member function getTimestamp() on null

/usr/share/webapps/nextcloud/lib/private/Files/Storage/Common.php - line 179: OCA\SharePoint\Storage\Storage->stat('')
/usr/share/webapps/nextcloud/lib/private/Files/Storage/Common.php - line 665: OC\Files\Storage\Common->filemtime('')
/usr/share/webapps/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php - line 577: OC\Files\Storage\Common->getMetaData('')
/usr/share/webapps/nextcloud/lib/private/Files/Storage/Wrapper/PermissionsMask.php - line 143: OC\Files\Storage\Wrapper\Wrapper->getMetaData('')
/usr/share/webapps/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php - line 577: OC\Files\Storage\Wrapper\PermissionsMask->getMetaData('')
/usr/share/webapps/nextcloud/lib/private/Files/Storage/Wrapper/Availability.php - line 460: OC\Files\Storage\Wrapper\Wrapper->getMetaData('')
/usr/share/webapps/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php - line 577: OC\Files\Storage\Wrapper\Availability->getMetaData('')
/usr/share/webapps/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php - line 577: OC\Files\Storage\Wrapper\Wrapper->getMetaData('')
/usr/share/webapps/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php - line 577: OC\Files\Storage\Wrapper\Wrapper->getMetaData('')
/usr/share/webapps/nextcloud/lib/private/Files/Cache/Scanner.php - line 113: OC\Files\Storage\Wrapper\Wrapper->getMetaData('')
/usr/share/webapps/nextcloud/lib/private/Files/Cache/Scanner.php - line 152: OC\Files\Cache\Scanner->getData('')
/usr/share/webapps/nextcloud/lib/private/Files/View.php - line 1438: OC\Files\Cache\Scanner->scanFile('')
/usr/share/webapps/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php - line 256: OC\Files\View->getDirectoryContent('/')
/usr/share/webapps/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php - line 195: OCA\DAV\Connector\Sabre\Directory->getChildren()
/usr/share/webapps/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 896: Sabre\DAV\Tree->getChildren('')
/usr/share/webapps/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 977: Sabre\DAV\Server->generatePathNodes(Object(Sabre\DAV\PropFind), Array)
/usr/share/webapps/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 1665: Sabre\DAV\Server->getPropertiesIteratorForPath('', Array, 1)
/usr/share/webapps/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php - line 355: Sabre\DAV\Server->generateMultiStatus(Object(Generator), false)
[internal function] Sabre\DAV\CorePlugin->httpPropFind(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
/usr/share/webapps/nextcloud/3rdparty/sabre/event/lib/EventEmitterTrait.php - line 105: call_user_func_array(Array, Array)
/usr/share/webapps/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 479: Sabre\Event\EventEmitter->emit('method PROPFIND', Array)
/usr/share/webapps/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 254: Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
/usr/share/webapps/nextcloud/apps/dav/appinfo/v1/webdav.php - line 71: Sabre\DAV\Server->exec()
/usr/share/webapps/nextcloud/remote.php - line 162: require_once('/usr/share/weba...')
{main}
pierrejochem commented 7 years ago

@blizzz Which sharepoint versions are supported?

blizzz commented 7 years ago

I tested against 2016, SP 2013 is supposed to work (because the used lib supports it).

pierrejochem commented 7 years ago

How to enter the server correctly?

server name or ip address

or

http(s)://[servername or ip] ?

That is not really clear.

blizzz commented 7 years ago

@pierrejochem I have a fix for "Error: Call to a member function getTimestamp() on null" ready, but how common is it for SP to not return 'TimeLastModified' for an existing file?

pierrejochem commented 7 years ago

That is a good question. Is that not necessary for the client sync? I would test it, if you provide it to me.

blizzz commented 7 years ago

@pierrejochem that's how the error is triggered. If the file is not available an Exception is supposed to be thrown that we can deal with.

I expect you see the exception couple times, not just once? Then, could you paste following lines into Line 200 of lib/Storage/Storage.php?

if($mtime === null) {
    \OC::$server->getLogger()->critical('File object {file}', ['app' => 'sharepoint', 'file' => $file]);
    \OC::$server->getLogger()->critical('Size info {size}', ['app' => 'sharepoint', 'size' => $size]);
}

this would add some debug log.

SSpecken commented 6 years ago

When trying to use an Office 365 sharepoint as external storage I got the error, too:

Error: Call to a member function getTimestamp() on null

I inserted your code to Storage.php and got these additional entries: Error | sharepoint | Size info -2 and: Error | sharepoint | File object {"[object] (Office365\PHP\Client\SharePoint\Folder)":"*resourceType":null,"*context":{"[object] (Office365\PHP\Client\SharePoint\ClientContext)":{"Office365\PHP\Client\SharePoint\ClientContextsite":null,"Office365\PHP\Client\SharePoint\ClientContextweb":"[object] (Office365\PHP\Client\SharePoint\Web)","Office365\PHP\Client\SharePoint\ClientContextcontextWebInformation":null,"Office365\PHP\Client\Runtime\ClientRuntimeContextserviceRootUrl":"x.sharepoint.com/_api/","Office365\PHP\Client\Runtime\ClientRuntimeContextversion":"v1.0","Office365\PHP\Client\Runtime\ClientRuntimeContextauthContext":"[object] (Office365\PHP\Client\Runtime\Auth\NetworkCredentialContext)","Office365\PHP\Client\Runtime\ClientRuntimeContextpendingRequest":"[object] (Office365\PHP\Client\Runtime\ClientRequest)","Format":"[object] (Office365\PHP\Client\Runtime\OData\JsonLightFormat)"}},"*resourcePath":{"[object] (Office365\PHP\Client\Runtime\ResourcePathServiceOperation)":{"*methodParameters":[],"*methodName":"getfolderbyserverrelativeurl","*parent":"[object] (Office365\PHP\Client\Runtime\ResourcePathEntity)","*context":"[object] (Office365\PHP\Client\SharePoint\ClientContext)","ServerObjectIsNull":true}},"Office365\PHP\Client\Runtime\ClientObjectproperties":[],"Office365\PHP\Client\Runtime\ClientObjectchangedProperties":[],"*parentCollection":null,"EntityName":null}}

Is Office 365 Sharepoint supported?

blizzz commented 6 years ago

IIRC 365 does not support NTLM, which we use.

blizzz commented 4 years ago

SharePoint Online/365 support was added with the latest release today