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

[External storage - Google Drive] Owncloud doesn't handle special files and fails sync #24253

Closed
lanato opened this issue Apr 25, 2016 · 13 comments

Comments

@lanato
Copy link
Contributor

lanato commented Apr 25, 2016

Steps to reproduce

  1. Connect Owncloud to a Google Drive containing a saved custom map (application/vnd.google-apps.map, 0 Bytes in size)
  2. Try syncing Owncloud using the sync client or opening the file through the web interface

Expected behaviour

Sync folder contents or display file contents (even if it's just garbage or nothing at all)

Actual behaviour

  • On sync client run: Exceptions on the Owncloud server and sync client cancels all pending operations on Google Drive, including other files.
  • Web interface displays "Service Unavailable - Could not open file" when opening the file through it.

Server configuration

Operating system:
Debian 8.4 Jessie
Web server:
Nginx 1.9.10
Database:
MariaDB 10.0.23
PHP version:
5.6.19
ownCloud version: (see ownCloud admin page)
9.0.1
Updated from an older ownCloud or fresh install:
Updated
Where did you install ownCloud from:
https://download.owncloud.org/download/repositories/stable/owncloud/
Signing status (ownCloud 9.0 and above):
No errors have been found.

List of activated apps:
Enabled:

  • activity: 2.2.1
  • calendar: 1.1
  • comments: 0.2
  • contacts: 1.2.0.0
  • dav: 0.1.6
  • documents: 0.12.0
  • external: 1.2
  • federatedfilesharing: 0.1.0
  • federation: 0.0.4
  • files: 1.4.4
  • files_external: 0.5.2
  • files_pdfviewer: 0.8
  • files_sharing: 0.9.1
  • files_texteditor: 2.1
  • files_trashbin: 0.8.0
  • files_versions: 1.2.0
  • files_videoplayer: 0.9.8
  • firstrunwizard: 1.1
  • gallery: 14.5.0
  • mail: 0.4.2
  • music: 0.3.11
  • news: 8.7.1
  • notifications: 0.2.3
  • provisioning_api: 0.4.1
  • systemtags: 0.2
  • templateeditor: 0.1
  • updatenotification: 0.1.0

Disabled:

  • announcementcenter
  • encryption
  • user_external
  • user_ldap

The content of config/config.php:

{
    "system": {
        "instanceid": "occ8570a0a66",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "somedomain.com"
        ],
        "datadirectory": "\/var\/www\/owncloud\/data",
        "dbtype": "mysql",
        "version": "9.0.1.3",
        "dbname": "owncloud",
        "dbhost": "localhost",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "theme": "",
        "maintenance": false,
        "forcessl": true,
        "overwritewebroot": "\/owncloud",
        "overwrite.cli.url": "\/owncloud",
        "loglevel": 2,
        "log_type": "syslog",
        "preview_libreoffice_path": "\/usr\/bin\/libreoffice",
        "preview_office_cl_parameters": " --headless --nologo --nofirststartwizard --invisible --norestore",
        "mail_smtpmode": "php",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "localhost",
            "port": 6379
        },
        "updatechecker": false,
        "has_internet_connection": true,
        "check_for_working_webdav": true,
        "check_for_working_wellknown_setup": true,
        "trashbin_retention_obligation": "auto",
        "mail_smtpsecure": "tls",
        "mail_from_address": "owncloud",
        "mail_smtphost": "localhost",
        "mail_smtpport": "25",
        "mail_domain": "somedomain.com"
    }
}

Are you using external storage, if yes which one: local/smb/sftp/...
Dropbox and Google Drive
Are you using encryption: yes/no
No
Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...
No

Client configuration

Browser:
Chromium 49.0.2623.108
Operating system:
Debian Stretch

Logs

Web server error log

None

ownCloud log (data/owncloud.log)

When trying to access the file using the webinterface:

{PHP} fread() expects parameter 1 to be resource, boolean given at /var/www/owncloud/lib/private/files/storage/wrapper/encryption.php#848
{PHP} fclose() expects parameter 1 to be resource, boolean given at /var/www/owncloud/lib/private/files/storage/wrapper/encryption.php#849
{webdav} Exception: {"Message":"HTTP\/1.1 503 Could not open file","Exception":"Sabre\\DAV\\Exception\\ServiceUnavailable","Code":0,"Trace":"#0 \/var\/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 \/var\/www\/owncloud\/3rdparty\/sabre\/event\/lib\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\n#3 \/var\/www\/owncloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(459): Sabre\\Event\\EventEmitter->emit('method:GET', Array)\n#4 \/var\/www\/owncloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(248): Sabre\\DAV\\Server->invokeMethod(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))\n#5 \/var\/www\/owncloud\/apps\/dav\/appinfo\/v1\/webdav.php(55): Sabre\\DAV\\Server->exec()\n#6 \/var\/www\/owncloud\/remote.php(138): require_once('\/var\/www\/ownclo...')\n#7 {main}","File":"\/var\/www\/owncloud\/apps\/dav\/lib\/connector\/sabre\/file.php","Line":306,"User":"user"}
{PHP} Cannot modify header information - headers already sent by (output started at /var/www/owncloud/3rdparty/sabre/http/lib/Sapi.php:83) at /var/www/owncloud/3rdparty/sabre/http/lib/Sapi.php#58
{PHP} Cannot modify header information - headers already sent by (output started at /var/www/owncloud/3rdparty/sabre/http/lib/Sapi.php:83) at /var/www/owncloud/3rdparty/sabre/http/lib/Sapi.php#63

Every time the sync client runs:

{webdav} Exception: {"Message":"HTTP\/1.1 503 Could not open file","Exception":"Sabre\\DAV\\Exception\\ServiceUnavailable","Code":0,"Trace":"#0 \/var\/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 \/var\/www\/owncloud\/3rdparty\/sabre\/event\/lib\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\n#3 \/var\/www\/owncloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(459): Sabre\\Event\\EventEmitter->emit('method:GET', Array)\n#4 \/var\/www\/owncloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(248): Sabre\\DAV\\Server->invokeMethod(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))\n#5 \/var\/www\/owncloud\/apps\/dav\/appinfo\/v1\/webdav.php(55): Sabre\\DAV\\Server->exec()\n#6 \/var\/www\/owncloud\/remote.php(138): require_once('\/var\/www\/ownclo...')\n#7 {main}","File":"\/var\/www\/owncloud\/apps\/dav\/lib\/connector\/sabre\/file.php","Line":306,"User":"user"}
@PVince81
Copy link
Contributor

@Altyr mind providing the steps to create this special (map?) file ?

@PVince81
Copy link
Contributor

We probably need to exclude these kind of files, it is unlikely that they can be synced as they would need to be exported in some way like docs/spreadsheet files are exported to ODF.

@PVince81 PVince81 added this to the backlog milestone Apr 25, 2016
@lanato
Copy link
Contributor Author

lanato commented Apr 25, 2016

@PVince81 of course.

  1. Log in to google and browse to https://www.google.com/maps/d/mp?hl=en&authuser=0&state=create which should bring up an "untitled map"
  2. Modify something (e.g. click on "add layer") to trigger a save
  3. Your Google Drive should now contain a map file

@PVince81
Copy link
Contributor

Ah cool, thanks. I didn't know about this feature 😄

@PVince81 PVince81 modified the milestones: 9.1-current, backlog Apr 25, 2016
@lanato
Copy link
Contributor Author

lanato commented Apr 26, 2016

@PVince81 using https://developers.google.com/drive/v3/web/mime-types it's possible to detect and hide the files (tried a dirty hack).

Obviously it would be much nicer to export the maps like it's done with google docs, but there doesn't seem to be any documentation on that.

@PVince81
Copy link
Contributor

If you want to have a try fixing it yourself, check https://github.com/owncloud/core/blob/v9.0.1/apps/files_external/lib/google.php#L269. This is the loop that reads the file list from GDrive.

It might be possible to check if the extension is the one to exclude and then just do continue; there.

@lanato
Copy link
Contributor Author

lanato commented Apr 26, 2016

I'll give it a try using ignore later today :)

@lanato
Copy link
Contributor Author

lanato commented Apr 26, 2016

@PVince81 that pull-request seems to work for me.

Other Google Docs files seem a little wonky too, but that might just be me. Updating the lib might be a good idea.

@PVince81
Copy link
Contributor

Great stuff, thanks a lot!

@PVince81
Copy link
Contributor

PVince81 commented Jun 1, 2016

Your PR was merged, closing. Thanks !

@PVince81 PVince81 closed this as completed Jun 1, 2016
@lanato
Copy link
Contributor Author

lanato commented Jun 1, 2016

@PVince81 and thank you for helping me make my first PR

@PVince81
Copy link
Contributor

PVince81 commented Jun 2, 2016

@Altyr well, and your second one which updated the library fixed even more than you thought, see #20481 (comment)

@lock
Copy link

lock bot commented Aug 4, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants