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

Show more details about the failing reason of an import #990

Open
Leon5x opened this issue Mar 11, 2019 · 17 comments
Open

Show more details about the failing reason of an import #990

Leon5x opened this issue Mar 11, 2019 · 17 comments
Labels
1. to develop Accepted and waiting to be taken care of enhancement New feature or request feature: import Importing (and exporting) high High priority

Comments

@Leon5x
Copy link

Leon5x commented Mar 11, 2019

When importing a vcf file exported by the google calendar app on android the contacts app opens the import windows, and closes it again immediately afterwards. Nothing was imported, no error messages given.

I guess the exported vcf file is in an invalid format, but even if I change it to a (I guess) valid format it fails silently on version 2.1. I would expect a message that this vcf version is not supported or that there is something wrong with the vcf format. In the best case also help for what to do.

To Reproduce
Import the vcard (invalid format):

BEGIN:VCARD
VERSION:2.1
N:;aatest;;;
FN:aatest
TEL;CELL:1
END:VCARD

or the vcard (with valid format):

BEGIN:VCARD
VERSION:2.1
N:;aatest;;;
FN:aatest
TEL;type=CELL:1
END:VCARD

When changing the version in the last vcard to 3.0 it imports properly.

Expected behavior
The contacts app should display an error message that the vcard couldn't be imported and state the reason for that (Invalid format or old vcard version).

Actual behavior
The importing dialog opens and closes immediately afterwards, nothing can be seen there.

Server configuration

Operating system: Linux

Web server: Apache

Database: MariaDB

PHP version: 7.2

Nextcloud version: 15.0.5

Contacts version: 3.0.5

Updated from an older Nextcloud or fresh install:
Updated from an older nc instance

Signing status:

No errors have been found.

List of activated apps:

Enabled:
  - accessibility: 1.1.0
  - activity: 2.8.2
  - calendar: 1.6.4
  - cloud_federation_api: 0.1.0
  - comments: 1.5.0
  - contacts: 3.0.5
  - dav: 1.8.1
  - federatedfilesharing: 1.5.0
  - federation: 1.5.0
  - files: 1.10.0
  - files_external: 1.6.0
  - files_pdfviewer: 1.4.0
  - files_sharing: 1.7.0
  - files_texteditor: 2.7.0
  - files_trashbin: 1.5.0
  - files_versions: 1.8.0
  - files_videoplayer: 1.4.0
  - firstrunwizard: 2.4.0
  - gallery: 18.2.0
  - logreader: 2.0.0
  - lookup_server_connector: 1.3.0
  - nextcloud_announcements: 1.4.0
  - notes: 2.5.1
  - notifications: 2.3.0
  - oauth2: 1.3.0
  - password_policy: 1.5.0
  - polls: 0.10.1
  - provisioning_api: 1.5.0
  - serverinfo: 1.5.0
  - sharebymail: 1.5.0
  - support: 1.0.0
  - survey_client: 1.3.0
  - systemtags: 1.5.0
  - tasks: 0.9.8
  - theming: 1.6.0
  - twofactor_backupcodes: 1.4.1
  - updatenotification: 1.5.0
  - workflowengine: 1.5.0
Disabled:
  - admin_audit
  - audioplayer
  - bruteforcesettings
  - encryption
  - files_opds
  - spreed
  - user_ldap

Nextcloud configuration:

{
    "system": {
        "memcache.local": "\\OC\\Memcache\\APCu",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "***REMOVED SENSITIVE VALUE***",
            "***REMOVED SENSITIVE VALUE***"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "overwrite.cli.url": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "15.0.5.3",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "logtimezone": "UTC",
        "installed": true,
        "maintenance": false,
        "loglevel": 2,
        "enabledPreviewProviders": [
            "OC\\Preview\\Image",
            "OC\\Preview\\MP3",
            "OC\\Preview\\TXT",
            "OC\\Preview\\MarkDown",
            "OC\\Preview\\Epub",
            "OC\\Preview\\PDF"
        ],
        "theme": "",
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "updater.release.channel": "stable"
    }
}

Client configuration

Browser:
Googel Chrome 72.0.3626.121

Operating system:
Windows 10

CardDAV-clients:
DAVDroid

Logs

Web server error log

nothing related

Nextcloud log

data/nextcloud.log

{"reqId":"id","level":4,"time":"2019-03-11T20:16:57+00:00","remoteAddr":"","user":"user","app":"webdav","method":"PUT","url":"\/nextcloud\/remote.php\/dav\/addressbooks\/users\/user\/contacts\/D37730C8-09FC-4CAF-A56C-79E45D583894.vcf","message":{"Exception":"Sabre\\DAV\\Exception\\UnsupportedMediaType","Message":"Validation error in vCard: CardDAV servers are not allowed to accept vCard 2.1.","Code":0,"Trace":[{"file":"\/var\/www\/nextcloud\/3rdparty\/sabre\/dav\/lib\/CardDAV\/Plugin.php","line":316,"function":"validateVCard","class":"Sabre\\CardDAV\\Plugin","type":"->","args":["BEGIN:VCARD\r\nVERSION:2.1\r\nN:;aatest;;;\r\nFN:aatest\r\nTEL;TYPE=CELL:1\r\nUID:06794743-1652-4fe5-9db3-2a38f15d797d\r\nREV:20190311T201657Z\r\nEND:VCARD\r\n",false]},{"function":"beforeCreateFile","class":"Sabre\\CardDAV\\Plugin","type":"->","args":["addressbooks\/users\/user\/contacts\/D37730C8-09FC-4CAF-A56C-79E45D583894.vcf","BEGIN:VCARD\r\nVERSION:2.1\r\nN:;aatest;;;\r\nFN:aatest\r\nTEL;TYPE=CELL:1\r\nUID:06794743-1652-4fe5-9db3-2a38f15d797d\r\nREV:20190311T201657Z\r\nEND:VCARD\r\n",{"__class__":"OCA\\DAV\\CardDAV\\AddressBook"},false]},{"file":"\/var\/www\/nextcloud\/3rdparty\/sabre\/event\/lib\/EventEmitterTrait.php","line":105,"function":"call_user_func_array","args":[[{"directories":[],"__class__":"OCA\\DAV\\CardDAV\\Plugin"},"beforeCreateFile"],["addressbooks\/users\/user\/contacts\/D37730C8-09FC-4CAF-A56C-79E45D583894.vcf","BEGIN:VCARD\r\nVERSION:2.1\r\nN:;aatest;;;\r\nFN:aatest\r\nTEL;TYPE=CELL:1\r\nUID:06794743-1652-4fe5-9db3-2a38f15d797d\r\nREV:20190311T201657Z\r\nEND:VCARD\r\n",{"__class__":"OCA\\DAV\\CardDAV\\AddressBook"},false]]},{"file":"\/var\/www\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php","line":1094,"function":"emit","class":"Sabre\\Event\\EventEmitter","type":"->","args":["beforeCreateFile",["addressbooks\/users\/user\/contacts\/D37730C8-09FC-4CAF-A56C-79E45D583894.vcf","BEGIN:VCARD\r\nVERSION:2.1\r\nN:;aatest;;;\r\nFN:aatest\r\nTEL;TYPE=CELL:1\r\nUID:06794743-1652-4fe5-9db3-2a38f15d797d\r\nREV:20190311T201657Z\r\nEND:VCARD\r\n",{"__class__":"OCA\\DAV\\CardDAV\\AddressBook"},false]]},{"file":"\/var\/www\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/CorePlugin.php","line":525,"function":"createFile","class":"Sabre\\DAV\\Server","type":"->","args":["addressbooks\/users\/user\/contacts\/D37730C8-09FC-4CAF-A56C-79E45D583894.vcf","BEGIN:VCARD\r\nVERSION:2.1\r\nN:;aatest;;;\r\nFN:aatest\r\nTEL;TYPE=CELL:1\r\nUID:06794743-1652-4fe5-9db3-2a38f15d797d\r\nREV:20190311T201657Z\r\nEND:VCARD\r\n",null]},{"function":"httpPut","class":"Sabre\\DAV\\CorePlugin","type":"->","args":[{"absoluteUrl":"https:\/\/lwtw.ddnss.de\/nextcloud\/remote.php\/dav\/addressbooks\/users\/user\/contacts\/D37730C8-09FC-4CAF-A56C-79E45D583894.vcf","__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"\/var\/www\/nextcloud\/3rdparty\/sabre\/event\/lib\/EventEmitterTrait.php","line":105,"function":"call_user_func_array","args":[[{"__class__":"Sabre\\DAV\\CorePlugin"},"httpPut"],[{"absoluteUrl":"https:\/\/lwtw.ddnss.de\/nextcloud\/remote.php\/dav\/addressbooks\/users\/user\/contacts\/D37730C8-09FC-4CAF-A56C-79E45D583894.vcf","__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]]},{"file":"\/var\/www\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php","line":479,"function":"emit","class":"Sabre\\Event\\EventEmitter","type":"->","args":["method:PUT",[{"absoluteUrl":"https:\/\/lwtw.ddnss.de\/nextcloud\/remote.php\/dav\/addressbooks\/users\/user\/contacts\/D37730C8-09FC-4CAF-A56C-79E45D583894.vcf","__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]]},{"file":"\/var\/www\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php","line":254,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->","args":[{"absoluteUrl":"https:\/\/lwtw.ddnss.de\/nextcloud\/remote.php\/dav\/addressbooks\/users\/user\/contacts\/D37730C8-09FC-4CAF-A56C-79E45D583894.vcf","__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"\/var\/www\/nextcloud\/apps\/dav\/lib\/Server.php","line":301,"function":"exec","class":"Sabre\\DAV\\Server","type":"->","args":[]},{"file":"\/var\/www\/nextcloud\/apps\/dav\/appinfo\/v2\/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->","args":[]},{"file":"\/var\/www\/nextcloud\/remote.php","line":163,"args":["\/var\/www\/nextcloud\/apps\/dav\/appinfo\/v2\/remote.php"],"function":"require_once"}],"File":"\/var\/www\/nextcloud\/3rdparty\/sabre\/dav\/lib\/CardDAV\/Plugin.php","Line":397,"CustomMessage":"--"},"userAgent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/72.0.3626.121 Safari\/537.36","version":"15.0.5.3"}

Browser log

For the vcard with a valid format and a wrong version

PUT https://*/nextcloud/remote.php/dav/addressbooks/users/*/contacts/20895E5E-D8FA-4800-B81B-A0B120129501.vcf 415 (Unsupported Media Type)
Error
    at XMLHttpRequest.s.onreadystatechange (dist.js:1)

For the vcard with a invalid format and a wrong version

parseVcf.js:47
r {message: "Invalid parameters in 'TEL;CELL:1'", name: "ParserError", stack: "    at new r (https://*/nextcloud/apps…apps/contacts/js/contacts.js?v=728b7e97-5:91:5652"}
message: "Invalid parameters in 'TEL;CELL:1'"
name: "ParserError"
stack: "    at new r (https://*/nextcloud/apps/contacts/js/contacts.js?v=728b7e97-5:7:79789)↵    at Function.i._handleContentLine (https://*/nextcloud/apps/contacts/js/contacts.js?v=728b7e97-5:7:80550)↵    at https://*/nextcloud/apps/contacts/js/contacts.js?v=728b7e97-5:7:79967↵    at Function.i._eachLine (https://*/nextcloud/apps/contacts/js/contacts.js?v=728b7e97-5:7:83496)↵    at Object.i [as parse] (https://*/nextcloud/apps/contacts/js/contacts.js?v=728b7e97-5:7:79939)↵    at new t (https://*/nextcloud/apps/contacts/js/contacts.js?v=728b7e97-5:156:300)↵    at https://*/nextcloud/apps/contacts/js/contacts.js?v=728b7e97-5:69:241↵    at Array.reduce (<anonymous>)↵    at sn (https://*/nextcloud/apps/contacts/js/contacts.js?v=728b7e97-5:69:210)↵    at https://*/nextcloud/apps/contacts/js/contacts.js?v=728b7e97-5:91:5652"
__proto__: Object

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@nextcloud-bot
Copy link
Member

GitMate.io thinks possibly related issues are #236 (.vcf import fails silently), #678 (Importing fixes), #343 (Issues after import), #574 (Import of vcf file causes lots of errors), and #389 (Import of Outlook VCARD failing).

@nextcloud-bot nextcloud-bot added the bug Something isn't working label Mar 11, 2019
@skjnldsv
Copy link
Member

Yes, this is a plan feature :)
To have a detailed list of contacts who failed and why.
You imported a single vcard, right?

The main issue is how to manage the display when you have 100 contacts that failed on import, we don't want to flood the Interface with data 🤔

How would you like having this info? 🤔

@Leon5x
Copy link
Author

Leon5x commented Mar 12, 2019

Good to know :)

Actually I wanted to import over hundreds of vcards, to import the contacts from my phone.
The single vcard I attached was just minimal a test I created to try to find where the error lies.
I just found out that all the contacts in my file are in an invalid format. So it is definitely my mistake, sorry.

As a quick bugfix I would recommend adding an ok button to the importing dialog, so it doesn't close automatically. So you can at least see that there is something wrong with the file you wanted to import and not expect the import function to be broken at the moment.

The info would be nice to have just under the importing dialog after it is finished. You don't need to display all the errors, just make an expandable box which is just one line and you can expand it to view the details of the errors. Does this make sense?

@skjnldsv
Copy link
Member

As a quick bugfix I would recommend adding an ok button to the importing dialog, so it doesn't close automatically.

Awesome! This is also planned here: #606 🎉

The info would be nice to have just under the importing dialog after it is finished. You don't need to display all the errors, just make an expandable box which is just one line and you can expand it to view the details of the errors. Does this make sense?

Totally does! Let's make this issue about this! :)

@skjnldsv skjnldsv changed the title vcf import fails silently Show more details about the failing reason of an import Mar 12, 2019
@skjnldsv skjnldsv added enhancement New feature or request 1. to develop Accepted and waiting to be taken care of and removed bug Something isn't working labels Mar 12, 2019
@skjnldsv skjnldsv added this to the next minor milestone Mar 12, 2019
@jancborchardt
Copy link
Member

The main issue is how to manage the display when you have 100 contacts that failed on import, we don't want to flood the Interface with data thinking

I just did an import of contacts, and it’s not that many, around ~200. But ~50 of them failed. Now that I closed the import window there’s no way I can know which ones of them failed, and they are not displayed.

I’d say that "failed" import, for whatever reason, should not lead to the contacts not displaying at all. Some of it has to be salvageable, like the name or some fields, no? It would be way better to show entries for all the contacts so you at least have some indication, but with an "Error" icon of some sort so you can fix it.

@jancborchardt jancborchardt added the high High priority label Aug 26, 2019
@skjnldsv
Copy link
Member

Some of it has to be salvageable, like the name or some fields, no? It would be way better to show entries for all the contacts so you at least have some indication, but with an "Error" icon of some sort so you can fix it.

depends on the errors. We fix the one we can, otherwise it's either, not implemented by the library, or not fixeable by us :)

Do you have more input on the errors Jan?
You can have all the details on the console logs

@graphixillusion

This comment has been minimized.

@skjnldsv

This comment has been minimized.

@iptizer
Copy link

iptizer commented Dec 8, 2019

Found this Issue while having trouble to import Contacts exported from my Android into Nextcloud.

Problem: Nextcloud seems to only support vcf 3.0, Android exports vcf 2.1.

Solution: Using this project I was able to convert all my contacts to 3.0. After that the import ran through with 0 errors on 385 contacts.

@jancborchardt

This comment has been minimized.

@skjnldsv
Copy link
Member

skjnldsv commented Dec 9, 2019

@iptizer good find – could you open a separate issue about the vcf version compatibility issue? Thanks! :)

Please don't, we do not support vcard 2.1, and there is already an opened issue #492 ;)

@Matthias84
Copy link

From a user perspective, it would be pretty cool, if all the importers of NC could adapt to a similar (more descriptive) UI pattern:
nextcloud/calendar#2065
So for example giving numbers on dublicates, format issues, ... and details of which objects failed (e.g. in a more button which expands to a log listing)

@rubo77
Copy link

rubo77 commented Oct 25, 2020

Maybe we can add a solution to the warning:

If someone tries to import a 2.1 vcard, there could be a warning like this:

"You tried to import a vCard in the old v2.1 format. please convert it to v3.0. e.g. with this conversion script: https://github.com/jowave/vcard2to3 or online with https://labs.brotherli.ch/vcfconvert/"

@xeruf
Copy link

xeruf commented Apr 14, 2022

I had a similar issue, where it reported "2 errors" - I had to look into the logs as admin to find out that it was a wrongly formatted field and thus two birthdays would have gone missing :/

@Mte90
Copy link

Mte90 commented Sep 26, 2023

I got this #492 and only with a search online I found those tickets.
Add some information about the errors in importing is very important otherwise is very uselesss the import feature.

@xeruf
Copy link

xeruf commented Jan 16, 2025

Recently an import failed because TYPE= was missing for TEL, and there was nothing at all in the logs.
Would really appreciate progress on this :)

@Atemu
Copy link

Atemu commented Feb 18, 2025

Is there any way to tell what exactly went wrong? There appears to be no log whatsoever on the server either. I just need to get some sort of identifier on the one contact out of 200 that failed to import.

Also to anyone seeing a large amount of failures: Ensure you're not using sqlite as nextcloud does not appear to implement concurrency properly with it and it fails to import a large random chunk of your contacts due to race conditions.
NC does not recommend using sqlite for anything but testing and "small instances" but, given that you cannot even import a couple hundred contacts without it falling flat on its face which you very well might expect a "small instance" to be able to do, I'd say that's not accurate; do not use sqlite with nextcloud for any purpose other than maybe testing and perhaps not even that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1. to develop Accepted and waiting to be taken care of enhancement New feature or request feature: import Importing (and exporting) high High priority
Projects
None yet
Development

No branches or pull requests