Skip to content

vCard import broken: window.localStorage is null #433

Closed

Description

@schnittchen

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

Activity

  1. Henni commented on Nov 9, 2017

    @Henni
    Member

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

  2. added
    bugSomething isn't working
    needs infoNot enough information provided
    on Nov 9, 2017
  3. whathome commented on Nov 12, 2017

    @whathome

    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
    
  4. whathome commented on Nov 12, 2017

    @whathome

    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.

  5. Henni commented on Nov 12, 2017

    @Henni
    Member

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

  6. whathome commented on Nov 12, 2017

    @whathome

    Firefox 56.0.2, OSX

  7. memen45 commented on Nov 22, 2017

    @memen45

    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

  8. skjnldsv commented on Nov 23, 2017

    @skjnldsv
    Member

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

  9. memen45 commented on Nov 23, 2017

    @memen45
  10. skjnldsv commented on Nov 23, 2017

    @skjnldsv
    Member

    Mostly the browser log then. :)

  11. memen45 commented on Nov 23, 2017

    @memen45

    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)

  12. paraqles commented on Nov 27, 2017

    @paraqles

    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
    
  13. skjnldsv commented on Nov 29, 2017

    @skjnldsv
    Member

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

  14. ispringle commented on Dec 2, 2017

    @ispringle

    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.

  15. 20 remaining items

  16. laurent22 commented on Apr 18, 2018

    @laurent22

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

  17. nd- commented on May 21, 2018

    @nd-

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

  18. kangaroo72 commented on May 22, 2018

    @kangaroo72

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

  19. nd- commented on May 22, 2018

    @nd-

    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 ?

  20. elman22 commented on May 22, 2018

    @elman22

    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.

  21. ja573 commented on Jun 12, 2018

    @ja573

    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)

  22. added
    1. to developAccepted and waiting to be taken care of
    mediumMedium priority
    and removed
    needs infoNot enough information provided
    on Jun 21, 2018
  23. changed the title [-]vCard import broken[/-] [+]vCard import broken: window.localStorage is null[/+] on Jun 21, 2018
  24. added and removed
    1. to developAccepted and waiting to be taken care of
    on Aug 22, 2018
  25. added this to the 3.0.0 milestone on Aug 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions