Cannot post new contacts to Addressbooks

Ask all your questions regarding OC 4.x and older. Please read the Support Forum Rules
Forum rules
Before you post; make sure you are using at least PHP Version 5.3.x - Also read How To Solve Problems By Yourself

Cannot post new contacts to Addressbooks

Postby ascheman » Mon Jul 23, 2012 11:56 am

Environment: VServer
Server: Apache
Database: Postgres
Client: MacOS 10.7 Address Book
OC-Version: 4.0.5
PHP-Version: 5.3.3

Yesterday I created some new accounts in my MacOS addressbook. The cannot be put to owncloud. In the apache access.log I see some HTTP 500 errors from carddav.php. How can I debug this? In the data/owncloud.log I can see nothing ...

Yes, I have upgraded to 4.0.5 and yes, I have used the tools.php (it shows me some permission warning on /data and /config, although both directories belong to the www-data user: 'I do not own ...').

However I have traced it down to the postgres insert statement. In the postgres log I can see:

2012-07-23 12:37:31 CEST LOG: execute pdo_stmt_0000001b: INSERT INTO contacts_cards (addressbookid,fullname,carddata,uri,lastmodified) VALUES($1,$2,$3,$4,$5)
2012-07-23 12:37:31 CEST DETAIL: parameters: $1 = '2', $2 = ...
...
2012-07-23 12:37:31 CEST ERROR: duplicate key value violates unique constraint "contacts_cards_pkey"

But the unique key constraint is on the id field of contacts_cards ...

So I would expect some subselect like "select nextval('contacts_cards_id_seq')" here to create a new id?

Is this a bug?
Last edited by ascheman on Mon Aug 06, 2012 10:17 am, edited 1 time in total.
ascheman
Newbie
 
Posts: 3
Joined: Mon Jul 23, 2012 9:27 am

Re: MacOS addressbook cannot post new contacts

Postby ascheman » Mon Aug 06, 2012 9:55 am

I finally solved this myself: Obviously the autoincrement of the id field was missing. So I changed it by applying

alter table contacts_cards alter column id set default nextval('contacts_cards_id_seq');

on the postgres database.
ascheman
Newbie
 
Posts: 3
Joined: Mon Jul 23, 2012 9:27 am

Re: Cannot post new contacts to Addressbooks

Postby ascheman » Mon Aug 06, 2012 10:18 am

I finally found some more tables with the auto increment missing ... Here is the solution:

begin;
alter table calendar_calendars alter column id set default nextval('calendar_calendars_id_seq');
alter table calendar_objects alter column id set default nextval('calendar_objects_id_seq');
alter table contacts_addressbooks alter column id set default nextval('contacts_addressbooks_id_seq');
alter table locks alter column id set default nextval('locks_id_seq');
alter table log alter column id set default nextval('log_id_seq');
alter table principalgroups alter column id set default nextval('principalgroups_id_seq');
alter table principals alter column id set default nextval('principals_id_seq');
commit;
ascheman
Newbie
 
Posts: 3
Joined: Mon Jul 23, 2012 9:27 am


Return to OwnCloud Community Edition 4.x and older

Who is online

Users browsing this forum: No registered users and 15 guests