Author Topic: Unable access addressbook by roundcube/carddav plugin after up Nextcloud 17.0.3  (Read 2278 times)

Offline danjde

  • Newbie
  • *
  • Posts: 2
Hi friends,
I'm using Debian 9, Apache 2.4.25, PHP version 7.3, and Nextcloud version 17.0.3, Roundcube version 1.2.3, roundcube/carddav Plugin version 3.0.3  on own VPS.

I've upgraded PHP from 7.0 to 7.3, then I've upgraded Nextcloud from 15.x to 17.0.3, and now seems not possible to connect the Nextcloud address book with Roundcube, which previously occurred correctly.

I've open a support request to Nextcloud forum and write personally to the developer Michael Stilkerich, with no luck for now.

An NC forum user looking into this log,

Code: [Select]
[18-Feb-2020 11:41:37 Europe/Berlin] PHP Deprecated: Function create_function() is deprecated in /usr/share/roundcube/program/include/rcmail_output_html.php on line 978
write:

Quote
...seems as if this could be the solution. located in roundcube. dev of addressbook-app should have been aware of it


What do you think about?



Here other log:


Code: [Select]
tail -f /var/log/roundcube/carddav
[09-May-2019 17:17:45 +0200]: <tsa863m8> In migration: 0001-categories
[09-May-2019 17:17:45 +0200]: <tsa863m8> Found 1 matches
[09-May-2019 17:17:46 +0200]: <tsa863m8> In migration: 0002-increasetextfieldlengths
[09-May-2019 17:17:46 +0200]: <tsa863m8> Found 2 matches
[09-May-2019 17:17:46 +0200]: <tsa863m8> In migration: 0003-fixtimestampdefaultvalue
[09-May-2019 17:17:46 +0200]: <tsa863m8> Found 1 matches
[09-May-2019 17:17:46 +0200]: <tsa863m8> In migration: 0004-fixtimestampdefaultvalue
[09-May-2019 17:17:46 +0200]: <tsa863m8> Found 1 matches
[09-May-2019 17:17:46 +0200]: <tsa863m8> In migration: 0005-changemysqlut8toutf8mb4
[09-May-2019 17:17:46 +0200]: <tsa863m8> Found 47 matches
[17-Feb-2020 15:50:44 +0100]: <ikp7l2p8> DISCOVERY: (retrieve_addressbooks) SEARCHING https://www.example.org:443/cloud/remote.php/dav/addressbooks/users/%u/contacts/ (Depth: 0)
[17-Feb-2020 15:50:44 +0100]: <ikp7l2p8> DISCOVERY: (cdfopen) retrieve_addressbooks requesting https://www.example.org:443/cloud/remote.php/dav/addressbooks/users/myuser@example.org/contacts/ as user myuser@example.org [RL 5]
[17-Feb-2020 15:50:44 +0100]: <ikp7l2p8> BACKEND: (update_addressbook) UPDATE addressbook
[17-Feb-2020 15:51:09 +0100]: <ikp7l2p8> DISCOVERY: (cdfopen) Code: 401
[17-Feb-2020 15:51:09 +0100]: <ikp7l2p8> DISCOVERY: (cdfopen) success: array (
  'status' => 401,
  'headers' =>
  Httpful\Response\Headers::__set_state(array(
     'headers' =>
    array (
      'date' => 'Mon, 17 Feb 2020 14:50:44 GMT',
      'server' => 'Apache/2.4.25 (Debian)',
      'strict-transport-security' => 'max-age=15552000; includeSubDomains',
      'set-cookie' => 'nc_sameSiteCookiestrict=true; path=/cloud; httponly;secure; expires=Fri, 31-Dec-2100 23:59:59 GMT; SameSite=strict',
      'expires' => 'Thu, 19 Nov 1981 08:52:00 GMT',
      'cache-control' => 'no-store, no-cache, must-revalidate',
      'pragma' => 'no-cache',
      'content-security-policy' => 'default-src \'none\';',
      'x-frame-options' => 'SAMEORIGIN',
      'x-content-type-options' => 'nosniff',
      'x-xss-protection' => '1; mode=block',
      'x-robots-tag' => 'none',
      'x-download-options' => 'noopen',
      'x-permitted-cross-domain-policies' => 'none',
      'referrer-policy' => 'no-referrer',
      'content-length' => '299',
      'content-type' => 'application/xml; charset=utf-8',
    ),
  )),
  'body' => '<?xml version="1.0" encoding="utf-8"?>
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:o="http://owncloud.org/ns">
<s:exception>OCA\\DAV\\Connector\\Sabre\\Exception\\PasswordLoginForbidden</s:exception>
  <s:message/>
  <o:hint xmlns:o="o:">password login forbidden</o:hint>
</d:error>
',
)
[17-Feb-2020 15:51:09 +0100]: <ikp7l2p8> DISCOVERY: (retrieve_addressbooks) Searching additional URL: https://www.example.org:443/cloud/remote.php/dav/addressbooks/users/%u/contacts/
[17-Feb-2020 15:51:09 +0100]: <ikp7l2p8> DISCOVERY: (retrieve_addressbooks) SEARCHING https://www.example.org:443/cloud/remote.php/dav/addressbooks/users/%u/contacts/ (Depth: 1)
[17-Feb-2020 15:51:09 +0100]: <ikp7l2p8> DISCOVERY: (cdfopen) retrieve_addressbooks requesting https://www.example.org:443/cloud/remote.php/dav/addressbooks/users/myuser@example.org/contacts/ as user myuser@example.org [RL 5]
[17-Feb-2020 15:51:09 +0100]: <ikp7l2p8> BACKEND: (update_addressbook) UPDATE addressbook
[17-Feb-2020 15:51:34 +0100]: <ikp7l2p8> DISCOVERY: (cdfopen) Code: 401
[17-Feb-2020 15:51:34 +0100]: <ikp7l2p8> DISCOVERY: (cdfopen) success: array (
  'status' => 401,
  'headers' =>
  Httpful\Response\Headers::__set_state(array(
     'headers' =>
    array (
      'date' => 'Mon, 17 Feb 2020 14:51:09 GMT',
      'server' => 'Apache/2.4.25 (Debian)',
      'strict-transport-security' => 'max-age=15552000; includeSubDomains',
      'set-cookie' => 'nc_sameSiteCookiestrict=true; path=/cloud; httponly;secure; expires=Fri, 31-Dec-2100 23:59:59 GMT; SameSite=strict',
      'expires' => 'Thu, 19 Nov 1981 08:52:00 GMT',
      'cache-control' => 'no-store, no-cache, must-revalidate',
      'pragma' => 'no-cache',
      'content-security-policy' => 'default-src \'none\';',
      'x-frame-options' => 'SAMEORIGIN',
      'x-content-type-options' => 'nosniff',
      'x-xss-protection' => '1; mode=block',
      'x-robots-tag' => 'none',
      'x-download-options' => 'noopen',
      'x-permitted-cross-domain-policies' => 'none',
      'referrer-policy' => 'no-referrer',
      'content-length' => '299',
      'content-type' => 'application/xml; charset=utf-8',
    ),
  )),
  'body' => '<?xml version="1.0" encoding="utf-8"?>
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:o="http://owncloud.org/ns">
<s:exception>OCA\\DAV\\Connector\\Sabre\\Exception\\PasswordLoginForbidden</s:exception>
  <s:message/>
  <o:hint xmlns:o="o:">password login forbidden</o:hint>
</d:error>
',
)
[17-Feb-2020 15:51:34 +0100]: <ikp7l2p8> DISCOVERY: (retrieve_addressbooks) no principal URL found
[17-Feb-2020 15:51:34 +0100]: <ikp7l2p8> DISCOVERY: (retrieve_addressbooks) no principal URL found


and /var/log/roundcube/errors:

Code: [Select]
[18-Feb-2020 11:41:37 Europe/Berlin] PHP Warning:  count(): Parameter must be an array or an object that implements Countable in /usr/share/roundcube/program/lib/Roundcube/rcube_plugin_api.php on line 438
[18-Feb-2020 11:41:37 Europe/Berlin] PHP Deprecated:  Function create_function() is deprecated in /usr/share/roundcube/program/include/rcmail_output_html.php on line 978


And here NC log:

Code: [Select]
{"reqId":"Xku-PH8AAQEAAHpLH@wAAAAA","level":2,"time":"2020-02-18T10:41:26+00:00","remoteAddr":"1.23.456.78","user":"--","app":"core","method":"PROPFIND","url":"/cloud/remote.php/dav/addressbooks/users/myuser@example.org/contacts/","message":"Login failed: 'myuser@example.org' (Remote IP: '1.23.456.78')","userAgent":"RCM CardDAV plugin/3.0.3","version":"17.0.3.1","id":"5e4bc7359e187"}
Thanks for any help!


Davide

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,845
Try updating your version of Roundcube. Roundcube 1.2.3 was released 10 Mar 2017 while PHP 7.3 was released 06 Dec 2018.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and moreā€¦

Offline danjde

  • Newbie
  • *
  • Posts: 2
Hi JohnDoh and thanks for your help!
The problem has been understood and resolved.

The previous Nextcloud version (15.0.4) allowed DAV connection using "email user" as well as "username",
the new one (17.x.x) no, only "username".
This obviously created the authentication failure, since the plugin was configured to use the entire email.

Log:

Code: [Select]
<s:exception>OCA\\DAV\\Connector\\Sabre\\Exception\\PasswordLoginForbidden</s:exception>
  <s:message/>

The solution was to change how the plugin communicates the connection string and username, substituting on the general configuration "&u" with "&l"

here:

Code: [Select]
        // will be substituted for the roundcube username
        'username'     =>  '%l',

and there:

Code: [Select]
        // %u will be substituted for the CardDAV username
        'url'          =>  'https://server.example.org:443/cloud/remote.php/dav/addressbooks/users/%l/contacts/',

Ultimately,  all is well that ends well and the last one closes the door!
« Last Edit: February 19, 2020, 06:34:20 AM by danjde »