owncloud / contacts

:busts_in_silhouette: Manage your CardDAV contacts from a feature-rich web-interface
75 stars 46 forks source link

InvalidArgumentException on imported VCF files #488

Open hakan42 opened 8 years ago

hakan42 commented 8 years ago

Steps to reproduce

  1. Create a vcf file containing the line "BDAY:Jan 1, 1970"
  2. Import said VCF file
  3. See the "Contacts" app endlessly spin
  4. Get the "contacts" request from the web browser via Developer tools or somesuch
  5. Run the call on the shell

    Expected behaviour

Birthday should be correctly imported, as this was working in earlier versions

Actual behaviour

The birthday triggers an error in sabredav. The curl call mentioned on step 4 shows:

<?xml version="1.0" encoding="utf-8"?>
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
  <s:exception>InvalidArgumentException</s:exception>
  <s:message>Invalid vCard date-time string: Jan 1, 1970</s:message>
</d:error>

This error is being thrown in 3rdparty/sabre/vobject/lib/DateTimeParser.php, line 299

Server configuration

Operating system: Ubuntu 16.04

Web server: nginx 1.9.15-0ubuntu1

Database: postgresql-9.5

PHP version: php :7.0+35ubuntu6

ownCloud version: (see ownCloud admin page) ownCloud 9.1.0 (stable)

Contacts version: (see ownCloud apps page) 1.3.1.0

Updated from an older ownCloud or fresh install: Fresh install, importing VCF from Android handset

Signing status (ownCloud 9.0 and above): No errors have been found.

List of activated apps:

sudo -u www-data php /var/www/owncloud/occ app:list Enabled:

The content of config/config.php: { "system": { "updatechecker": false, "instanceid": "ocew0yc1x0hf", "passwordsalt": "_REMOVED SENSITIVE VALUE_", "secret": "_REMOVED SENSITIVE VALUE_", "trusteddomains": [ "home.gurkensalat.com" ], "datadirectory": "\/var\/www\/owncloud\/data", "overwrite.cli.url": "https:\/\/home.gurkensalat.com\/owncloud", "dbtype": "pgsql", "version": "9.1.0.15", "dbname": "owncloud", "dbhost": "localhost", "dbtableprefix": "oc", "dbuser": "_REMOVED SENSITIVE VALUE_", "dbpassword": "_REMOVED SENSITIVE VALUE_", "logtimezone": "UTC", "installed": true, "mail_from_address": "owncloud", "mail_smtpmode": "php", "mail_domain": "tandogan.com" } }

Are you using external storage, if yes which one: local/smb/sftp/... no

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: Google Chrome 52.0.2743.116 (Official Build) m (32-bit)

Operating system: N/A

CardDAV-clients: CardDAV-Sync 0.4.20

Logs

Web server error log

Insert your webserver log here

ownCloud log (data/owncloud.log)

Nothing in owncloud.log during import or later on page loading

Browser log

Insert your browser log here, this could for example include:

a) The javascript console log
b) The network log 
c) ...
hakan42 commented 8 years ago

As I have not yet run a sync against this freshly installed server (I value my contacts on my mobile too much ), I cannot say whether this exception would cause the CardDAV-Sync to fail mid-operation.

But, as I cannot retrive the full VCF file from the server, I would expect some kind of failure during sync. Hopefully nothing that deletes all my contacts :smiling_imp:

DeepDiver1975 commented 8 years ago

Invalid vCard date-time string: Jan 1, 1970/s:message

absolutly valid to throw this exception - see https://tools.ietf.org/html/rfc6350#section-6.2.5

Jan 1, 1970 is not a valid date format

hakan42 commented 8 years ago

While the exception might be correct, the handling at the user level is truly broken.

It is possible to load such an entry into the database via the "import" function. But as soon as it is loaded, the GUI is unusable and therefore the user unable to fix the offending entry, assuming that he would even get a hint which entry is the culprit.

Therefore, I would like to reopen this issue and hope that the user interaction is somehow fixed.

DeepDiver1975 commented 8 years ago

So the invalid vcard could be imported? I mssinterpreted your report then.

hakan42 commented 8 years ago

Yes, the issue is that it is possible to introduce the broken entry into the database via import and then ìt is not possible anymore to use the GUI.

I believe it might have something to do with the calendar for "Contact Birthdays"

DeepDiver1975 commented 8 years ago

I believe it might have something to do with the calendar for "Contact Birthdays" @DeepDiver1975

no - it's a general import issue in core .... working on it ...

DeepDiver1975 commented 7 years ago

We will update sabre dav in 9.2 which will bring the vcard validation

EgbertW commented 7 years ago

I found this issue using a search engine because I encountered the same problem. I imported a bad vcf file in OwnCloud 9.0.3 and since I get the spinning loader. I figured maybe updating would help so I updated to 10.0.2 today. While the import error may be fixed, the database itself is not fixed - there's still a broken VCF in there and no way to get it out.

I am currently trying to resolve this by manually finding and correcting the entry in the database, but it would be good to have a vcard validation in OwnCloud that when validation fails offers some way to correct or delete the offending entry rather than making the GUI completely unusable.

aario commented 5 years ago

Same here. It's sad to see the bug is still open since 2016.