Description
Expected behaviour
When some objects from GoogleDrive cannot be synced then the sync process should just ignore them, not abort.
Actual behaviour
Only some files/folders are synced. The failure happens with files located at the root folder of GoogleDrive, so I cannot even sync one certain folder because the error occurs before sync gets there.
Interesting is that when client gives error about unsyncable things (Google Maps files, and conflicting names of folders and files) then it says it downloaded that one certain folder which I'm interested in, but I don't see it in my local disk.
Steps to reproduce
- Add GoogleDrive external storage.
- Configure GoogleDrive folder in client. You can also specify certain sub-folder only, it doesn't actually matter.
Server configuration
Operating system: FreeBSD
Web server: Apache 2.4
Database: MariaDB 10.0
PHP version: 5.6
ownCloud version: 9.0
Storage backend: normal directory
Client configuration
Client version: 2.1.1
Operating system: OpenSUSE 42.1
OS language: English
Installation path of client: /usr/bin/owncloud
Logs
Please use Gist (https://gist.github.com/) or a similar code paster for longer
logs.
Output of owncloud --logfile -
About a failing file in root:
3-16 09:28:47:694 9561 OCC::Folder::slotSyncStarted: #### Propagation start #################################################### >>
03-16 09:28:47:694 9561 OCC::ownCloudGui::slotSyncStateChange: Sync state changed for folder "http://oc.kodu/remote.php/webdav/GoogleDrive" : "Sync Running"
03-16 09:28:47:694 9561 OCC::PropagateDownloadFileQNAM::start: virtual void OCC::PropagateDownloadFileQNAM::start() "My Saved Places." 0
03-16 09:28:47:696 9561 OCC::SyncJournalDb::setDownloadInfo: "INSERT OR REPLACE INTO downloadinfo (path, tmpfile, etag, errorcount) VALUES ( ?1 , ?2, ?3, ?4 )" "My Saved Places." ".My Saved Places..~1d5541ff" "56e8fb1dac33f" 0
03-16 09:28:47:697 9561 OCC::SyncJournalDb::commitInternal: void OCC::SyncJournalDb::commitInternal(const QString&, bool) Transaction commit "download file start" and starting new transaction
03-16 09:28:47:700 9561 unknown: QObject::connect: Cannot connect (null)::stateChanged(QNetworkSession::State) to QNetworkReplyHttpImpl::_q_networkSessionStateChanged(QNetworkSession::State)
03-16 09:28:47:700 9561 OCC::GETFileJob::start: virtual void OCC::GETFileJob::start() OCC::BandwidthManager(0x3893b38) false false
03-16 09:28:47:700 9561 OCC::AbstractNetworkJob::start: !!! OCC::GETFileJob created for "http://oc.kodu/" + "/GoogleDrive/My Saved Places." ""
...
03-16 09:28:50:766 9561 OCC::AbstractNetworkJob::slotFinished: void OCC::AbstractNetworkJob::slotFinished() QNetworkReply::NetworkError(ServiceUnavailableError) "Error downloading http://oc.kodu/remote.php/webdav/GoogleDrive/My Saved Places. - server replied: Service Unavailable" QVariant(int, 503)
03-16 09:28:50:767 9561 OCC::PropagateDownloadFileQNAM::slotGetFinished: void OCC::PropagateDownloadFileQNAM::slotGetFinished() QUrl("http://oc.kodu/remote.php/webdav/GoogleDrive/My Saved Places.") FINISHED WITH STATUS QNetworkReply::NetworkError(ServiceUnavailableError) "Error downloading http://oc.kodu/remote.php/webdav/GoogleDrive/My Saved Places. - server replied: Service Unavailable" 0 0 18446744073709551614 0 "" "221"
03-16 09:28:50:769 9561 OCC::SyncJournalDb::setDownloadInfo: "DELETE FROM downloadinfo WHERE path=?1" "My Saved Places."
03-16 09:28:50:769 9561 OCC::SyncEngine::slotItemCompleted: void OCC::SyncEngine::slotItemCompleted(const OCC::SyncFileItem&, const OCC::PropagatorJob&) "My Saved Places." INSTRUCTION_NEW 1 "Error downloading http://oc.kodu/remote.php/webdav/GoogleDrive/My Saved Places. - server replied: Service Unavailable"
03-16 09:28:50:772 9561 OCC::FolderWatcher::pathIsIgnored: * Ignoring file "/home/silver/Downloads/GoogleDrive/.My Saved Places..~1d5541ff"
03-16 09:28:50:772 9561 OCC::AbstractNetworkJob::slotFinished: void OCC::AbstractNetworkJob::slotFinished() QNetworkReply::NetworkError(OperationCanceledError) "Operation canceled" QVariant(Invalid)
About the folder of interest to me (and the only thing selected from the client):
03-16 09:29:30:012 0x38a5780 csync_walker: directory: owncloud://oc.kodu/remote.php/webdav/GoogleDrive/Siit [file_id=00259198occ40e4dc891]
03-16 09:29:30:012 0x38a5780 _csync_detect_update: file: Siit, instruction: INSTRUCTION_NEW <<=
03-16 09:29:30:012 0x38a5780 csync_ftw: URI without fuzz for owncloud://oc.kodu/remote.php/webdav/GoogleDrive/Siit is "Siit"
03-16 09:29:30:012 9603 OCC::DiscoveryJob::remote_vio_opendir_hook: OCC::DiscoveryJob(0x255b640) Siit Calling into main thread...
03-16 09:29:30:012 9561 OCC::AbstractNetworkJob::start: !!! OCC::LsColJob created for "http://oc.kodu/" + "/GoogleDrive/Siit" "OCC::DiscoverySingleDirectoryJob"
03-16 09:29:30:013 9561 unknown: QObject::connect: Cannot connect (null)::stateChanged(QNetworkSession::State) to QNetworkReplyHttpImpl::_q_networkSessionStateChanged(QNetworkSession::State)
03-16 09:29:32:234 9561 OCC::DiscoveryMainThread::singleDirectoryJobResultSlot: void OCC::DiscoveryMainThread::singleDirectoryJobResultSlot(const QList<OCC::FileStatPointer>&) Have 8 results for "/GoogleDrive/Siit"
03-16 09:29:32:234 9603 OCC::DiscoveryJob::remote_vio_opendir_hook: OCC::DiscoveryJob(0x255b640) Siit ...Returned from main thread
Web server error log:
(Nothing)
ownCloud log (data/owncloud.log):
Not sure it's relevant:
{"reqId":"6gmdY3MAdenMMr4mhEWs","remoteAddr":"10.0.254.102","app":"PHP","message":"fread() expects parameter 1 to be resource, boolean given at \/srv\/www\/owncloud\/lib\/private\/files\/storage\/wrapper\/encryption.php#812","level":3,"time":"2016-03-16T07:29:52+00:00"}
{"reqId":"6gmdY3MAdenMMr4mhEWs","remoteAddr":"10.0.254.102","app":"PHP","message":"fclose() expects parameter 1 to be resource, boolean given at \/srv\/www\/owncloud\/lib\/private\/files\/storage\/wrapper\/encryption.php#813","level":3,"time":"2016-03-16T07:29:52+00:00"}
{"reqId":"6gmdY3MAdenMMr4mhEWs","remoteAddr":"10.0.254.102","app":"webdav","message":"Exception: {\"Message\":\"HTTP\\\/1.1 503 Could not open file\",\"Exception\":\"Sabre\\\\DAV\\\\Exception\\\\ServiceUnavailable\",\"Code\":0,\"Trace\":\"#0 \\\/srv\\\/www\\\/owncloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/CorePlugin.php(83): OCA\\\\DAV\\\\Connector\\\\Sabre\\\\File->get()\\n#1 [internal function]: Sabre\\\\DAV\\\\CorePlugin->httpGet(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#2 \\\/srv\\\/www\\\/owncloud\\\/3rdparty\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n#3 \\\/srv\\\/www\\\/owncloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(459): Sabre\\\\Event\\\\EventEmitter->emit('method:GET', Array)\\n#4 \\\/srv\\\/www\\\/owncloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(248): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#5 \\\/srv\\\/www\\\/owncloud\\\/apps\\\/dav\\\/appinfo\\\/v1\\\/webdav.php(55): Sabre\\\\DAV\\\\Server->exec()\\n#6 \\\/srv\\\/www\\\/owncloud\\\/remote.php(138): require_once('\\\/srv\\\/www\\\/ownclo...')\\n#7 {main}\",\"File\":\"\\\/srv\\\/www\\\/owncloud\\\/apps\\\/dav\\\/lib\\\/connector\\\/sabre\\\/file.php\",\"Line\":306,\"User\":\"silver\"}","level":4,"time":"2016-03-16T07:29:52+00:00"}
Activity
guruz commentedon Mar 16, 2016
A directory returning 503 would have been ignored, but files not.
Can you open this in the core bugtracker? They should take care if there is something which really breaks usage of GoogleDrive.
Workaround: Put unsyncable filenames in the ignore/exclude file.
atroxix commentedon Mar 16, 2016
I added "My Saved Places" to exclude list, but it's still processed and reported.
atroxix commentedon Mar 17, 2016
How about this exclude list not taking effect in this case? I believe this is still purely a client issue?
guruz commentedon Mar 17, 2016
Do you have a log snippet for this? :)
FYI @ogoffart
atroxix commentedon Mar 17, 2016
Yes I do, but wouldn't like to post it publicly :)
Where do I send it?
guruz commentedon Mar 17, 2016
try My username here @owncloud.com :)
How do those lines in the exclude look like?
atroxix commentedon Mar 17, 2016
Sent logfile.
$ cat ~/.local/share/data/ownCloud/sync-exclude.lst
[-]GoogleDrive sync fails due to unsyncable files[/-][+]GoogleDrive sync fails due to unsyncable "My Saved Places." file[/+]guruz commentedon Mar 21, 2016
Note that the file name is
My Saved Places.with a dot at the end. :)Could you give us the curl PROPFIND output of that filename so we see what ownCloud server returns as info for it?
https://stackoverflow.com/questions/26429904/list-files-folders-in-owncloud-with-php-curl/26676902#26676902
@LukasReschke @PVince81 Maybe google.php should ignore this weird
My Saved Places.file?Exclude: Weird GoogleDrive "My Saved Places." file #4573
guruz commentedon Mar 21, 2016
Can't say anything to the latter one, you might need to rename them on drive.google.com
atroxix commentedon Mar 22, 2016
If I look at my GoogleDrive then there is no dot at the end, but in OwnCloud interface there is indeed.
27 remaining items
PVince81 commentedon Mar 23, 2016
@atroxix I suspect that when creating/editing a new Google Docs file, GDrive doesn't update the folder's parent mtime, but regular files do. (just guessing, needs to be verified).
The update detection code relies on mtimes delivered by GDrive to find out whether there are new/modified files to rescan.
atroxix commentedon Mar 23, 2016
Well, those 2 files are in the same folder. The only difference i see is that the problematic filename contains spaces.
guruz commentedon Apr 13, 2016
@PVince81 do you have a recommendation for the client now? Just ignore files with negative content length?
PVince81 commentedon Apr 18, 2016
@guruz I'd say have the client still download the file and take the actual received size / the size returned by Content-Length.
guruz commentedon Apr 18, 2016
I can confirm what @ogoffart wrote on IRC: We already "ignore" the content length (it errornously gets treated as an unsigned number, e.g. for -2 I get
size=18446744073709551614in discovery phase) and use the correct length at the download job. So this is OK for a Google Doc file = .odt file.However I also get several Server errors for other files, e.g. a PDF file. But some PDF files work.. will dig into this.
PVince81 commentedon Apr 18, 2016
@guruz is that PDF file on GDrive ? If yes, dark magic ?!
guruz commentedon Apr 19, 2016
Closing the issue here..
If there is more to be done, please check the server issue tracker..
https://github.com/owncloud/core