Carddav error: Undefined offset: 0

Get help from the community here.

Moderator: Developers

rieCoh7z
Posts: 6
Joined: Mon May 11, 2020 9:22 am

Carddav error: Undefined offset: 0

Postby rieCoh7z » Mon May 11, 2020 9:38 am

I have set up the carddav server. I am getting an http 500 "Internal Server Error" response and the following output, eg, using curl:

[pre]
$ curl --user name:password https://domain/carddav/addressbooks/name/N/
<?xml version="1.0" encoding="utf-8"?>
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
<s:sabredav-version>3.2.2</s:sabredav-version>
<s:exception>ErrorException</s:exception>
<s:message>Undefined offset: 0</s:message>
</d:error>
[/pre]


There is no corresponding output in the apache2 error.log. "log_errors=on" is set in php.ini.

The url level above, ie "https://domain/carddav/addressbooks/name/", responds as expected,
If 'N' is set to be a number that is not an addressbook I get, eg, "Addressbook with name '5' could not be found", so definitely the carddav server is there but is throwing an error.

Groupoffice 6.4.138-php-70 is running on Debian 9.12.
Thank you.
rieCoh7z
Posts: 6
Joined: Mon May 11, 2020 9:22 am

Re: Carddav error: Undefined offset: 0

Postby rieCoh7z » Mon May 11, 2020 11:35 am

[log][go\core\ErrorHandler:118] ErrorHandler:errorHandler called 8
[log][go\core\App:48]
ErrorException: Undefined offset: 0 in /usr/share/groupoffice/vendor/sabre/vobject/lib/Property/Text.php:214
Stack trace:
#0 /usr/share/groupoffice/vendor/sabre/vobject/lib/Property/Text.php(214): go\core\ErrorHandler::errorHandler(8, 'Undefined offse...', '/usr/share/grou...', 214, Array)
#1 /usr/share/groupoffice/vendor/sabre/vobject/lib/Component.php(331): Sabre\VObject\Property\Text->serialize()
#2 /usr/share/groupoffice/go/modules/community/addressbook/convert/VCard.php(142): Sabre\VObject\Component->serialize()
#3 /usr/share/groupoffice/go/modules/community/carddav/Backend.php(169): go\modules\community\addressbook\convert\VCard->export(Object(go\modules\community\addressbook\model\Contact))
#4 /usr/share/groupoffice/go/modules/community/carddav/Backend.php(190): go\modules\community\carddav\Backend->generateCards(3)
#5 /usr/share/groupoffice/vendor/sabre/dav/lib/CardDAV/AddressBook.php(80): go\modules\community\carddav\Backend->getCards(3)
#6 /usr/share/groupoffice/vendor/sabre/dav/lib/DAV/Tree.php(195): Sabre\CardDAV\AddressBook->getChildren()
#7 /usr/share/groupoffice/vendor/sabre/dav/lib/DAV/Server.php(899): Sabre\DAV\Tree->getChildren('addressbooks/ja...')
#8 /usr/share/groupoffice/vendor/sabre/dav/lib/DAV/Server.php(978): Sabre\DAV\Server->generatePathNodes(Object(Sabre\DAV\PropFind), Array)
#9 [internal function]: Sabre\DAV\Server->getPropertiesIteratorForPath('addressbooks/ja...', Array, 1)
#10 /usr/share/groupoffice/vendor/sabre/dav/lib/DAV/Server.php(940): iterator_to_array(Object(Generator))
#11 /usr/share/groupoffice/vendor/sabre/dav/lib/DAV/Server.php(825): Sabre\DAV\Server->getPropertiesForPath('addressbooks/ja...', Array, 1)
#12 /usr/share/groupoffice/vendor/sabre/dav/lib/DAV/Browser/Plugin.php(276): Sabre\DAV\Server->getPropertiesForChildren('addressbooks/ja...', Array)
#13 /usr/share/groupoffice/vendor/sabre/dav/lib/DAV/Browser/Plugin.php(139): Sabre\DAV\Browser\Plugin->generateDirectoryIndex('addressbooks/ja...')
#14 [internal function]: Sabre\DAV\Browser\Plugin->httpGet(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
#15 /usr/share/groupoffice/vendor/sabre/event/lib/EventEmitterTrait.php(105): call_user_func_array(Array, Array)
#16 /usr/share/groupoffice/vendor/sabre/dav/lib/DAV/Server.php(479): Sabre\Event\EventEmitter->emit('method:GET', Array)
#17 /usr/share/groupoffice/vendor/sabre/dav/lib/DAV/Server.php(254): Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
#18 /usr/share/groupoffice/go/modules/community/carddav/index.php(76): Sabre\DAV\Server->exec()
#19 /usr/share/groupoffice/modules/carddav/addressbook.php(2): require('/usr/share/grou...')
#20 {main}
rob
Posts: 48
Joined: Thu Feb 18, 2010 4:51 pm

Re: Carddav error: Undefined offset: 0

Postby rob » Mon May 11, 2020 12:22 pm

Hello rieCoh7z, I have inserted in my Apache config aliases for caldav and carddav such as:

Alias /carddav /var/www/go/modules/carddav/addressbook.php
Alias /caldav /var/www/go/modules/caldav/calendar.php

Makes it much easier to connect to the DAV-interface

Then you can go to the appropriate sabre interface via browser:

https://your.goserver/carddav/

and see directly which collections, nodes and addressbooks the sabre interface offers.

Hope it helps
greeting rob
rieCoh7z
Posts: 6
Joined: Mon May 11, 2020 9:22 am

Re: Carddav error: Undefined offset: 0

Postby rieCoh7z » Mon May 11, 2020 1:15 pm

Hello,
It's using the /carddav/ alias and yes I can browse to the root of the address books, I used curl (above) to make the error report simple. It all looks fine until the to last level, I start at https://domain/carddav/ and descend to addressbooks/username, then under "Nodes" there is the number with the link of the actual address book data, that is one picked up by Thunderbird as the location URL, that is the one that gives the http 500 error. If I had nothing I might presume I had not engaged the dav modules or not set for synchronsed sharing - but I have.
rieCoh7z
Posts: 6
Joined: Mon May 11, 2020 9:22 am

Re: Carddav error: Undefined offset: 0

Postby rieCoh7z » Mon May 11, 2020 1:42 pm

There is another address book error, it could be related... or not...

If I import vcard version 2.1 although it correctly imports it I can't then export it. If I delete the records that are imported as 2.1 I can then export vcard. Edit the vcard file and just swap 2.1 with 3.0 (no other format change) I can import and then export again. None for this makes the carddav export/sync work but importing as 2.1 might have left a problem that causes it to fail, even when the address book is deleted and remade
rob
Posts: 48
Joined: Thu Feb 18, 2010 4:51 pm

Re: Carddav error: Undefined offset: 0

Postby rob » Tue May 12, 2020 6:11 am

Hello,
descend to addressbooks/username, then under "Nodes" there is the number with the link of the actual addressbook data
Can you see in your browser there the different *.vcf files?
Or do you get at this point error 500 too?

I can see there all my VCF's and then in Thunderbird it can be imported by "CardBook-Plugin" (not the implemented "Adressbook").

Greetings rob
rieCoh7z
Posts: 6
Joined: Mon May 11, 2020 9:22 am

Re: Carddav error: Undefined offset: 0

Postby rieCoh7z » Tue May 12, 2020 9:06 am

rob wrote:
Tue May 12, 2020 6:11 am
descend to addressbooks/username, then under "Nodes" there is the number with the link of the actual addressbook data
Can you see in your browser there the different *.vcf files?
Or do you get at this point error 500 too?
It can't get to the .vcf page. The one above gives the 500 and "Undefined offset: 0", the URL that ends with /carddav/addressbooks/$user/, to the left of "Collection, Address book" the number with the link, click the link and get the error. Or watch the web logs for 500 when using TB.
rob
Posts: 48
Joined: Thu Feb 18, 2010 4:51 pm

Re: Carddav error: Undefined offset: 0

Postby rob » Tue May 12, 2020 10:17 am

Hi,
should show like this:

Bildschirminhalt erfassen-1.jpg
Bildschirminhalt erfassen-1.jpg (10.35 KiB) Viewed 550 times
Bildschirminhalt erfassen-2.jpg
Bildschirminhalt erfassen-2.jpg (17.87 KiB) Viewed 550 times

If not, your vcf-import or -conversion is not ok!
The path on Debian is /var/lib/groupoffice/data ... - and some inscrutable foldernames -...

Greetings rob
rieCoh7z
Posts: 6
Joined: Mon May 11, 2020 9:22 am

Re: Carddav error: Undefined offset: 0

Postby rieCoh7z » Tue May 12, 2020 10:23 am

It's not OK, it gives http 500, that's why I'm here.

A 500 response is a bug by definition, however there may be a workaround or it would help to solve the bug if we can find the cause.

Who is online

Users browsing this forum: No registered users and 3 guests

cron