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

400 Bad Request beim Zugriff auf Carddav-Server #217

Closed
pmsh2020 opened this issue Oct 8, 2020 · 7 comments
Closed

400 Bad Request beim Zugriff auf Carddav-Server #217

pmsh2020 opened this issue Oct 8, 2020 · 7 comments

Comments

@pmsh2020
Copy link

pmsh2020 commented Oct 8, 2020

Hallo,
ich nutze Ubuntu, 20.04.1 LTS, Firefox und ein Synology-NAS DS211j , DSM-Version 6.2.3-25426 Update 2 mit Carddav-Server 6.0.9.-0087. Carddav2FB neu installiert. Beim Ausführen von "./carddav2fb run" erhalte ich folgende FM:

"In RequestException.php line 111:
Client error: REPORT http://192.168.178.30:8008/addressbooks/users/Martin/addressbook/ resulted in a 400 Bad Request response: <title>Bad Request</title>

Bad Request

CARDDAV:filter required

"

Über Firefox komme ich mit der Server-URL + #username# + #userpw# auf die vcf-Seite rauf. Die Synchronisation der Kontakte zu Evolution bzw. über DAVx5 zu Android funktioniert auch einwandfrei.

@andig
Copy link
Owner

andig commented Dec 5, 2020

Siehe #196, ggf ähnliche Ursache.

@pmsh2020
Copy link
Author

pmsh2020 commented Dec 7, 2020

@andig Danke für die Rückmeldung

@blacksenator
Copy link
Collaborator

@pmsh2020 please try it with an configuration like in this example

@pmsh2020
Copy link
Author

Hallo,
Danke für den Hinweis. Habe zwischenzeitlich das NAS ausgetauscht: Synology-NAS DS220j, DSM 6.2.3-25426 Update 3 mit Carddav-Server. Carddav2FB neu installiert. In config.php 'method' => 'PROPFIND' aktiviert. Beim Ausführen von "./carddav2fb run" erhalte ich jetzt folgende FM:

Downloading recent FRITZ!Box phonebook
No special attributes are saved!
Downloading vCard(s) from account Martin
0 [>---------------------------]* Trying xxx.xxx.xxx.xxx:8008...

  • TCP_NODELAY set
  • Connected to xxxxxxx (xxx.xxx.xxx.xxx) port 8008 (#0)

PROPFIND /addressbooks/users/xxxxxxx/addressbook/ HTTP/1.1
Host: xxxxxxx:8008
Depth: 1
User-Agent: GuzzleHttp/7
Authorization: Basic TWFydGluOjAxMkJsdW1lbg==
Content-Type: application/xml
Content-Length: 221

  • upload completely sent off: 221 out of 221 bytes
  • Mark bundle as not supporting multiuse
    < HTTP/1.1 207 Multi-Status
    < ETag: "0d0a208729ea83f9b2d314876979319c"
    < Date: Sat, 30 Jan 2021 16:50:26 GMT
    < Last-Modified: Sat, 30 Jan 2021 14:45:26 GMT
    < Content-Length: 43449
    < Content-Type: text/xml
    < Server: Twisted/13.0.0 TwistedWeb/9.0.0
    < DAV: 1, access-control, addressbook, extended-mkcol, calendarserver-principal-property-search, calendarserver-principal-search, calendarserver-home-sync
    < Accept-Ranges: bytes
    < Connection: close
    <
  • Closing connection 0
    PHP Warning: SimpleXMLElement::__construct(): Entity: line 2: parser error : StartTag: invalid element name in /carddav2fb/src/CardDav/Backend.php on line 185
    PHP Warning: SimpleXMLElement::__construct(): <'> in /carddav2fb/src/CardDav/Backend.php on line 185
    PHP Warning: SimpleXMLElement::__construct(): ^ in /carddav2fb/src/CardDav/Backend.php on line 185
    PHP Warning: SimpleXMLElement::__construct(): Entity: line 2: parser error : Extra content at the end of the document in /carddav2fb/src/CardDav/Backend.php on line 185
    PHP Warning: SimpleXMLElement::__construct(): <'> in /carddav2fb/src/CardDav/Backend.php on line 185
    PHP Warning: SimpleXMLElement::__construct(): ^ in /carddav2fb/src/CardDav/Backend.php on line 185

In Backend.php line 185:

String could not be parsed as XML

@blacksenator
Copy link
Collaborator

@pmsh2020
Ich weiß nicht ob Andreas eine Idee hat - ich bin ratlos.

Eine Idee: Du könntest im IP-Phone-Forum fragen , ob jemand carddav2fb auf Synology erfolgreich laufen hat, und wenn ja, welche Einstellungen etc. sie/er benutzt.

Andere Möglichkeit: Der Fehler mit Bezug auf Zeile 185 in Backend.php gleich zu Anfang lässt darauf schließen, dass das XML im $body vermutlich leer ist. Ohne Debugging auf deinem System ist das vermutlich nicht zu finden, woran es liegt.
Daher könntest Du folgendes versuchen und in Zeile 182 folgendes einfügen:

file_put_contents('body_dump.txt', $response->getBody());

Anschließend nach einem erneuten run nachschauen, was in body_dump.txt im cardav2fb Ordner steht und evtl. Andreas zur Verfügung stellen.

Dritte Idee: wenn Du CardBook mit Thunderbird verwendest, könntest Du dort den, hoffentlich erfolgreichen, Verbindungsprozess aufzeichnen: dazu zuerst das vorhandene Log löschen (Extras -> Ansicht des Protokolls -> Flush), den Debug-Modus aktivieren (Extras -> Cardbook-Einstellungen -> Allgemein -> Log), dann eine Synchronisation anschubsen und anschließend das Log Andreas zur Verfügung stellen. Evtl. kann man sehen, was Cardbook anders bzw. richtig macht.

@pmsh2020
Copy link
Author

Hallo,
Danke für Deine Tipps:

wenn Du CardBook mit Thunderbird verwendest,
Leider nicht. Nutze Evolution. Und da funktioniert der Zugriff auf den Carddav-Server der Synology.

Im IP-Phone-Forum frage ich nach.

Auszug aus body_dump.txt:

/addressbooks/users/xxxxxxx/addressbook/ "0d0a208729ea83f9b2d314876979319c" HTTP/1.1 200 OK HTTP/1.1 404 Not Found

@pmsh2020
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants