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

UnsupportedMediaType: HTTP/1.1 415 Validation error in vCard: The FN property must appear in the VCARD component exactly 1 time #206

Closed
enoch85 opened this issue May 4, 2017 · 30 comments
Labels
bug Something isn't working

Comments

@enoch85
Copy link
Member

enoch85 commented May 4, 2017

Steps to reproduce

  1. Setup sync with Lightning and Sogo Connector in Thunderbird
  2. Sync your calendar

Expected behaviour

No errors

Actual behaviour

See Nextcloud server log. Maybe just certain VCards but still...

Server configuration

Operating system:
Ubunt Server 16.04
Web server:
Apache 2.4
Database:
MySQL 5.7
PHP version:
7.0
Nextcloud version: (see Nextcloud admin page)
11.0.3
Contacts version: (see Nextcloud apps page)
1.5.3
Updated from an older Nextcloud or fresh install:
Updated since first version
Signing status:

No errors

List of activated apps:

Enabled:
  - activity: 2.4.1
  - calendar: 1.5.2
  - comments: 1.1.0
  - contacts: 1.5.3
  - dav: 1.1.1
  - federatedfilesharing: 1.1.1
  - federation: 1.1.1
  - files: 1.6.1
  - files_downloadactivity: 1.0.1
  - files_external: 1.1.2
  - files_pdfviewer: 1.0.1
  - files_sharing: 1.1.1
  - files_texteditor: 2.2
  - files_trashbin: 1.1.0
  - files_versions: 1.4.0
  - files_videoplayer: 1.0.0
  - firstrunwizard: 2.0
  - gallery: 16.0.0
  - logreader: 2.0.0
  - lookup_server_connector: 1.0.0
  - mail: 0.6.4
  - nextcloud_announcements: 1.0
  - notifications: 1.0.1
  - ocsms: 1.11.5
  - ownnote: 1.08
  - password_policy: 1.1.0
  - provisioning_api: 1.1.0
  - qownnotesapi: 17.3.0
  - richdocuments: 1.1.25
  - serverinfo: 1.1.1
  - sharebymail: 1.0.1
  - spreed: 1.2.0
  - survey_client: 0.1.5
  - systemtags: 1.1.3
  - templateeditor: 0.2
  - theming: 1.1.1
  - twofactor_backupcodes: 1.0.0
  - updatenotification: 1.1.1
  - workflowengine: 1.1.1
Disabled:
  - admin_audit
  - encryption
  - external
  - files_accesscontrol
  - files_automatedtagging
  - files_retention
  - user_external
  - user_ldap
  - user_saml

Nextcloud configuration:

{
    "system": {
        "updatechecker": false,
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "localhost",
            "192.168.4.111",
            "1.techandme.se",
            "2.techandme.se"
        ],
        "datadirectory": "\/var\/ncdata",
        "overwrite.cli.url": "https:\/\/1.techandme.se\/",
        "dbtype": "mysql",
        "version": "11.0.3.2",
        "dbname": "XXX_db",
        "dbhost": "localhost",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "logtimezone": "Europe\/Stockholm",
        "installed": true,
        "instanceid": "oc7aii0tkiol",
        "appstore.experimental.enabled": "true",
        "mail_smtpmode": "smtp",
        "mail_smtpauth": 1,
        "mail_smtpport": "587",
        "mail_smtphost": "smtp.gmail.com",
        "mail_smtpauthtype": "LOGIN",
        "mail_from_address": "no-reply",
        "mail_domain": "techandme.se",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "allowZipDownload": true,
        "session_lifetime": 1800,
        "forcessl": true,
        "logfile": "\/var\/log\/nfs-share\/nextcloud.log",
        "loglevel": 2,
        "preview_libreoffice_path": "\/usr\/bin\/libreoffice",
        "memcache.local": "\\OC\\Memcache\\Redis",
        "filelocking.enabled": true,
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "\/var\/run\/redis\/redis.sock",
            "port": 0,
            "timeout": 0,
            "dbindex": 0
        },
        "trusted_proxies": [
            [
                "192.168.4.201"
            ]
        ],
        "forwarded_for_headers": [
            "HTTP_X_FORWARDED",
            "HTTP_FORWARDED_FOR"
        ],
        "maintenance": false,
        "mail_smtpsecure": "tls",
        "htaccess.RewriteBase": "\/",
        "theme": "",
        "updater.release.channel": "stable",
        "mysql.utf8mb4": true
    }
}

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:
Chromium Version 58.0.3029.81 Built on Ubuntu , running on Ubuntu 17.04 (64-bit)
Operating system:
Ubuntu 17.07 Budgie (great OS btw)

CardDAV-clients:
Using Lightning and Sogo connector with Thunderbird like described in the documentation: https://docs.nextcloud.com/server/11/user_manual/pim/sync_thunderbird.html

Logs

Nextcloud log (data/nextcloud.log)

Fatal	webdav	Sabre\DAV\Exception\UnsupportedMediaType: HTTP/1.1 415 Validation error in vCard: The FN property must appear in the VCARD component exactly 1 time
/var/www/nextcloud/3rdparty/sabre/dav/lib/CardDAV/Plugin.php - line 316: Sabre\CardDAV\Plugin->validateVCard('BEGIN VCARD\r\nVE...', false)
[internal function] Sabre\CardDAV\Plugin->beforeCreateFile('addressbooks/us...', 'BEGIN VCARD\r\nVE...', Object(OCA\DAV\CardDAV\AddressBook), false)
/var/www/nextcloud/3rdparty/sabre/event/lib/EventEmitterTrait.php - line 105: call_user_func_array(Array, Array)
/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 1070: Sabre\Event\EventEmitter->emit('beforeCreateFil...', Array)
/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php - line 525: Sabre\DAV\Server->createFile('addressbooks/us...', 'BEGIN VCARD\r\nVE...', NULL)
[internal function] Sabre\DAV\CorePlugin->httpPut(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
/var/www/nextcloud/3rdparty/sabre/event/lib/EventEmitterTrait.php - line 105: call_user_func_array(Array, Array)
/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 479: Sabre\Event\EventEmitter->emit('method PUT', Array)
/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 254: Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
/var/www/nextcloud/apps/dav/lib/Server.php - line 231: Sabre\DAV\Server->exec()
/var/www/nextcloud/apps/dav/appinfo/v2/remote.php - line 31: OCA\DAV\Server->exec()
/var/www/nextcloud/remote.php - line 165: require_once('/var/www/nextcl...')
{main}
2017-05-03T20:57:42+0200
Fatal	webdav	Sabre\DAV\Exception\UnsupportedMediaType: HTTP/1.1 415 Validation error in vCard: The FN property must appear in the VCARD component exactly 1 time
/var/www/nextcloud/3rdparty/sabre/dav/lib/CardDAV/Plugin.php - line 316: Sabre\CardDAV\Plugin->validateVCard('BEGIN VCARD\r\nVE...', false)
[internal function] Sabre\CardDAV\Plugin->beforeCreateFile('addressbooks/us...', 'BEGIN VCARD\r\nVE...', Object(OCA\DAV\CardDAV\AddressBook), false)
/var/www/nextcloud/3rdparty/sabre/event/lib/EventEmitterTrait.php - line 105: call_user_func_array(Array, Array)
/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 1070: Sabre\Event\EventEmitter->emit('beforeCreateFil...', Array)
/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php - line 525: Sabre\DAV\Server->createFile('addressbooks/us...', 'BEGIN VCARD\r\nVE...', NULL)
[internal function] Sabre\DAV\CorePlugin->httpPut(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
/var/www/nextcloud/3rdparty/sabre/event/lib/EventEmitterTrait.php - line 105: call_user_func_array(Array, Array)
/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 479: Sabre\Event\EventEmitter->emit('method PUT', Array)
/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 254: Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
/var/www/nextcloud/apps/dav/lib/Server.php - line 231: Sabre\DAV\Server->exec()
/var/www/nextcloud/apps/dav/appinfo/v2/remote.php - line 31: OCA\DAV\Server->exec()
/var/www/nextcloud/remote.php - line 165: require_once('/var/www/nextcl...')
{main}
2017-05-03T20:57:41+0200
Fatal	webdav	Sabre\DAV\Exception\UnsupportedMediaType: HTTP/1.1 415 Validation error in vCard: The FN property must appear in the VCARD component exactly 1 time
/var/www/nextcloud/3rdparty/sabre/dav/lib/CardDAV/Plugin.php - line 316: Sabre\CardDAV\Plugin->validateVCard('BEGIN VCARD\r\nVE...', false)
[internal function] Sabre\CardDAV\Plugin->beforeCreateFile('addressbooks/us...', 'BEGIN VCARD\r\nVE...', Object(OCA\DAV\CardDAV\AddressBook), false)
/var/www/nextcloud/3rdparty/sabre/event/lib/EventEmitterTrait.php - line 105: call_user_func_array(Array, Array)
/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 1070: Sabre\Event\EventEmitter->emit('beforeCreateFil...', Array)
/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php - line 525: Sabre\DAV\Server->createFile('addressbooks/us...', 'BEGIN VCARD\r\nVE...', NULL)
[internal function] Sabre\DAV\CorePlugin->httpPut(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
/var/www/nextcloud/3rdparty/sabre/event/lib/EventEmitterTrait.php - line 105: call_user_func_array(Array, Array)
/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 479: Sabre\Event\EventEmitter->emit('method PUT', Array)
/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 254: Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
/var/www/nextcloud/apps/dav/lib/Server.php - line 231: Sabre\DAV\Server->exec()
/var/www/nextcloud/apps/dav/appinfo/v2/remote.php - line 31: OCA\DAV\Server->exec()
/var/www/nextcloud/remote.php - line 165: require_once('/var/www/nextcl...')
{main}
2017-05-03T20:57:41+0200
@enoch85 enoch85 added the bug Something isn't working label May 4, 2017
@worric
Copy link

worric commented May 9, 2017

Just wanted to say that I'm facing this problem as well. I have the exact same setup except with Win10 clients w/ TB, Lightning and SoGo.

@enoch85
Copy link
Member Author

enoch85 commented May 10, 2017

@worric Thanks for confirming.

cc @irgendwie

@irgendwie
Copy link
Member

It seems like both of you have contacts with multiple FN (full name) properties specified, which leads to the error - specifying multiple FN in a vcard is not allowed.

Sync your [contacts]

@enoch85 I see PUT requests in the nextcloud log - are you trying to first time sync your contacts, or push new contacts onto the server?

@irgendwie irgendwie added the needs info Not enough information provided label May 10, 2017
@enoch85
Copy link
Member Author

enoch85 commented May 10, 2017

@irgendwie Thunderbird (Sogo plugin) tries to push to the server once an hour. That's where the PUT comes from. I'll double check my contacts and get back to you.

@enoch85
Copy link
Member Author

enoch85 commented May 10, 2017

Ok, so this is what most of my contacts look like:

screenshot from 2017-05-10 20-09-58
screenshot from 2017-05-10 20-10-24

Is it allowed on both cases?

@irgendwie
Copy link
Member

@enoch85 Could you export the address book in thunderbird and check the produced file (it just contains all vcards separated by newlines) and see if there is one contact with a double FN property?

@enoch85
Copy link
Member Author

enoch85 commented May 10, 2017

FN:Ian Vaughn (Sonata Software North America)
FN:Shilpa Hegde (Sonata Software North America)
FN:Göbel\, Oliver
FN:OMG - Victor Ferreres

Could it be these --^ that cause errors?

@irgendwie
Copy link
Member

irgendwie commented May 10, 2017

sorry, I mean contacts which have multiple FN entries and not one FN entry with multiple names
Additionally, do you have contacts, which don't have an FN property set? This could also be a problem,
since the standard requires the FN property to be set.

@enoch85
Copy link
Member Author

enoch85 commented May 10, 2017

I have several with nothing set. Will remove them and see what happens

@enoch85
Copy link
Member Author

enoch85 commented May 10, 2017

Yup, seems like that solved it. Sorry for the noise.

@enoch85 enoch85 closed this as completed May 10, 2017
@enoch85 enoch85 removed the bug Something isn't working label May 10, 2017
@irgendwie
Copy link
Member

@worric I assume it is a similar thing in your case - do you mind to check?

@worric
Copy link

worric commented May 13, 2017

I've been experimenting a bit, and it seems I see the problem whenever a new contact is automatically added to the Nextcloud-synced address book via the "automatically add outgoing e-mails addresses to my..."-functionality. In that case, TB only adds the email address to the contact and leaves the Display Name (the FN property) empty.

@enoch85
Copy link
Member Author

enoch85 commented May 13, 2017

@worric Yes, that's exactly what happens.

@enoch85
Copy link
Member Author

enoch85 commented Jun 16, 2017

Filed a bug report with Mozilla: https://bugzilla.mozilla.org/show_bug.cgi?id=1373576

@lars-sh
Copy link

lars-sh commented Jul 10, 2017

You might be interested in https://github.com/fruux/sabre-vobject/pull/384

@enoch85
Copy link
Member Author

enoch85 commented Jul 10, 2017

@lars-sh Great stuff! So this will stop spamming my log if implemented?

@lars-sh
Copy link

lars-sh commented Jul 10, 2017

That patch just uses the EMAIL field of such VCards as another fallback and keeps your logs clean.

@irgendwie How are you going to implement 3rdparty patches? As you see I created a pull request for sabre-vobject. Shall I create another one for https://github.com/nextcloud/3rdparty or do you update from time to time?

@enoch85 enoch85 added bug Something isn't working downstream and removed needs info Not enough information provided labels Jul 10, 2017
@enoch85 enoch85 reopened this Jul 10, 2017
evert pushed a commit to sabre-io/vobject that referenced this issue Jul 11, 2017
* Added VCard without FN fallback

see nextcloud/contacts#206

* Added tests for VCard with EMAIL fallback

* Fixed broken test
@enoch85
Copy link
Member Author

enoch85 commented Jul 12, 2017

@irgendwie So, now when https://github.com/fruux/sabre-vobject/pull/384 is , can we finally fix this?

@skjnldsv
Copy link
Member

skjnldsv commented Jul 25, 2017

But it's against the rfc rules right?
I mean evert can decide to add an org and email fallback but this doesn't change the fact that the rfc docs require only one FN property? 🤔

EDIT: yeah, he's just adding a fn field as fallback, I misread, my bad. That's the proper way to do :)

@enoch85
Copy link
Member Author

enoch85 commented Jul 25, 2017

Switched to using CardBook in Thunderbird instead and the error is gone. But still, SOGO is recomended in the Docs so I think many users have this spamming error. Would be nice with a fix.

@skjnldsv
Copy link
Member

skjnldsv commented Jul 25, 2017

SOGO?
We need @evert to publish a new release to update our submodule :)
fruux/sabre-vobject@4.1.2...master

@enoch85
Copy link
Member Author

enoch85 commented Jul 25, 2017

@skjnldsv nextcloud/documentation#529

@skjnldsv
Copy link
Member

Thanks :)

@skjnldsv
Copy link
Member

Is this still relevant to the contacts app then?
@enoch85 ?

@enoch85
Copy link
Member Author

enoch85 commented Sep 15, 2017

Yes, as the error will still appear for everyone that doesn't run CardBook.

@skjnldsv
Copy link
Member

I honestly don't know what we can do here! :p

@lars-sh
Copy link

lars-sh commented Oct 18, 2017

@skjnldsv Release is available now, see https://github.com/sabre-io/vobject/releases/tag/4.1.3

@buttle
Copy link

buttle commented Feb 19, 2018

Hi, I've just discovered the log fill with this error. My nextcloud instance and apps are all up to date.

Sabre\DAV\Exception\UnsupportedMediaType: Validation error in vCard: The FN property must appear in the VCARD component exactly 1 time

Do I need to open an new Issue for this?

Cheers.

@enoch85
Copy link
Member Author

enoch85 commented Feb 19, 2018

@buttle Use Cardbook if you use Thunderbird, that solved my issue. Please read the above comments.

@buttle
Copy link

buttle commented Feb 19, 2018

@enoch85 Tomorrow I'll do that. I'll get back if it doesn't work ;)
Thank you Daniel.

armetiz pushed a commit to armetiz/sabre-vobject that referenced this issue Jun 2, 2020
* Added VCard without FN fallback

see nextcloud/contacts#206

* Added tests for VCard with EMAIL fallback

* Fixed broken test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants