carlos22 / carddav2fb

:notebook: A command-line PHP script allowing to import CardDAV-based VCards (e.g. from 'owncloud') to a phonebook in a AVM FRITZ!Box
The Unlicense
86 stars 66 forks source link

Response of initialization call /login_sid.lua in initSID was not xml-formatted. #18

Open staehler opened 7 years ago

staehler commented 7 years ago

Hi, unfortunately I cannot upload my contacts from owncloud to fb. I get always this message:

Uploading Phonebook XML to MY_IP
PHP Warning:  simplexml_load_string(): Entity: line 13: parser error : Opening and ending tag mismatch: meta line 4 and head in /home/admin/carddav2fb/lib/fritzbox_api_php/fritzbox_api.class.php on line 340
PHP Warning:  simplexml_load_string(): </head><body id="%c"> in /home/admin/carddav2fb/lib/fritzbox_api_php/fritzbox_api.class.php on line 340
PHP Warning:  simplexml_load_string():        ^ in /home/admin/carddav2fb/lib/fritzbox_api_php/fritzbox_api.class.php on line 340
PHP Warning:  simplexml_load_string(): Entity: line 34: parser error : Opening and ending tag mismatch: hr line 18 and body in /home/admin/carddav2fb/lib/fritzbox_api_php/fritzbox_api.class.php on line 340
PHP Warning:  simplexml_load_string(): </body></html> in /home/admin/carddav2fb/lib/fritzbox_api_php/fritzbox_api.class.php on line 340
PHP Warning:  simplexml_load_string():        ^ in /home/admin/carddav2fb/lib/fritzbox_api_php/fritzbox_api.class.php on line 340
PHP Warning:  simplexml_load_string(): Entity: line 34: parser error : Opening and ending tag mismatch: body line 13 and html in /home/admin/carddav2fb/lib/fritzbox_api_php/fritzbox_api.class.php on line 340
PHP Warning:  simplexml_load_string(): </body></html> in /home/admin/carddav2fb/lib/fritzbox_api_php/fritzbox_api.class.php on line 340
PHP Warning:  simplexml_load_string():               ^ in /home/admin/carddav2fb/lib/fritzbox_api_php/fritzbox_api.class.php on line 340
PHP Warning:  simplexml_load_string(): Entity: line 35: parser error : Premature end of data in tag meta line 3 in /home/admin/carddav2fb/lib/fritzbox_api_php/fritzbox_api.class.php on line 340
PHP Warning:  simplexml_load_string(): Entity: line 35: parser error : Premature end of data in tag head line 2 in /home/admin/carddav2fb/lib/fritzbox_api_php/fritzbox_api.class.php on line 340
PHP Warning:  simplexml_load_string(): Entity: line 35: parser error : Premature end of data in tag html line 2 in /home/admin/carddav2fb/lib/fritzbox_api_php/fritzbox_api.class.php on line 340
  ERROR: Response of initialization call /login_sid.lua in initSID was not xml-formatted.

I've substituted the IP in this message. All messages before a OK, means the VCards have been read and the ftp uploads run without errors. Is this a failure of your code or what maybe the reason for this message?

Thanksand kind regards, Michael

staehler commented 7 years ago

Does anybody has an idea, how to get rid of this error, as the sync between fritzbox and my owncloud doesn't work anymore.

DummerJunge commented 7 years ago

Hello, this happens to me if I use IP and not names:

WORKS: $config['fritzbox_ip'] = 'fritz.box'; $config['fritzbox_ip_ftp'] = 'fritz.box';

DOES NOT WORK: $config['fritzbox_ip'] = '192.168.10.1'; $config['fritzbox_ip_ftp'] = '192.168.10.1';

mrmadcow commented 7 years ago

Same problem here. For me this happened due to an SSL certificate error in the fritz API.

As a quick fix I included + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); + curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);

into the tree functions doPostForm, doPostFile and doGetPage ( lib/fritzbox_api_php/fritzbox_api.class.php ). It would have to be fixed upstream though. There is already some disabling of SSL verification going on based on the setting of config->getItem('enable_remote_config').