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

Conact not moved to second address book #583

Closed
realthargor opened this issue Jul 24, 2018 · 6 comments
Closed

Conact not moved to second address book #583

realthargor opened this issue Jul 24, 2018 · 6 comments
Labels
needs info Not enough information provided

Comments

@realthargor
Copy link

realthargor commented Jul 24, 2018

Steps to reproduce

  1. Create second address book
  2. Open a contact
  3. Select the new address book in pull down of contact

Expected behaviour

Contact is move to the new address book

Actual behaviour

Server returns 400 and contact is not moved.

Server configuration detail

Operating system: Linux 4.9.0-6-amd64 #1 SMP Debian 4.9.82-1+deb9u3 (2018-03-02) x86_64

Webserver: nginx/1.13.5 (fpm-fcgi)

Database: mysql 10.2.14

PHP version: 7.1.16
Modules loaded: Core, date, libxml, openssl, pcre, sqlite3, zlib, ctype, curl, dom, fileinfo, filter, ftp, hash, iconv, json, mbstring, SPL, PDO, session, posix, readline, Reflection, standard, SimpleXML, pdo_sqlite, Phar, tokenizer, xml, xmlreader, xmlwriter, mysqlnd, cgi-fcgi, apcu, exif, gd, intl, ldap, mcrypt, memcached, mysqli, pcntl, pdo_mysql, pdo_pgsql, pgsql, redis, zip, Zend OPcache

Nextcloud version: 13.0.1 - 13.0.1.1

Updated from an older Nextcloud/ownCloud or fresh install:

Where did you install Nextcloud from: unknown

Signing status

Array

List of activated apps
Enabled:
 - activity: 2.6.1
 - admin_audit: 1.3.0
 - calendar: 1.6.1
 - comments: 1.3.0
 - contacts: 2.1.5
 - dav: 1.4.6
 - deck: 0.3.1
 - federatedfilesharing: 1.3.1
 - federation: 1.3.0
 - files: 1.8.0
 - files_external: 1.4.1
 - files_markdown: 2.0.4
 - files_pdfviewer: 1.2.0
 - files_sharing: 1.5.0
 - files_texteditor: 2.5.1
 - files_trashbin: 1.3.0
 - files_versions: 1.6.0
 - files_videoplayer: 1.2.0
 - firstrunwizard: 2.2.1
 - gallery: 18.0.0
 - issuetemplate: 0.3.0
 - logreader: 2.0.0
 - lookup_server_connector: 1.1.0
 - mail: 0.7.10
 - nextcloud_announcements: 1.2.0
 - notes: 2.3.2
 - notifications: 2.1.2
 - oauth2: 1.1.0
 - ocdownloader: 1.5.6
 - password_policy: 1.3.0
 - provisioning_api: 1.3.0
 - serverinfo: 1.3.0
 - sharebymail: 1.3.0
 - survey_client: 1.1.0
 - systemtags: 1.3.0
 - tasks: 0.9.6
 - theming: 1.4.1
 - twofactor_backupcodes: 1.2.3
 - updatenotification: 1.3.0
 - user_external: 0.4
 - workflowengine: 1.3.0
Disabled:
 - bruteforcesettings
 - encryption
 - richdocuments
 - user_ldap

Configuration (config/config.php)
{
    "passwordsalt": "***REMOVED SENSITIVE VALUE***",
    "datadirectory": "***REMOVED SENSITIVE VALUE***",
    "dbtype": "mysql",
    "version": "13.0.1.1",
    "dbname": "***REMOVED SENSITIVE VALUE***",
    "dbhost": "***REMOVED SENSITIVE VALUE***",
    "dbtableprefix": "oc_",
    "dbuser": "***REMOVED SENSITIVE VALUE***",
    "dbpassword": "***REMOVED SENSITIVE VALUE***",
    "installed": true,
    "instanceid": "***REMOVED SENSITIVE VALUE***",
    "theme": "",
    "maintenance": false,
    "forcessl": true,
    "trusted_domains": [
        "XXXXX"
    ],
    "share_folder": "\/Shared",
    "mail_smtpmode": "php",
    "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
    "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
    "mail_from_address": "***REMOVED SENSITIVE VALUE***",
    "mail_domain": "***REMOVED SENSITIVE VALUE***",
    "secret": "***REMOVED SENSITIVE VALUE***",
    "singleuser": false,
    "loglevel": 0,
    "apps_paths": [
        {
            "path": "\/var\/www\/html\/apps",
            "url": "\/apps",
            "writable": false
        },
        {
            "path": "\/var\/www\/html\/custom_apps",
            "url": "\/custom_apps",
            "writable": true
        }
    ],
    "overwrite.cli.url": "http:\/\/localhost:8080",
    "app.mail.accounts.default": {
        ...
    }
}

Client configuration

Browser: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:61.0) Gecko/20100101 Firefox/61.0

Operating system:

Logs

Nextcloud log
Sabre\DAV\Exception\BadRequest: Calendar object with uid already exists in this calendar collection.

    /var/www/html/apps/dav/lib/CalDAV/BirthdayService.php - line 309: OCA\DAV\CalDAV\CalDavBackend->createCalendarObject('27', 'Gemeinsam-e30b6...', 'BEGIN VCALENDAR...')
    /var/www/html/apps/dav/lib/CalDAV/BirthdayService.php - line 99: OCA\DAV\CalDAV\BirthdayService->updateCalendar('e30b677df0.vcf', 'BEGIN VCARD\r\nVE...', Array, '27', Array)
    /var/www/html/apps/dav/lib/AppInfo/Application.php - line 119: OCA\DAV\CalDAV\BirthdayService->onCardChanged('11', 'e30b677df0.vcf', 'BEGIN VCARD\r\nVE...')
    [internal function] OCA\DAV\AppInfo\Application->OCA\DAV\AppInfo\{closure}(*** sensitive parameters replaced ***)
    /var/www/html/3rdparty/symfony/event-dispatcher/EventDispatcher.php - line 212: call_user_func(Object(Closure), Object(Symfony\Component\EventDispatcher\GenericEvent), '\\OCA\\DAV\\CardDA...', Object(Symfony\Component\EventDispatcher\EventDispatcher))
    /var/www/html/3rdparty/symfony/event-dispatcher/EventDispatcher.php - line 44: Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(Array, '\\OCA\\DAV\\CardDA...', Object(Symfony\Component\EventDispatcher\GenericEvent))
    /var/www/html/apps/dav/lib/CardDAV/CardDavBackend.php - line 633: Symfony\Component\EventDispatcher\EventDispatcher->dispatch('\\OCA\\DAV\\CardDA...', Object(Symfony\Component\EventDispatcher\GenericEvent))
    /var/www/html/3rdparty/sabre/dav/lib/CardDAV/AddressBook.php - line 144: OCA\DAV\CardDAV\CardDavBackend->createCard('11', 'e30b677df0.vcf', 'BEGIN VCARD\r\nVE...')
    /var/www/html/3rdparty/sabre/dav/lib/DAV/Tree.php - line 314: Sabre\CardDAV\AddressBook->createFile('e30b677df0.vcf', 'BEGIN VCARD\r\nVE...')
    /var/www/html/3rdparty/sabre/dav/lib/DAV/Tree.php - line 130: Sabre\DAV\Tree->copyNode(Object(Sabre\CardDAV\Card), Object(OCA\DAV\CardDAV\AddressBook), 'e30b677df0.vcf')
    /var/www/html/3rdparty/sabre/dav/lib/DAV/Tree.php - line 161: Sabre\DAV\Tree->copy('addressbooks/us...', 'addressbooks/us...')
    /var/www/html/3rdparty/sabre/dav/lib/DAV/CorePlugin.php - line 642: Sabre\DAV\Tree->move('addressbooks/us...', 'addressbooks/us...')
    [internal function] Sabre\DAV\CorePlugin->httpMove(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
    /var/www/html/3rdparty/sabre/event/lib/EventEmitterTrait.php - line 105: call_user_func_array(Array, Array)
    /var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php - line 479: Sabre\Event\EventEmitter->emit('method MOVE', Array)
    /var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php - line 254: Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
    /var/www/html/apps/dav/lib/Server.php - line 283: Sabre\DAV\Server->exec()
    /var/www/html/apps/dav/appinfo/v2/remote.php - line 35: OCA\DAV\Server->exec()
    /var/www/html/remote.php - line 164: require_once('/var/www/html/a...')
    {main}
Browser log
MOVE /remote.php/dav/addressbooks/users/XXXX/contacts/XXXXX.vcf HTTP/1.1
Host: XXXX
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:61.0) Gecko/20100101 Firefox/61.0
Accept: */*
Accept-Language: de-DE,en-GB;q=0.5
Accept-Encoding: gzip, deflate, br
Content-Type: application/xml;charset=utf-8
Destination: https://nextcloud.XXXXX/remote.php/dav/addressbooks/users/XXXX/XXX/e30b677df0.vcf
requesttoken: XXXXX
Cookie: cookie_test=test; __Host-nc_sameSiteCookielax=true; __Host-nc_sameSiteCookiestrict=true; 50553094051fd=2e4890dd91dbd774f6ee84c8fdc417b1; oc_sessionPassphrase=XXX
Authorization: XXXX
Connection: keep-alive
HTTP/2.0 400 Bad Request
cache-control: no-store, no-cache, must-revalidate
content-security-policy: default-src 'none';
content-type: application/xml; charset=utf-8
date: Tue, 24 Jul 2018 18:07:11 GMT
expires: Thu, 19 Nov 1981 08:52:00 GMT
pragma: no-cache
server: nginx/1.13.5
x-frame-options: SAMEORIGIN
x-powered-by: PHP/7.1.16
content-length: 262
X-Firefox-Spdy: h2

<?xml version="1.0" encoding="utf-8"?>
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
  <s:exception>Sabre\DAV\Exception\BadRequest</s:exception>
  <s:message>Calendar object with uid already exists in this calendar collection.</s:message>
</d:error>
@nextcloud-bot
Copy link
Member

GitMate.io thinks possibly related issues are #171 (Add possibility to create virtual address book), #174 (contact is deleted after move to read only address book), #494 (disable shared address book does not work), #507 (Contact could not be saved if both birthday and date of birth given), and #571 (Move Contact to Different Addressbook Fails in Calendar Birthdays).

@skjnldsv
Copy link
Member

Hello :)
Are you sure the contacts does not already exists in the second addressbook?

@skjnldsv skjnldsv added the needs info Not enough information provided label Jul 25, 2018
@realthargor
Copy link
Author

@skjnldsv hm, you are right. They already exist.
And moving a new test-contact between addressbook A and B works perfect.

Leaves the question why the first move from A to B did not remove them from addressbook A?
I created and moved all via the contact-app UI and did it again since the UI still showed adressbook A as storage.
Also there probably is not way to delete them just from one of the addressbooks and fix this now.

@skjnldsv
Copy link
Member

The method used is supposed to me a MOVE command, so it should not still be here.

@realthargor
Copy link
Author

Just clean everything and tried it again. Same result. Some contacts are move, some are not and just created:

  1. Moves do not always complete
  2. If a move doesn't complete no error is shown and the contact ends up in 2 addressbooks
  3. if the move fails with a 400 no error is reported to the user

Still the underlying problem could "just" be some kind of angular-app state problem?

@skjnldsv
Copy link
Member

skjnldsv commented Oct 1, 2018

Duplicate of #644
Basically a permission problem.
One of the addressbook is in read-only and you cannot move, so the contact is copied and not moved :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs info Not enough information provided
Projects
None yet
Development

No branches or pull requests

3 participants