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

vCard import broken: window.localStorage is null #433

Closed
schnittchen opened this issue Nov 9, 2017 · 39 comments · Fixed by #596
Closed

vCard import broken: window.localStorage is null #433

schnittchen opened this issue Nov 9, 2017 · 39 comments · Fixed by #596
Labels
2. developing Work in progress bug Something isn't working good first issue Good for newcomers medium Medium priority
Milestone

Comments

@schnittchen
Copy link

schnittchen commented Nov 9, 2017

This is probably a bug on the frontend, see console log at the bottom.

Steps to reproduce

  1. Upload a .vcf
  2. Watch spinner forever

Expected behaviour

Contacts are imported.

Actual behaviour

A javascript exception

Server configuration

Operating system: CentOS on a shell hoster (uberspace.de)

Web server: dunno

Database: postgres 9.3

PHP version: 7.0

Nextcloud version: 12.0.3

Contacts version: 2.0.1

Updated from an older Nextcloud or fresh install: fresh install

Signing status:

no errors have been found

List of activated apps:

Enabled:
  - activity: 2.5.2
  - comments: 1.2.0
  - contacts: 2.0.1
  - dav: 1.3.0
  - federatedfilesharing: 1.2.0
  - federation: 1.2.0
  - files: 1.7.2
  - files_pdfviewer: 1.1.1
  - files_sharing: 1.4.0
  - files_texteditor: 2.4.1
  - files_trashbin: 1.2.0
  - files_versions: 1.5.0
  - files_videoplayer: 1.1.0
  - firstrunwizard: 2.1
  - gallery: 17.0.0
  - logreader: 2.0.0
  - lookup_server_connector: 1.0.0
  - news: 11.0.5
  - nextcloud_announcements: 1.1
  - notifications: 2.0.0
  - oauth2: 1.0.5
  - password_policy: 1.2.2
  - provisioning_api: 1.2.0
  - serverinfo: 1.2.0
  - sharebymail: 1.2.0
  - survey_client: 1.0.0
  - systemtags: 1.2.0
  - theming: 1.3.0
  - twofactor_backupcodes: 1.1.1
  - unsplash: 1.0.5
  - updatenotification: 1.2.0
  - workflowengine: 1.2.0
Disabled:
  - admin_audit
  - encryption
  - files_external
  - user_external
  - user_ldap

Nextcloud configuration:

{
    "system": {
        "log_type": "file",
        "logtimezone": "\/Europe\/London",
        "logfile": "\/home\/me\/tmp\/nextcloud.log",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "me.pictor.uberspace.de"
        ],
        "datadirectory": "\/var\/www\/virtual\/me\/html\/nextcloud\/data",
        "overwrite.cli.url": "http:\/\/localhost",
        "dbtype": "pgsql",
        "version": "12.0.3.3",
        "dbname": "nextcloud",
        "dbhost": "\/home\/me\/tmp",
        "dbport": "",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "instanceid": "oc4bsvolsm6i",
        "memcache.local": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "\/home\/me\/.redis\/sock",
            "port": 0,
            "dbindex": 0,
            "password": "***REMOVED SENSITIVE VALUE***",
            "timeout": 1.5
        },
        "filelocking.enabled": true,
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "htaccess.RewriteBase": "\/nextcloud\/",
        "maintenance": false
    }
}

Are you using external storage, if yes which one: none

Are you using encryption: no

Are you using an external user-backend, if yes which one: none

Client configuration

Browser: both FF 56 and current Chrome

Operating system: Ubuntu 17.04

Logs

Web server error log

don't know where and I bet I don't have access

Nextcloud log (data/nextcloud.log)

entries are old and unrelated

Browser log

angular.js?v=3f38eefcee766e956d4f0af8bb974918-0:13920 Error: [$rootScope:inprog] $apply already in progress

@Henni
Copy link
Member

Henni commented Nov 9, 2017

Could you give us the complete stack trace of the browser log?
It should contain more details about where in our could this happens.

@Henni Henni added bug Something isn't working needs info Not enough information provided labels Nov 9, 2017
@whathome
Copy link

whathome commented Nov 12, 2017

I am having the same issue. Fresh install. Here is the browser trace.

Error: window.localStorage is null
@http://localhost:8080/custom_apps/contacts/js/public/script.js?v=0d9c254b2908a01ad078c01544a744dd-2:2546:6
instantiate@http://localhost:8080/custom_apps/contacts/js/vendor/angular/angular.js?v=0d9c254b2908a01ad078c01544a744dd-2:4733:14
service/<@http://localhost:8080/custom_apps/contacts/js/vendor/angular/angular.js?v=0d9c254b2908a01ad078c01544a744dd-2:4573:14
invoke@http://localhost:8080/custom_apps/contacts/js/vendor/angular/angular.js?v=0d9c254b2908a01ad078c01544a744dd-2:4718:16
enforcedReturnValue@http://localhost:8080/custom_apps/contacts/js/vendor/angular/angular.js?v=0d9c254b2908a01ad078c01544a744dd-2:4557:20
invoke@http://localhost:8080/custom_apps/contacts/js/vendor/angular/angular.js?v=0d9c254b2908a01ad078c01544a744dd-2:4718:16
createInjector/protoInstanceInjector<@http://localhost:8080/custom_apps/contacts/js/vendor/angular/angular.js?v=0d9c254b2908a01ad078c01544a744dd-2:4517:20
getService@http://localhost:8080/custom_apps/contacts/js/vendor/angular/angular.js?v=0d9c254b2908a01ad078c01544a744dd-2:4664:39
injectionArgs@http://localhost:8080/custom_apps/contacts/js/vendor/angular/angular.js?v=0d9c254b2908a01ad078c01544a744dd-2:4688:58
invoke@http://localhost:8080/custom_apps/contacts/js/vendor/angular/angular.js?v=0d9c254b2908a01ad078c01544a744dd-2:4710:18
$controllerInit@http://localhost:8080/custom_apps/contacts/js/vendor/angular/angular.js?v=0d9c254b2908a01ad078c01544a744dd-2:10354:24
nodeLinkFn@http://localhost:8080/custom_apps/contacts/js/vendor/angular/angular.js?v=0d9c254b2908a01ad078c01544a744dd-2:9263:34
compileTemplateUrl/<@http://localhost:8080/custom_apps/contacts/js/vendor/angular/angular.js?v=0d9c254b2908a01ad078c01544a744dd-2:9673:13
processQueue@http://localhost:8080/custom_apps/contacts/js/vendor/angular/angular.js?v=0d9c254b2908a01ad078c01544a744dd-2:16383:28
scheduleProcessQueue/<@http://localhost:8080/custom_apps/contacts/js/vendor/angular/angular.js?v=0d9c254b2908a01ad078c01544a744dd-2:16399:27
$eval@http://localhost:8080/custom_apps/contacts/js/vendor/angular/angular.js?v=0d9c254b2908a01ad078c01544a744dd-2:17682:16
$digest@http://localhost:8080/custom_apps/contacts/js/vendor/angular/angular.js?v=0d9c254b2908a01ad078c01544a744dd-2:17495:15
$apply@http://localhost:8080/custom_apps/contacts/js/vendor/angular/angular.js?v=0d9c254b2908a01ad078c01544a744dd-2:17790:13
done@http://localhost:8080/custom_apps/contacts/js/vendor/angular/angular.js?v=0d9c254b2908a01ad078c01544a744dd-2:11831:36
completeRequest@http://localhost:8080/custom_apps/contacts/js/vendor/angular/angular.js?v=0d9c254b2908a01ad078c01544a744dd-2:12033:7
requestLoaded@http://localhost:8080/custom_apps/contacts/js/vendor/angular/angular.js?v=0d9c254b2908a01ad078c01544a744dd-2:11966:9
 angular.js:13920:18
	consoleLog/< http://localhost:8080/custom_apps/contacts/js/vendor/angular/angular.js:13920:18
	$ExceptionHandlerProvider/this.$get</< http://localhost:8080/custom_apps/contacts/js/vendor/angular/angular.js:10467:7
	processQueue http://localhost:8080/custom_apps/contacts/js/vendor/angular/angular.js:16391:9
	scheduleProcessQueue/< http://localhost:8080/custom_apps/contacts/js/vendor/angular/angular.js:16399:27
	$eval http://localhost:8080/custom_apps/contacts/js/vendor/angular/angular.js:17682:16
	$digest http://localhost:8080/custom_apps/contacts/js/vendor/angular/angular.js:17495:15
	$apply http://localhost:8080/custom_apps/contacts/js/vendor/angular/angular.js:17790:13
	done http://localhost:8080/custom_apps/contacts/js/vendor/angular/angular.js:11831:36
	completeRequest http://localhost:8080/custom_apps/contacts/js/vendor/angular/angular.js:12033:7
	requestLoaded

@whathome
Copy link

whathome commented Nov 12, 2017

Hmm, it's not actually the importer -- it's the sort order check that's causing it.

In 'SortByService' in script.js its checking for defaultOrder from window.localStorage and it's null. I'm entirely unfamiliar with the project so I'm not sure of the ramifications, but if I put an null check around the block like so:

	if (window.localStorage) {
		var defaultOrder = window.localStorage.getItem('contacts_default_order');
		if (defaultOrder) {
			sortBy = defaultOrder;
		}
	}

then the page loads properly. I'm not sure if that's the proper elegant fix, but it works for me.

@Henni
Copy link
Member

Henni commented Nov 12, 2017

@weslimitless which browser (and version) are you using?

@whathome
Copy link

Firefox 56.0.2, OSX

@memen45
Copy link

memen45 commented Nov 22, 2017

I am having the same issue with importing a .vcf file (vcf with single entry does work). The left panel keeps spinning and opening a new tab does not show any contacts being added.

Nextcloud server 12.03

@skjnldsv
Copy link
Member

@memen45 what contact version? Please add your logs. :)

@memen45
Copy link

memen45 commented Nov 23, 2017 via email

@skjnldsv
Copy link
Member

Mostly the browser log then. :)

@memen45
Copy link

memen45 commented Nov 23, 2017

Okay, this is the output from console (I am using Microsoft Edge):

CSP14312: Resource heeft conflict veroorzaakt met instructie script-src 'self' 'unsafe-eval' in Content-Security-Policy: inline script. Resource wordt geblokkeerd.

Error: [$rootScope:inprog] $apply already in progress
http://errors.angularjs.org/1.5.8/$rootScope/inprog?p0=%24apply
at beginPhase (https://mydomain.com/apps/contacts/js/vendor/angular/angular.js?v=0a61ceb041f56bc82bdf96a7f7af5d9d-3:18042:9)
at Scope.prototype.$apply (https://mydomain.com/apps/contacts/js/vendor/angular/angular.js?v=0a61ceb041f56bc82bdf96a7f7af5d9d-3:17780:11)
at Anonymous function (https://mydomain.com/apps/contacts/js/public/script.js?v=0a61ceb041f56bc82bdf96a7f7af5d9d-3:716:9)
at import (https://mydomain.com/apps/contacts/js/public/script.js?v=0a61ceb041f56bc82bdf96a7f7af5d9d-3:2321:6)
at Anonymous function (https://mydomain.com/apps/contacts/js/public/script.js?v=0a61ceb041f56bc82bdf96a7f7af5d9d-3:693:8)
at Scope.prototype.$eval (https://mydomain.com/apps/contacts/js/vendor/angular/angular.js?v=0a61ceb041f56bc82bdf96a7f7af5d9d-3:17682:9)
at Scope.prototype.$apply (https://mydomain.com/apps/contacts/js/vendor/angular/angular.js?v=0a61ceb041f56bc82bdf96a7f7af5d9d-3:17782:13)
at Anonymous function (https://mydomain.com/apps/contacts/js/public/script.js?v=0a61ceb041f56bc82bdf96a7f7af5d9d-3:686:7)

2 Error: [$rootScope:inprog] $apply already in progress
http://errors.angularjs.org/1.5.8/$rootScope/inprog?p0=%24apply
at beginPhase (https://mydomain.com/apps/contacts/js/vendor/angular/angular.js?v=0a61ceb041f56bc82bdf96a7f7af5d9d-3:18042:9)
at Scope.prototype.$digest (https://mydomain.com/apps/contacts/js/vendor/angular/angular.js?v=0a61ceb041f56bc82bdf96a7f7af5d9d-3:17472:9)
at Scope.prototype.$apply (https://mydomain.com/apps/contacts/js/vendor/angular/angular.js?v=0a61ceb041f56bc82bdf96a7f7af5d9d-3:17790:13)
at Anonymous function (https://mydomain.com/apps/contacts/js/public/script.js?v=0a61ceb041f56bc82bdf96a7f7af5d9d-3:716:9)
at import (https://mydomain.com/apps/contacts/js/public/script.js?v=0a61ceb041f56bc82bdf96a7f7af5d9d-3:2321:6)
at Anonymous function (https://mydomain.com/apps/contacts/js/public/script.js?v=0a61ceb041f56bc82bdf96a7f7af5d9d-3:693:8)
at Scope.prototype.$eval (https://mydomain.com/apps/contacts/js/vendor/angular/angular.js?v=0a61ceb041f56bc82bdf96a7f7af5d9d-3:17682:9)
at Scope.prototype.$apply (https://mydomain.com/apps/contacts/js/vendor/angular/angular.js?v=0a61ceb041f56bc82bdf96a7f7af5d9d-3:17782:13)
at Anonymous function (https://mydomain.com/apps/contacts/js/public/script.js?v=0a61ceb041f56bc82bdf96a7f7af5d9d-3:686:7

Sorry for the dutch warning in the beginning, it says "Resource caused a conflict"

Edit: It is still spinning, but following line also appeared:

Shutting down notifications: [0] error merged.js (273,5)

@paraqles
Copy link

paraqles commented Nov 27, 2017

Hi,

I seem to have a similar problem. Not quite sure it it is the same cause.
I tested it with firefox, chrome and safari. All of them show the same error.
And there is no request to the server, seems it breaks on reading the vcf file.

The VCF file is exported on android 7.1.2 stock contacts app.

The Browser Console says:

angular.js?v=753a4e221a3c8257b05fbf21b6569723-7:13920
Error: [$rootScope:inprog] $apply already in progress
http://errors.angularjs.org/1.5.8/$rootScope/inprog?p0=%24apply
    at angular.js?v=753a4e221a3c8257b05fbf21b6569723-7:68
    at beginPhase (angular.js?v=753a4e221a3c8257b05fbf21b6569723-7:18042)
    at Scope.$apply (angular.js?v=753a4e221a3c8257b05fbf21b6569723-7:17780)
    at contactImport_directive.js:41
    at Object.import (contact_service.js:246)
    at contactImport_directive.js:18
    at Scope.$eval (angular.js?v=753a4e221a3c8257b05fbf21b6569723-7:17682)
    at Scope.$apply (angular.js?v=753a4e221a3c8257b05fbf21b6569723-7:17782)
    at FileReader.<anonymous> (contactImport_directive.js:11)
(anonymous) @ angular.js?v=753a4e221a3c8257b05fbf21b6569723-7:13920

angular.js?v=753a4e221a3c8257b05fbf21b6569723-7:13920
Error: [$rootScope:inprog] $apply already in progress
http://errors.angularjs.org/1.5.8/$rootScope/inprog?p0=%24apply
    at angular.js?v=753a4e221a3c8257b05fbf21b6569723-7:68
    at beginPhase (angular.js?v=753a4e221a3c8257b05fbf21b6569723-7:18042)
    at Scope.$digest (angular.js?v=753a4e221a3c8257b05fbf21b6569723-7:17472)
    at Scope.$apply (angular.js?v=753a4e221a3c8257b05fbf21b6569723-7:17790)
    at contactImport_directive.js:41
    at Object.import (contact_service.js:246)
    at contactImport_directive.js:18
    at Scope.$eval (angular.js?v=753a4e221a3c8257b05fbf21b6569723-7:17682)
    at Scope.$apply (angular.js?v=753a4e221a3c8257b05fbf21b6569723-7:17782)
    at FileReader.<anonymous> (contactImport_directive.js:11)

General server configuration

Operating system: FreeBSD journee 11.1-RELEASE FreeBSD 11.1-RELEASE #0 r321309: Fri Jul 21 02:08:28 UTC 2017 [email protected]:/usr/obj/usr/src/sys/GENERIC amd64

Web server: nginx/1.12.1 (fpm-fcgi)

Database: pgsql PostgreSQL 9.5.10 on amd64-portbld-freebsd11.0, compiled by FreeBSD clang version 3.8.0 (tags/RELEASE_380/final 262564) (based on LLVM 3.8.0), 64-bit

PHP version: 7.1.10

PHP-modules loaded
 - Core
 - date
 - libxml
 - pcre
 - Reflection
 - SPL
 - hash
 - session
 - cgi-fcgi
 - standard
 - bz2
 - ctype
 - curl
 - dom
 - enchant
 - mbstring
 - fileinfo
 - filter
 - gd
 - gettext
 - mysqlnd
 - iconv
 - intl
 - json
 - exif
 - mcrypt
 - openssl
 - pcntl
 - PDO
 - pgsql
 - posix
 - readline
 - recode
 - SimpleXML
 - sysvmsg
 - sysvsem
 - sysvshm
 - tidy
 - tokenizer
 - xml
 - xmlwriter
 - zip
 - zlib
 - pdo_pgsql
 - redis
 - xmlreader
 - xmlrpc
 - xsl
 - Zend OPcache

Nextcloud configuration

Nextcloud version: 12.0.3 - 12.0.3.3

Updated from an older Nextcloud/ownCloud or fresh install: fresh install

Where did you install Nextcloud from: zip-file

Are you using external storage, if yes which one: files_external is disabled

Are you using encryption: no

Are you using an external user-backend, if yes which one: NO
(LDAP/ActiveDirectory/Webdav/...)

Signing status
[]
Enabled apps
 - activity: 2.5.2
 - announcementcenter: 3.1.1
 - bruteforcesettings: 1.0.2
 - calendar: 1.5.6
 - comments: 1.2.0
 - contacts: 2.0.1
 - dav: 1.3.0
 - federatedfilesharing: 1.2.0
 - federation: 1.2.0
 - files: 1.7.2
 - files_pdfviewer: 1.1.1
 - files_sharing: 1.4.0
 - files_texteditor: 2.4.1
 - files_trashbin: 1.2.0
 - files_versions: 1.5.0
 - files_videoplayer: 1.1.0
 - firstrunwizard: 2.1
 - gallery: 17.0.0
 - issuetemplate: 0.2.2
 - logreader: 2.0.0
 - lookup_server_connector: 1.0.0
 - nextcloud_announcements: 1.1
 - notifications: 2.0.0
 - oauth2: 1.0.5
 - password_policy: 1.2.2
 - provisioning_api: 1.2.0
 - serverinfo: 1.2.0
 - sharebymail: 1.2.0
 - survey_client: 1.0.0
 - systemtags: 1.2.0
 - theming: 1.3.0
 - twofactor_backupcodes: 1.1.1
 - updatenotification: 1.2.0
 - workflowengine: 1.2.0
Disabled apps
 - admin_audit
 - contacts-1.5.3
 - encryption
 - files_external
 - user_external
 - user_ldap
Content of config/config.php
{
    "instanceid": "REDACTED",
    "passwordsalt": "***REMOVED SENSITIVE VALUE***",
    "secret": "***REMOVED SENSITIVE VALUE***",
    "trusted_domains": [
        "REDACTED",
        "REDACTED"
    ],
    "datadirectory": "\/usr\/share\/webapps\/nextcloud\/data",
    "overwrite.cli.url": "http:\/\/REDACTED",
    "dbtype": "pgsql",
    "version": "12.0.3.3",
    "dbname": "nextcloud",
    "dbhost": "localhost:\/tmp",
    "dbport": "",
    "dbtableprefix": "oc_",
    "dbuser": "***REMOVED SENSITIVE VALUE***",
    "dbpassword": "***REMOVED SENSITIVE VALUE***",
    "installed": true,
    "maintenance": false,
    "memcache.local": "\\OC\\Memcache\\Redis",
    "memcache.locking": "\\OC\\Memcache\\Redis",
    "redis": {
        "host": "\/tmp\/redis.sock",
        "port": 0,
        "dbindex": 0,
        "timeout": 1.5
    },
    "theme": ""
}

Client configuration

Browser:
Mozilla Firefox 57
Safari 11.0.1
Chrome 62.0.3202.89

Operating system: macOS 10.12.6

Logs

Web server error log
No webserver errors logged.
Nextcloud log (data/nextcloud.log)
No related entries in the nextcloud.log
Browser log
1. For console log see above.
2. Network only shows getting of assets and site and also xhr for notificatiosn

@skjnldsv
Copy link
Member

@irgendwie didn't we had this bug fixed earlier on? :)

@ispringle
Copy link

Don't have logs at the moment, I'm on my phone. I am getting a similar issue. I was able to get past the spinning by opening the vcf file and changing version number to 3.0.

It sort of works, gets past the spinning, but it took 30 minutes to upload a single contact and never imported more than the first contact. Might want to check the vcf version, Contacts won't upload any version 2.X vcf files.

@jgillich
Copy link

jgillich commented Dec 6, 2017

@skjnldsv 5aed74a

I really don't know Angular at all, but according to this SO post you probably cannot nest scope.$apply().

Now I'm also wondering why a massive framework like Angular is used for such a simple app, but I guess that's not really relevant here...

@jeromelebleu
Copy link

I have also the same issue - same behavior and JavaScript error and trace from the console. I'm running the last version of the app (2.0.1) and using Firefox ESR 52.5.0.

As pointed by @jgillich, I tried to comment this line which resolves this loading freeze and also the error from the console.
However, in my case, it ending with another error - but this one is well caught and displayed by Nextcloud: Only vCard version 4.0 (RFC6350) or version 3.0 (RFC2426) are supported.. I'm wondering if it's could be related since someone else successfully imported its contacts using the same Nextcloud instance and application version. Only the file and maybe the browser were different.

@gubagu
Copy link

gubagu commented Dec 23, 2017

Same here
Contact import broken under latest Chrome, FF and Edge
Versions:
Nextcloud 12.0.3
Contacts 2.0.1
@jeromelebleu I doubt anyone could import contacts from vcf file.
Any development around this issue ?

@pinq-
Copy link

pinq- commented Jan 9, 2018

Same here...
I got 76 out of 92 importet in when I edit the vcf. I replace all the VERSION:2.1 wtih VERSION:3.0. It works, but you can't import contacts how have ä, ö or å on their name.

@skjnldsv
Copy link
Member

skjnldsv commented Jan 9, 2018

@pinq- what error do you have in the console then?

#433

@gubagu it works fine on my install here, and many users too. There is still an issue apparently since you guys are having differents errors.

To people that still have the issue, could you all paste your console logs so we can list what singularities do you have? 🤗
Thanks 🍀

@pinq-
Copy link

pinq- commented Jan 9, 2018

@skjnldsv When I try to import regular file( 2.1) then the waiting spinner starts to spin and I get these errors in console:
Error: [$rootScope:inprog] $apply already in progress
http://errors.angularjs.org/1.5.8/$rootScope/inprog?p0=%24apply

When I try to import modified file the I get these erros in tin the top of the screen "Could not create contact information."( in finnish). No errors in console.

Now, how I can remove double contacts? :D

@ispringle
Copy link

Opened my .vcf file with VIM and did a find & replace all, changing all VERSION:2.1 to VERSION:3.0
Successfully updated all files.

If you're hanging at a certain percent I bet the uploader is hitting a contact that is version >3.0

@skjnldsv
Copy link
Member

skjnldsv commented Jan 9, 2018

If you're hanging at a certain percent I bet the uploader is hitting a contact that is version >3.0

Then an error is supposed to be displayed. It should not hang.

@ispringle
Copy link

Ah, I never had the error display. It would hang at whichever contact wasn't >=3.0. But after replacing all with 3.0 it ceases to hang. I never checked the console though, so if it only displays in the console that would be why I never saw an error.

@moso
Copy link

moso commented Feb 11, 2018

Changing the VERSION:2.1 to VERSION:3.0 does solve the hanging issue for me. However, contacts with photos doesn't get imported, and Nextcloud displays "Contact could not be created".

I don't know if this has to do with the fact that photos are stored as base64 and the Contacts app is unable to read those during the import?

@RonaldBarnes
Copy link

I also found changing VERSION:2.1 to VERSION:3.0 allowed contacts to finally import.

Except a bunch that didn't (without indication of which ones).

As moso stated, any contacts with photos ("ENCODING=BASE64") fail to import.

In a text editor, after removing the photo data, still had some contacts fail to import.

Any contact with some data that has "ENCODING=QUOTED-PRINTABLE" also fails to import, so it's worthwhile searching for that.

@skjnldsv
Copy link
Member

We have indeed dropped support for <3.0 vcards, but it's supposed to show an error.
Int's also possible that some properties are not fully parsed and therefore could lead to issues. We're planning on movinf to a different vcard library that should fix those issues. Sorry for the inconvenience :)

@Tux12Fun
Copy link

Can see the same Problem here, try to import my Contacts. All VCards are 2.1 and have BASE64 Pictures.
Changing to Format 3.0 with a editor gives a
PUT https://...../nextcloud/remote.php/dav/addressbooks/users/.../contacts/897...3a2.vcf 415 (Unsopported Media Type)

Error: [$rootScope:infdig] ....
at angular.min.js:6
....
at Object.q [as forEach] (angular.min.js:7)
at notifyObservers (contact_service.js:28)
at contact_service.js:295
at

@laurent22
Copy link

Same problem here with Nextcloud 13.0.0 when importing a VCF file in Firefox 58.0.2

When I open the contact page it shows these errors and warnings (not sure if related):

image

Then when I import the file:

image

The page generally looks broken during the operation:

image

@GAS85
Copy link

GAS85 commented Mar 7, 2018

Basically dropping support of versions <3 makes CardDav sync useless for e.g. my Samsung A5 2016.

@Tux12Fun
Copy link

Same Problem with Samsung Galaxy S2

@jleaders
Copy link

I have the same issue

@elman22
Copy link

elman22 commented Apr 5, 2018

Same issue here. Can't import VERSION:2.1. NC 13.0.1.1

angular.js:14199:17
vf/this.$get</<
angular.js:10707:6
$apply
angular.js:18099:10
link/</</</</<
contactImport_directive.js:41:8
this.import
contact_service.js:277:5
link/</</</<
contactImport_directive.js:18:7
$eval
angular.js:17994:15
$apply
angular.js:18094:19
link/</</<
contactImport_directive.js:11:6

@dimmie
Copy link

dimmie commented Apr 18, 2018

Thanks to pard68 and others,
who pointed out that replacing /VERSION:2.1/VERSION:3.0/ would work. It effectively worked for me - but for three cards with UTF-8 encodings like

N;CHARSET=UTF-8;ENCODING=QUOTED-PRINTABLE:=4D=69=6E=61=6E=69;....

So I am happy after days of chasing for a solution to the issue, mine being a fresh nextcloud install.

I also have to question the decision of dropping support for vcf version 2.1, this last one being still widely in use in my world : Thunderbird and Android contacts. Please do not consider Contacts and Calender management as a corner case of nextcloud usage ...

And thanks for an otherwise quite useful product.

@mburnicki
Copy link

I'd also appreciate if VCF v2.1 support was not dropped.

@laurent22
Copy link

Probably VCF 2.1 support is simply broken, but not dropped since SabreDAV supports it.

@nd-
Copy link

nd- commented May 21, 2018

Same problem as @laurent22, javascript error, unable to import contacts.
Tested on FF 60 and Chrome 66, same javascript errors in the console.

@kangaroo72
Copy link

I also confirm on latest FF & Chrome Browsers ...

@nd-
Copy link

nd- commented May 22, 2018

I just edited my vcf files, find and replace "VERSION:2.1" with "VERSION:3.0", and it works now.

But now i have some carbook properties with "INTERNET=:" or "CELL=:"

I tried a mysql replace() in the oc_cards_properties table, but no luck, it seems these properties are stored in oc_cards, in the carddata BLOB.

In my vcf files, i have properties like "email;internet:[email protected]", is it an issue with 2.1/3.0 vcf format ?

@elman22
Copy link

elman22 commented May 22, 2018

Replacing header VERSION might work for some cases, but there are changes between 3.0 and 2.1 and parser does things slightly differently. Therefore you cannot expect to work this 100%. See for example https://pear.php.net/manual/en/package.fileformats.contact-vcard-build.intro.php

Proper 2.1 support would be welcomed.

@ja573
Copy link

ja573 commented Jun 12, 2018

Photos can be imported by being explicit about the media type and specifying encoding as "b":
replace PHOTO;ENCODING=BASE64;JPEG: with PHOTO;TYPE=JPEG;ENCODING=b: (the encoded picture remains the same)

@skjnldsv skjnldsv added 1. to develop Accepted and waiting to be taken care of good first issue Good for newcomers medium Medium priority and removed needs info Not enough information provided labels Jun 21, 2018
@skjnldsv skjnldsv changed the title vCard import broken vCard import broken: window.localStorage is null Jun 21, 2018
@skjnldsv skjnldsv mentioned this issue Aug 16, 2018
26 tasks
@skjnldsv skjnldsv added 2. developing Work in progress and removed 1. to develop Accepted and waiting to be taken care of labels Aug 22, 2018
@skjnldsv skjnldsv added this to the 3.0.0 milestone Aug 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2. developing Work in progress bug Something isn't working good first issue Good for newcomers medium Medium priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.