carddav2fb icon indicating copy to clipboard operation
carddav2fb copied to clipboard

Error retrieving addressbook from nextcloud (not generally)

Open kevinkk525 opened this issue 6 years ago • 7 comments

 Client error: `GET https://<nextcloud>/remote.php/dav/addressbooks/users/<user>/Handy/69bb835b-b62a-4b4f-875d-a80e1e56b232vcf.vcf` resulted in a `404 Not Found` response:
  <?xml version="1.0" encoding="utf-8"?>
  <d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
    <s:exception>Sabre\DA (truncated...)

I'm using nextcloud 13 and php5 to run your script.

Do you have any idea what's causing this problem or how it can be fixed? It occurs on by addressbook that I use since years. Another adressbook that I created recently works without a problem.

Thanks for your work on this script, makes my life easier :D

kevinkk525 avatar May 12 '18 17:05 kevinkk525

Funktioniert die Url im Browser? 404 heisst ‚not found‘?

Am 12.05.2018 um 19:25 schrieb Kevin Köck [email protected]:

Client error: GET https:///remote.php/dav/addressbooks/users//Handy/69bb835b-b62a-4b4f-875d-a80e1e56b232vcf.vcf resulted in a 404 Not Found response:

<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns"> <s:exception>Sabre\DA (truncated...)

Do you have any idea what's causing this problem or how it can be fixed? It occurs on by addressbook that I use since years. Another adressbook that I created recently works without a problem.

Thanks for your work on this script, makes my life easier :D

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

andig avatar May 13 '18 07:05 andig

Es wird wirklich nicht gefunden, da die korrekte URL diese ist:

https://nextcloud/remote.php/dav/addressbooks/users/Kevin_Koeck/Handy/69bb835b-b62a-4b4f-875d-a80e1e56b232vcf

Also ohne die Endung ".vcf".

In der Backend.php wird diese Endung an die url angehängt, was in diesem Fall nicht korrekt ist. Erstelle ich allerdings einen neuen Kontakt in nextcloud, funktioniert das problemlos.

kevinkk525 avatar May 13 '18 11:05 kevinkk525

Mhhm. Also unterschiedliche Kontakte von einem Server haben die Endung oder nicht? Wir könnten bei 404 ein Retry ihne Endung einbauen?

Viele Grüße, Andreas

Am 13.05.2018 um 13:42 schrieb Kevin Köck [email protected]:

Es wird wirklich nicht gefunden, da die korrekte URL diese ist:

https:///remote.php/dav/addressbo oks/users/Kevin_Koeck/Handy/69bb835b-b62a-4b4f-875d-a80e1e56b232vcf

Also ohne die Endung ".vcf".

In der Backend.php wird diese Endung an die url angehängt, was in diesem Fall nicht korrekt ist. Erstelle ich allerdings einen neuen Kontakt in nextcloud, funktioniert das problemlos.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

andig avatar May 13 '18 11:05 andig

So ist es. Vermutlich hat sich das im Laufe der Jahre verändert, sodass eigentlich kein Kontakt ohne Endung mehr vorhanden sein sollte aber dieses Addressbuch ist schon einige Jahre alt.

Wenn du es als sinnvolle Lösung siehst, dann wäre so ein Workaround ganz schön. Wenn nicht, ist das auch ok und ich muss mein Addressbuch mal "upgraden".

kevinkk525 avatar May 13 '18 11:05 kevinkk525

Aktuell unterstützen wir Server die generell keine Extension haben:

public function setUrl(string $url)
{
    $this->url = rtrim($url, '/') . '/';

    // workaround for providers that don't use the default .vcf extension
    if (strpos($this->url, "google.com")) {
        $this->url_vcard_extension = '';
    }
}

Die "manchmal" Regel ist nicht implementiert.

andig avatar Feb 05 '19 13:02 andig

Hatte das gleiche Problem, habe einfach die handvoll Kontakte, die keine Endung hatten in der Datenbank korrigiert. Tabelle ist oc_cards, Spalte uri

miq avatar Feb 16 '19 10:02 miq

Schätze das ist der beste Weg. Danke für den Hinweis.

kevinkk525 avatar Feb 17 '19 10:02 kevinkk525