Discussion:
[turba] How to use turba-import-vcards
Luca Bertoncello
2018-02-20 11:50:29 UTC
Permalink
Hi again,

I'm trying to import a vCard into Turba, using turba-import-vcards,
but I always get the error:

HORDE: [turba] Invalid address book

I tried with the Name (Test), the DAV-URL and the Hash. Some error...

Can someone say me what the evil this "source" means and how can I find it?

Thanks
Luca Bertoncello
(***@lucabert.de)
--
turba mailing list
Frequently Asked Questions: http://wiki.horde.org/FAQ
To unsubscribe, mail: turba-***@lists.horde.org
Jan Schneider
2018-02-20 12:03:05 UTC
Permalink
Post by Luca Bertoncello
Hi again,
I'm trying to import a vCard into Turba, using turba-import-vcards,
HORDE: [turba] Invalid address book
I tried with the Name (Test), the DAV-URL and the Hash. Some error...
Can someone say me what the evil this "source" means and how can I find it?
Thanks
Luca Bertoncello
It's the source ID, which might be the configuration key from
config/backends.php, but also the unique per-user ID, if the source is
a share.
--
Jan Schneider
The Horde Project
https://www.horde.org/
--
turba mailing list
Frequently Asked Questions: http://wiki.horde.org/FAQ
To unsubscribe, mail: turba-***@lists.horde.org
Luca Bertoncello
2018-02-20 12:06:04 UTC
Permalink
Post by Jan Schneider
It's the source ID, which might be the configuration key from
config/backends.php, but also the unique per-user ID, if the source
is a share.
I'm very sorry, but I really don't understand what do you mean...
I created an addressbook "Test" for my user, which has an Hash-ID.
This is surely NOT, since I tryed it and got an error...

In backends.php I tried localsql, but I get the same error.
Could you make concret an example?

Thanks
Luca Bertoncello
(***@lucabert.de)
--
turba mailing list
Frequently Asked Questions: http://wiki.horde.org/FAQ
To unsubscribe, mail: turba-***@lists.horde.org
Jan Schneider
2018-02-22 17:32:08 UTC
Permalink
Post by Luca Bertoncello
Post by Jan Schneider
It's the source ID, which might be the configuration key from
config/backends.php, but also the unique per-user ID, if the source
is a share.
I'm very sorry, but I really don't understand what do you mean...
I created an addressbook "Test" for my user, which has an Hash-ID.
This is surely NOT, since I tryed it and got an error...
Which error? This is how it's supposed to work.
Post by Luca Bertoncello
In backends.php I tried localsql, but I get the same error.
Could you make concret an example?
Thanks
Luca Bertoncello
--
Jan Schneider
The Horde Project
https://www.horde.org/
--
turba mailing list
Frequently Asked Questions: http://wiki.horde.org/FAQ
To unsubscribe, mail: turba-***@lists.horde.org
Luca Bertoncello
2018-02-22 17:59:20 UTC
Permalink
Jan Schneider <***@horde.org> schrieb:

Hi Jan,
Post by Jan Schneider
Post by Luca Bertoncello
I'm very sorry, but I really don't understand what do you mean...
I created an addressbook "Test" for my user, which has an Hash-ID.
This is surely NOT, since I tryed it and got an error...
Which error? This is how it's supposed to work.
/home/www/horde/turba-import-vcards Test lucabert < /tmp/LucaBertoncello.vcf

Broadcast message from systemd-***@ns.lucabert.de (Thu 2018-02-22
18:56:42 CET):

HORDE[9886]: [turba] Invalid address book: Test [pid 9886 on line 669 of
"/home/www/horde/turba/lib/Api.php"]


Message from ***@ns at Feb 22 18:56:42 ...
HORDE: [turba] Invalid address book: test [pid 9886 on line 669 of
"/home/www/horde/turba/lib/Api.php"] Fatal Error:
Invalid address book: test
In /home/www/horde/turba/lib/Api.php on line 669

1. Horde_Registry->call() /home/www/horde/turba-import-vcards:44
2. Horde_Registry->callByPackage() /usr/share/php/Horde/Registry.php:1089
3. call_user_func_array() /usr/share/php/Horde/Registry.php:1132
4. Turba_Api->import()

Of course an address book with name "test" for the user "lucabert" exists...

Thanks
Luca Bertoncello
(***@lucabert.de)
--
turba mailing list
Frequently Asked Questions: http://wiki.horde.org/FAQ
To unsubscribe, mail: turba-***@lists.horde.org
Jan Schneider
2018-02-22 18:08:31 UTC
Permalink
Post by Luca Bertoncello
Hi Jan,
Post by Jan Schneider
Post by Luca Bertoncello
I'm very sorry, but I really don't understand what do you mean...
I created an addressbook "Test" for my user, which has an Hash-ID.
This is surely NOT, since I tryed it and got an error...
Which error? This is how it's supposed to work.
/home/www/horde/turba-import-vcards Test lucabert < /tmp/LucaBertoncello.vcf
HORDE[9886]: [turba] Invalid address book: Test [pid 9886 on line 669 of
"/home/www/horde/turba/lib/Api.php"]
HORDE: [turba] Invalid address book: test [pid 9886 on line 669 of
Invalid address book: test
In /home/www/horde/turba/lib/Api.php on line 669
1. Horde_Registry->call() /home/www/horde/turba-import-vcards:44
2. Horde_Registry->callByPackage() /usr/share/php/Horde/Registry.php:1089
3. call_user_func_array() /usr/share/php/Horde/Registry.php:1132
4. Turba_Api->import()
Of course an address book with name "test" for the user "lucabert" exists...
Thanks
Luca Bertoncello
Names are just labels. Use the address book id instead (random hash string).
--
Jan Schneider
The Horde Project
https://www.horde.org/
--
turba mailing list
Frequently Asked Questions: http://wiki.horde.org/FAQ
To unsubscribe, mail: turba-***@lists.horde.org
Luca Bertoncello
2018-02-22 19:27:01 UTC
Permalink
Post by Jan Schneider
Names are just labels. Use the address book id instead (random hash string).
The same...

***@ns:~# /home/www/horde/turba-import-vcards ~_phTjiDdxi4KDv2Nbq25nf7
lucabert < /tmp/Luca\ Bertoncello.vcf

Broadcast message from systemd-***@ns.lucabert.de (Thu 2018-02-22
20:25:38 CET):

HORDE[5925]: [turba] Invalid address book: ~_phTjiDdxi4KDv2Nbq25nf7 [pid 5925
on line 669 of "/home/www/horde/turba/lib/Api.php"]


Message from ***@ns at Feb 22 20:25:38 ...
HORDE: [turba] Invalid address book: ~_phTjiDdxi4KDv2Nbq25nf7 [pid 5925 on
line 669 of "/home/www/horde/turba/lib/Api.php"]

Fatal Error:
Invalid address book: ~_phTjiDdxi4KDv2Nbq25nf7
In /home/www/horde/turba/lib/Api.php on line 669

1. Horde_Registry->call() /home/www/horde/turba-import-vcards:44
2. Horde_Registry->callByPackage() /usr/share/php/Horde/Registry.php:1089
3. call_user_func_array() /usr/share/php/Horde/Registry.php:1132
4. Turba_Api->import()

Any other idea?

Thanks
Luca Bertoncello
(***@lucabert.de)
--
turba mailing list
Frequently Asked Questions: http://wiki.horde.org/FAQ
To unsubscribe, mail: turba-***@lists.horde.org
Jan Schneider
2018-02-22 20:27:51 UTC
Permalink
Post by Luca Bertoncello
Post by Jan Schneider
Names are just labels. Use the address book id instead (random hash string).
The same...
lucabert < /tmp/Luca\ Bertoncello.vcf
HORDE[5925]: [turba] Invalid address book: ~_phTjiDdxi4KDv2Nbq25nf7 [pid 5925
on line 669 of "/home/www/horde/turba/lib/Api.php"]
HORDE: [turba] Invalid address book: ~_phTjiDdxi4KDv2Nbq25nf7 [pid 5925 on
line 669 of "/home/www/horde/turba/lib/Api.php"]
Invalid address book: ~_phTjiDdxi4KDv2Nbq25nf7
In /home/www/horde/turba/lib/Api.php on line 669
1. Horde_Registry->call() /home/www/horde/turba-import-vcards:44
2. Horde_Registry->callByPackage() /usr/share/php/Horde/Registry.php:1089
3. call_user_func_array() /usr/share/php/Horde/Registry.php:1132
4. Turba_Api->import()
Any other idea?
Thanks
Luca Bertoncello
This looks like a weird ID, are you sure it's correct?
--
Jan Schneider
The Horde Project
https://www.horde.org/
--
turba mailing list
Frequently Asked Questions: http://wiki.horde.org/FAQ
To unsubscribe, mail: turba-***@lists.horde.org
Luca Bertoncello
2018-02-22 20:31:10 UTC
Permalink
Post by Jan Schneider
This looks like a weird ID, are you sure it's correct?
Well, I really don't have any idea how an address book ID looks like...
I just copied it from Horde:

CardDAV-Abonnement-Adresse
https://www.mydomain.tld/rpc.php/addressbooks/lucabert/contacts~_phTjiDdxi4KDv2Nbq25nf7/

is it wrong? Where can I find the "right" ID?

Thanks
Luca Bertoncello
(***@lucabert.de)
--
turba mailing list
Frequently Asked Questions: http://wiki.horde.org/FAQ
To unsubscribe, mail: turba-***@lists.horde.org
Jan Schneider
2018-02-22 21:00:10 UTC
Permalink
Post by Luca Bertoncello
Post by Jan Schneider
This looks like a weird ID, are you sure it's correct?
Well, I really don't have any idea how an address book ID looks like...
CardDAV-Abonnement-Adresse
https://www.mydomain.tld/rpc.php/addressbooks/lucabert/contacts~_phTjiDdxi4KDv2Nbq25nf7/
is it wrong? Where can I find the "right" ID?
Thanks
Luca Bertoncello
Yes, this is wrong. Take it from the URL when using the address book
in the browser.
--
Jan Schneider
The Horde Project
https://www.horde.org/
--
turba mailing list
Frequently Asked Questions: http://wiki.horde.org/FAQ
To unsubscribe, mail: turba-***@lists.horde.org
Luca Bertoncello
2018-02-23 06:31:40 UTC
Permalink
Post by Jan Schneider
Yes, this is wrong. Take it from the URL when using the address book
in the browser.
I really don't understand what you mean...
The URL is:

https://www.mydomain.tld/turba/?source=_phTjiDdxi4KDv2Nbq25nf7

So I think the ID should be _phTjiDdxi4KDv2Nbq25nf7, but if I try this ID I
always get the same error...
Could you give me an example, how this ID looks like?

Thanks
Luca Bertoncello
(***@lucabert.de)
--
turba mailing list
Frequently Asked Questions: http://wiki.horde.org/FAQ
To unsubscribe, mail: turba-***@lists.horde.org
Jan Schneider
2018-02-26 20:22:46 UTC
Permalink
Post by Luca Bertoncello
Post by Jan Schneider
Yes, this is wrong. Take it from the URL when using the address book
in the browser.
I really don't understand what you mean...
https://www.mydomain.tld/turba/?source=_phTjiDdxi4KDv2Nbq25nf7
So I think the ID should be _phTjiDdxi4KDv2Nbq25nf7, but if I try this ID I
always get the same error...
Could you give me an example, how this ID looks like?
This is the correct ID then. How exactly does your call look like
again? It's very confusing if you keep stripping all of this thread's
history.
Did you specify the user as the second argument? Does they have write
permission, i.e. is that the source's owner?
--
Jan Schneider
The Horde Project
https://www.horde.org/
--
turba mailing list
Frequently Asked Questions: http://wiki.horde.org/FAQ
To unsubscribe, mail: turba-***@lists.horde.org
Luca Bertoncello
2018-02-26 20:38:20 UTC
Permalink
Jan Schneider <***@horde.org> schrieb:

Hi Jan
Post by Jan Schneider
This is the correct ID then. How exactly does your call look like
again? It's very confusing if you keep stripping all of this thread's
history.
Did you specify the user as the second argument? Does they have write
permission, i.e. is that the source's owner?
Well, I call the script so:

/home/www/horde/turba-import-vcards _phTjiDdxi4KDv2Nbq25nf7 lucabert
< /tmp/Luca\ Bertoncello.vcf

As you see, the second argument ist the user (lucabert).
I created the address book using the user "lucabert". How can I check the
permission?

Thanks
Luca Bertoncello
(***@lucabert.de)
--
turba mailing list
Frequently Asked Questions: http://wiki.horde.org/FAQ
To unsubscribe, mail: turba-***@lists.horde.org
Jan Schneider
2018-02-26 21:15:04 UTC
Permalink
Post by Luca Bertoncello
Hi Jan
Post by Jan Schneider
This is the correct ID then. How exactly does your call look like
again? It's very confusing if you keep stripping all of this thread's
history.
Did you specify the user as the second argument? Does they have write
permission, i.e. is that the source's owner?
/home/www/horde/turba-import-vcards _phTjiDdxi4KDv2Nbq25nf7 lucabert
< /tmp/Luca\ Bertoncello.vcf
As you see, the second argument ist the user (lucabert).
I created the address book using the user "lucabert". How can I check the
permission?
Thanks
Luca Bertoncello
No need to, if this is the share's owner.
--
Jan Schneider
The Horde Project
https://www.horde.org/
--
turba mailing list
Frequently Asked Questions: http://wiki.horde.org/FAQ
To unsubscribe, mail: turba-***@lists.horde.org
Luca Bertoncello
2018-02-27 06:07:50 UTC
Permalink
Post by Jan Schneider
No need to, if this is the share's owner.
Is it possible, too? To double check it...

Thanks
Luca Bertoncello
(***@lucabert.de)
--
turba mailing list
Frequently Asked Questions: http://wiki.horde.org/FAQ
To unsubscribe, mail: turba-***@lists.horde.org
Luca Bertoncello
2018-02-27 07:12:46 UTC
Permalink
Zitat von Jan Schneider <***@horde.org>:

Hi Jan
Post by Jan Schneider
Post by Luca Bertoncello
As you see, the second argument ist the user (lucabert).
I created the address book using the user "lucabert". How can I check the
permission?
Thanks
Luca Bertoncello
No need to, if this is the share's owner.
Well, I tried to set all permissions for "guest" and it works...
It is very very strange, isn't it?

How can you explain this?

Thanks
Luca Bertoncello
(***@lucabert.de)
--
turba mailing list
Frequently Asked Questions: http://wiki.horde.org/FAQ
To unsubscribe, mail: turba-***@lists.horde.org
Jan Schneider
2018-03-01 19:36:53 UTC
Permalink
Post by Luca Bertoncello
Hi Jan
Post by Jan Schneider
Post by Luca Bertoncello
As you see, the second argument ist the user (lucabert).
I created the address book using the user "lucabert". How can I check the
permission?
Thanks
Luca Bertoncello
No need to, if this is the share's owner.
Well, I tried to set all permissions for "guest" and it works...
It is very very strange, isn't it?
How can you explain this?
Only if you entered the username incorrectly on the command line. Or
if something is broken in the script.
--
Jan Schneider
The Horde Project
https://www.horde.org/
--
turba mailing list
Frequently Asked Questions: http://wiki.horde.org/FAQ
To unsubscribe, mail: turba-***@lists.horde.org
Luca Bertoncello
2018-03-01 19:44:32 UTC
Permalink
Post by Jan Schneider
Only if you entered the username incorrectly on the command line. Or
if something is broken in the script.
Well, since I use the username "lucabert" since ~30 years, I think it's
correct...
And I triple-check it, too...

I believe, there is something broken in the script, unfortunately...
Maybe you know about where I can search for the error?

Thanks
Luca Bertoncello
(***@lucabert.de)
--
turba mailing list
Frequently Asked Questions: http://wiki.horde.org/FAQ
To unsubscribe, mail: turba-***@lists.horde.org
Jan Schneider
2018-03-01 20:17:38 UTC
Permalink
Post by Luca Bertoncello
Post by Jan Schneider
Only if you entered the username incorrectly on the command line. Or
if something is broken in the script.
Well, since I use the username "lucabert" since ~30 years, I think it's
correct...
And I triple-check it, too...
You may have username hooks or other user name mangling set up in
Horde, so that the internal Horde name (that you use with this script)
don't match the user name that you enter in the login form.
Post by Luca Bertoncello
I believe, there is something broken in the script, unfortunately...
Maybe you know about where I can search for the error?
Thanks
Luca Bertoncello
--
Jan Schneider
The Horde Project
https://www.horde.org/
--
turba mailing list
Frequently Asked Questions: http://wiki.horde.org/FAQ
To unsubscribe, mail: turba-***@lists.horde.org
Luca Bertoncello
2018-03-01 20:23:15 UTC
Permalink
Post by Jan Schneider
You may have username hooks or other user name mangling set up in
Horde, so that the internal Horde name (that you use with this script)
don't match the user name that you enter in the login form.
Well, I let Horde authenticate via IMAP...
I don't have any hook (or better: I cannot find any hooks.php file or other
settings with "hook" in the name).

Where can I search for this hook?

Thanks
Luca Bertoncello
(***@lucabert.de)
--
turba mailing list
Frequently Asked Questions: http://wiki.horde.org/FAQ
To unsubscribe, mail: turba-***@lists.horde.org
Luca Bertoncello
2018-03-01 20:40:24 UTC
Permalink
Post by Jan Schneider
You may have username hooks or other user name mangling set up in
Horde, so that the internal Horde name (that you use with this script)
don't match the user name that you enter in the login form.
I really don't know why, but...

file turba/lib/Turba.php, line 664:

try {
return $GLOBALS['injector']->getInstance('Turba_Shares')->listShares(
$GLOBALS['registry']->getAuth(),
array(
'attributes' => $owneronly ? $GLOBALS['registry']->getAuth() : null,
'perm' => $permission
)
);
} catch (Horde_Share_Exception $e) {
Horde::log($e, 'ERR');
return array();
}

it seems that $GLOBALS['registry']->getAuth() returns an empty string if
called from command line...
If I write:

$GLOBALS['registry']->setAuth('lucabert');

just before the lines all works correct...

A very strange idea: since I authenticate in Horde using IMAP, maybe should
the script authenticate via IMAP, too and it can't?

Thanks
Luca Bertoncello
(***@lucabert.de)
--
turba mailing list
Frequently Asked Questions: http://wiki.horde.org/FAQ
To unsubscribe, mail: turba-***@lists.horde.org
Luca Bertoncello
2018-03-01 20:44:54 UTC
Permalink
Post by Luca Bertoncello
A very strange idea: since I authenticate in Horde using IMAP, maybe should
the script authenticate via IMAP, too and it can't?
Well, maybe I found the problem, or at least a possible solution...

In the file turba-import-vcards I have this:

require_once $baseDir . 'lib/Application.php';
Horde_Registry::appInit('turba', array('cli' => true));

If I add:

Horde_Registry::appInit('imp', array('cli' => true));

too, it works correct, so maybe the problem is really that I authenticate
with IMAP using IMP and the importer does NOT call IMP to authenticate the
user...

Your opinion?

Thanks
Luca Bertoncello
(***@lucabert.de)
--
turba mailing list
Frequently Asked Questions: http://wiki.horde.org/FAQ
To unsubscribe, mail: turba-***@lists.horde.org
Jan Schneider
2018-03-01 21:18:52 UTC
Permalink
Post by Luca Bertoncello
Post by Luca Bertoncello
A very strange idea: since I authenticate in Horde using IMAP, maybe should
the script authenticate via IMAP, too and it can't?
Well, maybe I found the problem, or at least a possible solution...
require_once $baseDir . 'lib/Application.php';
Horde_Registry::appInit('turba', array('cli' => true));
Horde_Registry::appInit('imp', array('cli' => true));
too, it works correct, so maybe the problem is really that I authenticate
with IMAP using IMP and the importer does NOT call IMP to authenticate the
user...
Your opinion?
You cannot authenticate to IMP because you don't have the user's
password to authenticate at the IMAP backend. So this all doesn't make
much sense. If any, the opposite behaviour would be explainable.
Strange.
--
Jan Schneider
The Horde Project
https://www.horde.org/
--
turba mailing list
Frequently Asked Questions: http://wiki.horde.org/FAQ
To unsubscribe, mail: turba-***@lists.horde.org
Luca Bertoncello
2018-03-02 06:18:31 UTC
Permalink
Post by Jan Schneider
You cannot authenticate to IMP because you don't have the user's
password to authenticate at the IMAP backend. So this all doesn't make
much sense. If any, the opposite behaviour would be explainable.
Strange.
Well, but without the line I added it doesn't work, and with the line it does
work... ;)

Now I have to understand how I can purge the address book before the import...

Regards
Luca Bertoncello
(***@lucabert.de)
--
turba mailing list
Frequently Asked Questions: http://wiki.horde.org/FAQ
To unsubscribe, mail: turba-***@lists.horde.org
Luca Bertoncello
2018-03-04 07:31:11 UTC
Permalink
Jan Schneider <***@horde.org> schrieb:

Hi Jan,
Post by Jan Schneider
You cannot authenticate to IMP because you don't have the user's
password to authenticate at the IMAP backend. So this all doesn't make
much sense. If any, the opposite behaviour would be explainable.
Strange.
I created right now a ticket with the BugFix in turba-import-vcards and an
enhancement to purge previous data on import.

https://bugs.horde.org/ticket/14789

I hope it will be soon imported in the main code and helps other people with
my same problem.

Regards
Luca Bertoncello
(***@lucabert.de)
--
turba mailing list
Frequently Asked Questions: http://wiki.horde.org/FAQ
To unsubscribe, mail: turba-***@lists.horde.org
Luca Bertoncello
2018-02-27 07:36:19 UTC
Permalink
Zitat von Jan Schneider <***@horde.org>:

Hi Jan,
Post by Jan Schneider
Post by Luca Bertoncello
As you see, the second argument ist the user (lucabert).
I created the address book using the user "lucabert". How can I check the
permission?
Thanks
Luca Bertoncello
No need to, if this is the share's owner.
Well, I tried to set all permissions for "guest" and it works...
It is very very strange, isn't it?

How can you explain this?

Thanks
Luca Bertoncello
(***@lucabert.de)
--
turba mailing list
Frequently Asked Questions: http://wiki.horde.org/FAQ
To unsubscribe, mail: turba-***@lists.horde.org
Luca Bertoncello
2018-02-23 20:49:16 UTC
Permalink
Jan Schneider <***@horde.org> schrieb:

Hi Jan,
Post by Jan Schneider
Yes, this is wrong. Take it from the URL when using the address book
in the browser.
I try to debug the application, but I not really understand the problem...
If I display the $cfgSources I can use, I just see "favourites". No other
backend...
If I try to import to favourites I get __another__ error (permission denied,
as expected, since the favourites are read-only).

I really think, I have some wrong configuration in Horde and/or in the
permission, but I really can't think __which__ configuration/permission is
wrong.

Can someone help me?

Thanks a lot!
Luca Bertoncello
(***@lucabert.de)
--
turba mailing list
Frequently Asked Questions: http://wiki.horde.org/FAQ
To unsubscribe, mail: turba-***@lists.horde.org
Loading...