Indefero

Issue 800: PostgreSQL don't work for release-1.3

Reported by Sindre Myren, Apr 18, 2012

There seems to be a series of issues with PostgreSQL on the 1.3 
release (See mail thread:  
https://groups.google.com/forum/?fromgroups#!topic/indefero-users/5EI
WITIadnk)

Latest error (Commit b44ad48fd596d37f5e4e02ad78bab0fe97ec6f27):



Exception making GET request to /code/projects/
ERROR: invalid input syntax for integer: "'0'" LINE 2: 
WHERE ((1=1) AND ("private"='''0''')) ^ - SELECT DISTINCT 
indefero_idf_projects."id" AS "id", 
indefero_idf_projects."name" AS "name", 
indefero_idf_projects."shortname" AS 
"shortname", indefero_idf_projects."shortdesc" 
AS "shortdesc", 
indefero_idf_projects."description" AS 
"description", indefero_idf_projects."private" 
AS "private", 
indefero_idf_projects."current_activity" AS 
"current_activity", date, value FROM indefero_idf_projects 
LEFT JOIN indefero_idf_projectactivities ON 
current_activity=indefero_idf_projectactivities.id LEFT JOIN 
indefero_idf_project_idf_tag_assoc ON 
idf_project_id=indefero_idf_projects.id WHERE ((1=1) AND 
("private"='''0''')) ORDER BY name ASC

PHP	/home/www/pluf/src/Pluf/DB/PostgreSQL.php, line 147
URI	GET /code/projects/
Stacktrace ▼

Pluf_DB_PostgreSQL->select [/home/www/pluf/src/Pluf/Model.php, 
line 557]
▶ Args
▶ Src
Pluf_Model->getList [/home/www/indefero/src/IDF/Views.php, line 
425]
▶ Args
▶ Src
IDF_Views::getProjects [/home/www/indefero/src/IDF/Views.php, line 
86]
▶ Args
▶ Src
IDF_Views->listProjectsByLabel 
[/home/www/indefero/src/IDF/Views.php, line 62]
▶ Args
▶ Src
IDF_Views->listProjects [/home/www/pluf/src/Pluf/Dispatcher.php, 
line 202]
▶ Args
▶ Src
Pluf_Dispatcher::send [/home/www/pluf/src/Pluf/Dispatcher.php, line 
129]
▶ Args
▶ Src
Pluf_Dispatcher::match [/home/www/pluf/src/Pluf/Dispatcher.php, line 
56]
▶ Args
▶ Src
Pluf_Dispatcher::dispatch [/home/www/indefero/www/index.php, line 
28]
▶ Args
▶ Src

Comment 1 by Thomas Keller, Apr 18, 2012

Give revision d1542c9 a try.
Labels: Milestone:Release1.3.1

Comment 2 by Sindre Myren, Apr 18, 2012

InDefero is now operational and looking good:)

- The ordering is still not right, and the 'order by' buttons does 
not seem to affect anything (I guess activity maybe isn't monitored 
yet?).

- There still seems to be an issue with Subversion projects:

PlufErrorHandlerException making GET request to /code/p/sy/
8 : Undefined index: svn

PHP	/home/www/indefero/src/IDF/Scm.php, line 87
URI	GET /code/p/sy/
Stacktrace ▼

PlufErrorHandler [/home/www/indefero/src/IDF/Scm.php, line 87]
▶ Args
▶ Src
IDF_Scm::get [/home/www/indefero/src/IDF/Template/IssueComment.php, 
line 40]
▶ Args
▶ Src
IDF_Template_IssueComment->start 
[/home/www/indefero/src/IDF/Template/Markdown.php, line 42]
▶ Args
▶ Src
IDF_Template_Markdown->start 
[/srv/tmp/Pluf_Template-95d9dd837f066a166a4b8e22b8453bc8.phps, line 
103]
▶ Args
▶ Src
Pluf_Template_95d9dd837f066a166a4b8e22b8453bc8::render [No File, 
line 0]
▶ Args
No src available
call_user_func [/home/www/pluf/src/Pluf/Template.php, line 97]
▶ Args
▶ Src
Pluf_Template->render [/home/www/pluf/src/Pluf/Shortcuts.php, 
line 92]
▶ Args
▶ Src
Pluf_Shortcuts_RenderToResponse 
[/home/www/indefero/src/IDF/Views/Project.php, line 80]
▶ Args
▶ Src
IDF_Views_Project->home [/home/www/pluf/src/Pluf/Dispatcher.php, 
line 202]
▶ Args
▶ Src
Pluf_Dispatcher::send [/home/www/pluf/src/Pluf/Dispatcher.php, line 
129]
▶ Args
▶ Src
Pluf_Dispatcher::match [/home/www/pluf/src/Pluf/Dispatcher.php, line 
56]
▶ Args
▶ Src
Pluf_Dispatcher::dispatch [/home/www/indefero/www/index.php, line 
28]
▶ Args
▶ Src

Comment 3 by Thomas Keller, Apr 18, 2012

Activity: This requires a cron script - see 
scripts/activitycron.php.

SVN: Ensure that $cfg['allowed_scms'] contains 'svn'. There is no 
support currently to enable / disable SCMs on the go through this.

Comment 4 by Sindre Myren, Apr 18, 2012

SVN stuff now works. But there may be missing a migration for  
activitycron. Do you think that is possible?


All migrations are installed:

PHP include path: .:/usr/share/pear:/home/www/pluf/src
Migrate  to version latest

  $ php indefero/scripts/activitycron.php 
recalculating project activity for 2012-04-17
PHP Fatal error:  Uncaught exception 'Exception' with message 
'ERROR:  column "IDF_Commit" does not exist
LINE 2: WHERE  (model_class IN ("IDF_Commit") AND 
creation_dtime >= ...
                                ^ - SELECT COUNT(*) as nb_items FROM 
indefero_idf_timeline 
WHERE  (model_class IN ("IDF_Commit") AND creation_dtime 
>= '2012-04-10 00:00:00' AND creation_dtime <= '2012-04-17 
23:59:59') ' in /home/www/pluf/src/Pluf/DB/PostgreSQL.php:147
Stack trace:
#0 /home/www/pluf/src/Pluf/Model.php(557): 
Pluf_DB_PostgreSQL->select('SELECT COUNT(*)...')
#1 /home/www/pluf/src/Pluf/Model.php(593): 
Pluf_Model->getList(Array)
#2 /home/www/indefero/src/IDF/ActivityTaxonomy.php(152): 
Pluf_Model->getCount(Array)
#3 /home/www/indefero/src/IDF/ActivityTaxonomy.php(128): 
IDF_ActivityTaxonomy::countActivityFor(Array, Array)
#4 /home/www/indefero/src/IDF/ActivityTaxonomy.php(105): 
IDF_ActivityTaxonomy::calculateActivityValue(Array, Array, 14)
#5 /home/www/indefero/src/IDF/ActivityTaxonomy.php(78): 
IDF_ActivityTaxonomy::recalculateTaxonomy(Object in 
/home/www/pluf/src/Pluf/DB/PostgreSQL.php on line 147

Comment 5 by Thomas Keller, Apr 18, 2012

No, no migration is missing. Just another Postgres problem. Should 
be fixed in revision 169fbe6.

Comment 6 by Sindre Myren, Apr 18, 2012

These are the tables that I got defined:

  $ psql indefero
psql (9.1.3)
Type "help" for help.

indefero=> \d
                                     List of relations
 Schema |                              Name                          
    |   Type   | Owner 
--------+------------------------------------------------------------
----+----------+-------
 public | indefero_groups                                            
    | table    | web
 public | indefero_groups_id_seq                                     
    | sequence | web
 public | indefero_idf_commits                                       
    | table    | web
 public | indefero_idf_commits_id_seq                                
    | sequence | web
 public | indefero_idf_conf                                          
    | table    | web
 public | indefero_idf_conf_id_seq                                   
    | sequence | web
 public | indefero_idf_emailaddresses                                
    | table    | web
 public | indefero_idf_emailaddresses_id_seq                         
    | sequence | web
 public | indefero_idf_gconf                                         
    | table    | web
 public | indefero_idf_gconf_id_seq                                  
    | sequence | web
 public | indefero_idf_issue_idf_tag_assoc                           
    | table    | web
 public | indefero_idf_issue_pluf_user_assoc                         
    | table    | web
 public | indefero_idf_issuecomments                                 
    | table    | web
 public | indefero_idf_issuecomments_id_seq                          
    | sequence | web
 public | indefero_idf_issuefiles                                    
    | table    | web
 public | indefero_idf_issuefiles_id_seq                             
    | sequence | web
 public | indefero_idf_issuerelations                                
    | table    | web
 public | indefero_idf_issuerelations_id_seq                         
    | sequence | web
 public | indefero_idf_issues                                        
    | table    | web
 public | indefero_idf_issues_id_seq                                 
    | sequence | web
 public | indefero_idf_keys                                          
    | table    | web
 public | indefero_idf_keys_id_seq                                   
    | sequence | web
 public | indefero_idf_project_idf_tag_assoc                         
    | table    | web
 public | indefero_idf_projectactivities                             
    | table    | web
 public | indefero_idf_projectactivities_id_seq                      
    | sequence | web
 public | indefero_idf_projects                                      
    | table    | web
 public | indefero_idf_projects_id_seq                               
    | sequence | web
 public | indefero_idf_queue                                         
    | table    | web
 public | indefero_idf_queue_id_seq                                  
    | sequence | web
 public | indefero_idf_review_comments                               
    | table    | web
 public | indefero_idf_review_comments_id_seq                        
    | sequence | web
 public | indefero_idf_review_filecomments                           
    | table    | web
 public | indefero_idf_review_filecomments_id_seq                    
    | sequence | web
 public | indefero_idf_review_idf_tag_assoc                          
    | table    | web
 public | indefero_idf_review_patches                                
    | table    | web
 public | indefero_idf_review_patches_id_seq                         
    | sequence | web
 public | indefero_idf_review_pluf_user_assoc                        
    | table    | web
 public | indefero_idf_reviews                                       
    | table    | web
 public | indefero_idf_reviews_id_seq                                
    | sequence | web
 public | indefero_idf_scm_cache_git                                 
    | table    | web
 public | indefero_idf_scm_cache_git_id_seq                          
    | sequence | web
 public | indefero_idf_search_occs                                   
    | table    | web
 public | indefero_idf_search_occs_id_seq                            
    | sequence | web
 public | indefero_idf_tag_idf_upload_assoc                          
    | table    | web
 public | indefero_idf_tag_idf_wiki_page_assoc                       
    | table    | web
 public | indefero_idf_tags                                          
    | table    | web
 public | indefero_idf_tags_id_seq                                   
    | sequence | web
 public | indefero_idf_timeline                                      
    | table    | web
 public | indefero_idf_timeline_id_seq                               
    | sequence | web
 public | indefero_idf_uploads                                       
    | table    | web
 public | indefero_idf_uploads_id_seq                                
    | sequence | web
 public | indefero_idf_wiki_page_pluf_user_assoc                     
    | table    | web
 public | 
indefero_idf_wiki_pagerevision_idf_wiki_resourcerevision_assoc | 
table    | web
 public | indefero_idf_wikipagerevs                                  
    | table    | web
 public | indefero_idf_wikipages                                     
    | table    | web
 public | indefero_idf_wikipages_id_seq                              
    | sequence | web
 public | indefero_idf_wikiresourcerevs                              
    | table    | web
 public | indefero_idf_wikiresourcerevs_id_seq                       
    | sequence | web
 public | indefero_idf_wikiresources                                 
    | table    | web
 public | indefero_idf_wikiresources_id_seq                          
    | sequence | web
 public | indefero_idf_wikirevisions_id_seq                          
    | sequence | web
 public | indefero_messages                                          
    | table    | web
 public | indefero_messages_id_seq                                   
    | sequence | web
 public | indefero_permissions                                       
    | table    | web
 public | indefero_permissions_id_seq                                
    | sequence | web
 public | indefero_pluf_group_pluf_permission_assoc                  
    | table    | web
 public | indefero_pluf_group_pluf_user_assoc                        
    | table    | web
 public | indefero_pluf_permission_pluf_user_assoc                   
    | table    | web
 public | indefero_pluf_queue                                        
    | table    | web
 public | indefero_pluf_queue_id_seq                                 
    | sequence | web
 public | indefero_pluf_search_occs                                  
    | table    | web
 public | indefero_pluf_search_occs_id_seq                           
    | sequence | web
 public | indefero_pluf_search_stats                                 
    | table    | web
 public | indefero_pluf_search_stats_id_seq                          
    | sequence | web
 public | indefero_pluf_search_words                                 
    | table    | web
 public | indefero_pluf_search_words_id_seq                          
    | sequence | web
 public | indefero_rowpermissions                                    
    | table    | web
 public | indefero_rowpermissions_id_seq                             
    | sequence | web
 public | indefero_schema_info                                       
    | table    | web
 public | indefero_schema_info_id_seq                                
    | sequence | web
 public | indefero_sessions                                          
    | table    | web
 public | indefero_sessions_id_seq                                   
    | sequence | web
 public | indefero_users                                             
    | table    | web
 public | indefero_users_id_seq                                      
    | sequence | web
(84 rows)

Comment 7 by Sindre Myren, Apr 18, 2012

Sorry for ugly formatting - Some extra line breaks seems to be 
inserted by InDefero issue report:)

I woud fix it if there was an edit button (like on GitHub;-)

Comment 8 by Sindre Myren, Apr 18, 2012

Actually missed your update.

It seems to work now:0)

Comment 9 by Sindre Myren, Apr 18, 2012

Next error (admin/projects/ view):


Exception making GET request to /code/admin/projects/
ERROR: duplicate key value violates unique constraint 
"indefero_idf_conf_project_vkey_idx" DETAIL: Key (project, 
vkey)=(29, repository_size_check_date) already exists. - INSERT INTO 
indefero_idf_conf ("project", "vkey", 
"vdesc") VALUES (29, 'repository_size_check_date', 
'1334785223')

PHP	/home/www/pluf/src/Pluf/DB/PostgreSQL.php, line 163
URI	GET /code/admin/projects/
Stacktrace ▼

Pluf_DB_PostgreSQL->execute [/home/www/pluf/src/Pluf/Model.php, 
line 768]
▶ Args
▶ Src
Pluf_Model->create [/home/www/indefero/src/IDF/Conf.php, 
line 109]
▶ Src
IDF_Conf->setVal [/home/www/indefero/src/IDF/Project.php, line 
505]
▶ Args
▶ Src
IDF_Project->getRepositorySize 
[/home/www/indefero/src/IDF/Views/Admin.php, line 566]
▶ Args
▶ Src
IDF_Views_Admin_getForgeSize 
[/home/www/indefero/src/IDF/Views/Admin.php, line 99]
▶ Src
IDF_Views_Admin->projects 
[/home/www/pluf/src/Pluf/Dispatcher.php, line 202]
▶ Args
▶ Src
Pluf_Dispatcher::send [/home/www/pluf/src/Pluf/Dispatcher.php, line 
129]
▶ Args
▶ Src
Pluf_Dispatcher::match [/home/www/pluf/src/Pluf/Dispatcher.php, line 
56]
▶ Args
▶ Src
Pluf_Dispatcher::dispatch [/home/www/indefero/www/index.php, line 
28]
▶ Args
▶ Src

Comment 10 by Thomas Keller, Apr 18, 2012

Argh... Help...?! Seriously, thanks for all the testing, but this 
dbms is driving me nuts. Could somebody please help out?

There is another issue reported by Carlo which needs attention as 
well (project attribute not nullable) - I'll try to fix this at 
first.

Comment 11 by Sindre Myren, Apr 18, 2012

The later page suddenly started working...

Comment 12 by Sindre Myren, Apr 19, 2012

I realize that this must be tiresome! Hope some PHP hackers will 
help you! I guess I can't do much more then continue to test the 
software. I really do suck at PHP:P

When trying to add a label to a project, I get this:

Exception making POST request to /code/p/myrenett/admin/
ERROR: insert or update on table "indefero_idf_tags" 
violates foreign key constraint 
"indefero_idf_tags_project_fkey" DETAIL: Key (project)=(0) 
is not present in table "indefero_idf_projects". - INSERT 
INTO indefero_idf_tags ("project", "class", 
"name", "lcname") VALUES (0, 'UI', 'GUI', 'gui')

PHP	/home/www/pluf/src/Pluf/DB/PostgreSQL.php, line 163
URI	POST /code/p/myrenett/admin/
Stacktrace ▼

Pluf_DB_PostgreSQL->execute [/home/www/pluf/src/Pluf/Model.php, 
line 768]
▶ Args
▶ Src
Pluf_Model->create [/home/www/indefero/src/IDF/Tag.php, line 158]
▶ Src
IDF_Tag::addGlobal [/home/www/indefero/src/IDF/Form/ProjectConf.php, 
line 183]
▶ Args
▶ Src
IDF_Form_ProjectConf->save 
[/home/www/indefero/src/IDF/Views/Project.php, line 303]
▶ Src
IDF_Views_Project->admin [/home/www/pluf/src/Pluf/Dispatcher.php, 
line 202]
▶ Args
▶ Src
Pluf_Dispatcher::send [/home/www/pluf/src/Pluf/Dispatcher.php, line 
129]
▶ Args
▶ Src
Pluf_Dispatcher::match [/home/www/pluf/src/Pluf/Dispatcher.php, line 
56]
▶ Args
▶ Src
Pluf_Dispatcher::dispatch [/home/www/indefero/www/index.php, line 
28]
▶ Args
▶ Src

Comment 13 by Thomas Keller, Apr 19, 2012

This was the same issue Carlo reported. Should be fixed with 
revision 75f6266. Note the new migration file.

Comment 14 by Thomas Keller, Apr 19, 2012

Another small fix in revision b7ad4bf.

Comment 15 by Carlo Kok, Apr 19, 2012

Worked! Thanks. I'll let you know if I find any more.

Comment 16 by Thomas Keller, Apr 22, 2012

I set this issue to fixed unless more things pop up. I'll reopen 
this issue then. Thanks again for reporting.
Status: Fixed
Owner: tommyd

Comment 17 by Robin Bourianes, May 11, 2012

Hi everyone,

I think all the issues with postgresql are not solved yet.
Doing a clean install of indefero 1.3.2 I get this when installing 
the tables :

$> php /var/lib/indefero/pluf/src/migrate.php 
--conf=IDF/conf/idf.php -a -i -d
PHP include path: 
.:/usr/share/php:/usr/share/pear:/var/lib/indefero/pluf-master/src
Install all the apps
Pluf_Migrations_Install_setup
IDF_Migrations_Install_setup
PHP Fatal error:  Uncaught exception 'Exception' with message 
'ERREUR:  la relation « indefero_idf_projects » n'existe pas - 
CREATE TABLE indefero_idf_projectactivities (
"id" serial NOT NULL,
"project" integer NOT NULL default 0,
"date" timestamp NOT NULL default '0001-01-01 00:00:00',
"value" real NOT NULL default '0',
CONSTRAINT indefero_idf_projectactivities_pkey PRIMARY KEY (id),
CONSTRAINT indefero_idf_projectactivities_project_fkey FOREIGN KEY 
("project")
      REFERENCES indefero_idf_projects (id) MATCH SIMPLE
      ON UPDATE NO ACTION ON DELETE NO ACTION
);' in /var/lib/indefero/pluf-master/src/Pluf/DB/PostgreSQL.php:163
Stack trace:
#0 /var/lib/indefero/pluf-master/src/Pluf/DB/Schema.php(71): 
Pluf_DB_PostgreSQL->execute('CREATE TABLE in...')
#1 
/var/lib/indefero/indefero-1.3.2/src/IDF/Migrations/Install.php(63): 
Pluf_DB_Schema->createTables()
#2 /var/lib/indefero/pluf-master/src/Pluf/Migration.php(179): 
IDF_Migrations_Install_setup()
#3 /var/lib/indefero/pluf-master/src/Pluf/Migration.php(86): 
Pluf_Migration->insta in 
/var/lib/indefero/pluf-master/src/Pluf/DB/PostgreSQL.php on line 163

I had a look in the code and I think (I have very little knowledge 
of sql sorry) that the problem is that you try to create table 
idf_projects with a relation to table idf_projectactivities (cf. 
src/IDF/Project.php line 111) that gets created later (cf. 
src/IDF/Migrations/Install.php line 33). I tried to reverse order of 
creation but idf_projectactivities also needs idf_projects table ...

I don't know if this is postgresql specific though ...
Thanks for any hints !

Comment 18 by Robin Bourianes, May 11, 2012

Mmh sorry i copy/pasted the error message from my modified version 
(with table idf_projects and idf_projectactivities creation order 
swapped).

Here is the one I get with vanilla code:

PHP include path: 
.:/usr/share/php:/usr/share/pear:/var/lib/indefero/pluf-master/src
Install all the apps
Pluf_Migrations_Install_setup
IDF_Migrations_Install_setup
PHP Fatal error:  Uncaught exception 'Exception' with message 
'ERREUR:  la relation « indefero_idf_projectactivities » n'existe 
pas - CREATE TABLE indefero_idf_projects (
"id" serial NOT NULL,
"name" character varying NOT NULL default '',
"shortname" character varying NOT NULL default '',
"shortdesc" character varying NOT NULL default '',
"description" text NOT NULL default '',
"private" integer NOT NULL default 0,
"current_activity" integer NOT NULL default 0,
CONSTRAINT indefero_idf_projects_pkey PRIMARY KEY (id),
CONSTRAINT indefero_idf_projects_current_activity_fkey FOREIGN KEY 
("current_activity")
      REFERENCES indefero_idf_projectactivities (id) MATCH SIMPLE
      ON UPDATE NO ACTION ON DELETE NO ACTION
);' in /var/lib/indefero/pluf-master/src/Pluf/DB/PostgreSQL.php:163
Stack trace:
#0 /var/lib/indefero/pluf-master/src/Pluf/DB/Schema.php(71): 
Pluf_DB_PostgreSQL->execute('CREATE TABLE in...')
#1 
/var/lib/indefero/indefero-1.3.2/src/IDF/Migrations/Install.php(63): 
Pluf_DB_Schema->createTables()
#2 /var/lib/indefero/pl in 
/var/lib/indefero/pluf-master/src/Pluf/DB/PostgreSQL.php on line 163

Comment 19 by Robin Bourianes, May 11, 2012

If i comment this :

'current_activity' =>                             
 array(                                            
       'type' => 'Pluf_DB_Field_Foreignkey',       
       'model' => 'IDF_ProjectActivity',           
       'blank' => true,                            
       'verbose' => __('current project activity'),               
                                                                
       ),

from src/IDF/Project.php line 103 install runs fine.

Comment 20 by Thomas Keller, May 11, 2012

It is actually Postgres-specific, because Pluf, the underlying 
framework Indefero uses, only creates foreign key relations between 
tables for Postgres, but not MySQL.

The actual problem is now that IDF_Project as well as 
IDF_ProjectActivity both reference each other; IDF_Project has a 
single reference to the most recent activity (N:1), and is a foreign 
key for each row in IDF_ProjectActivity as well (1:N). That alone is 
not the problem, since one could handle this case by creating the 
tables in first instance and the constraints afterwards. That, 
however, is something that Pluf currently does not support. It tries 
to create all the constraints in the same run the tables itself are 
created and fails.

I fear that - since Pluf is more or less dead nowadays - this will 
be a rather hard fix. Investigating...
Status: Accepted

Comment 21 by Thomas Keller, May 12, 2012

I created two patches, one for Indefero and one for Pluf. Please 
apply each one with `-p1` in the root of each project. Give me 
feedback if this fixes your issue.

Please also try if removing, backing up and restoring a IDF 
installation works equally well with them. Have a look at Pluf's 
`src/migrate.php -h` help output how to do so. Thanks!

Comment 22 by Robin Bourianes, May 12, 2012

I had to add:
$field = new $val['type']();
after applying the patch in pluf's PostgreSQL.php after lines 189 
and 269.
Then I get this new error message:

PHP Fatal error:  Uncaught exception 'Exception' with message 
'ERREUR:  il n'existe aucune contrainte unique correspondant aux 
clés données pour la
table « indefero_idf_projectactivities » référencée - ALTER TABLE 
indefero_idf_projects ADD CONSTRAINT 
indefero_idf_projects_current_activity_fkey
                    FOREIGN KEY ("current_activity")
                    REFERENCES indefero_idf_projectactivities (id) 
MATCH SIMPLE
                    ON UPDATE NO ACTION ON DELETE NO ACTION' in 
/var/lib/indefero/pluf-master/src/Pluf/DB/PostgreSQL.php:163
Stack trace:
#0 /var/lib/indefero/pluf-master/src/Pluf/DB/Schema.php(94): 
Pluf_DB_PostgreSQL->execute('ALTER TABLE ind...')
#1 
/var/lib/indefero/indefero-1.3.2/src/IDF/Migrations/Install.php(67): 
Pluf_DB_Schema->createConstraints()
#2 /var/lib/indefero/pluf-master/src/Pluf/Migration.php(179): 
IDF_Migrations_Install_setup()
#3 /var/lib/indefero/pluf-master/src/Pluf/Migration.php(86): 
Pluf_Migration->installApp('IDF')
#4 /var/lib/indefero/pluf-master/src/migrate.php(227): Pluf_Mi in 
/var/lib/indefero/pluf-master/src/Pluf/DB/PostgreSQL.php on line 163

But I have no clue about this one ...
I won't be able to test any further until monday.
Thanks for the quick feedback anyway !

Comment 23 by Thomas Keller, May 12, 2012

The pluf patch had two issues - please try this one.

Comment 24 by Thomas Keller, May 12, 2012

Ok, forget the patch above, you've already figured that out. I'm 
testing this in parallel with MySQL's InnoDB as well. Coming back to 
you later on.

Comment 25 by Thomas Keller, May 12, 2012

New patch for pluf, this time with working MySQL and hopefully also 
working Postgres included...

Comment 26 by Robin Bourianes, May 14, 2012

I tried with the latest patch (redownloading pluf and applying the 
new patch) but it gives me this error:

PHP Fatal error:  Uncaught exception 'Exception' with message 
'ERREUR:  la contrainte « 
indefero_idf_wiki_pagerevision_idf_wiki_resourcerevision_assoc_ » de 
la relation « 
indefero_idf_wiki_pagerevision_idf_wiki_resourcerevision_assoc » 
existe déjà - ALTER TABLE 
indefero_idf_wiki_pagerevision_idf_wiki_resourcerevision_assoc ADD 
CONSTRAINT 
indefero_idf_wiki_pagerevision_idf_wiki_resourcerevision_assoc_fkey1

                FOREIGN KEY (idf_wiki_resourcerevision_id)
                REFERENCES indefero_idf_wikiresourcerevs (id) MATCH 
SIMPLE
                ON UPDATE NO ACTION ON DELETE NO ACTION' in 
/var/lib/indefero/pluf-master/src/Pluf/DB/PostgreSQL.php:163
Stack trace:
#0 /var/lib/indefero/pluf-master/src/Pluf/DB/Schema.php(94): 
Pluf_DB_PostgreSQL->execute('ALTER TABLE ind...')
#1 
/var/lib/indefero/indefero-1.3.2/src/IDF/Migrations/Install.php(67): 
Pluf_DB_Schema->createConstraints()
#2 /var/lib/indefero/pluf-master/src/Pluf/Migration.php(179): 
IDF_Migrations_Install_setup()
#3 /var/lib/indefero/pluf-master/src/Pluf/Migra in 
/var/lib/indefero/pluf-master/src/Pluf/DB/PostgreSQL.php on line 163

Comment 27 by Thomas Keller, May 14, 2012

New Pluf patch. Seems as if Postgres (like MySQL) chokes about long 
identifier names, e.g. those generated through foreign key 
relations. This should be fixed with a little trick. Tested on a 
local Postgres 9.1 installation. Installation and removal go through 
without problems.

Labels: Milestone:Release1.3.3 Milestone:Release1.3.1

Comment 28 by Robin Bourianes, May 15, 2012

Installation worked! Thanks Thomas!

Comment 29 by Robin Bourianes, May 15, 2012

Ah, but when i try to create a project I get the following error:

Exception making POST request to /admin/projects/create/
ERREUR: une instruction insert ou update sur la table « 
indefero_idf_projects » viole la contrainte de clé étrangère « 
indefero_idf_projects_current_activity_fkey » DETAIL: La clé 
(current_activity)=(0) n'est pas présente dans la table « 
indefero_idf_projectactivities ». - INSERT INTO 
indefero_idf_projects ("name", "shortname", 
"shortdesc", "description", "private", 
"current_activity") VALUES ('cmu', 'cmu', 'CMake 
Utilities', 'Click on the Project Management tab to set the 
description of your project.', 0, 0)
PHP 	/var/lib/indefero/pluf-master/src/Pluf/DB/PostgreSQL.php, line 
163
URI 	POST /admin/projects/create/
Stacktrace ▼

    Pluf_DB_PostgreSQL->execute 
[/var/lib/indefero/pluf-master/src/Pluf/Model.php, line 768]
    ▶ Args
    ▶ Src
    Pluf_Model->create 
[/var/lib/indefero/indefero-1.3.2/src/IDF/Form/Admin/ProjectCreate.ph
p, line 358]
    ▶ Src
    IDF_Form_Admin_ProjectCreate->save 
[/var/lib/indefero/indefero-1.3.2/src/IDF/Views/Admin.php, line 191]
    ▶ Src
    IDF_Views_Admin->projectCreate 
[/var/lib/indefero/pluf-master/src/Pluf/Dispatcher.php, line 202]
    ▶ Args
    ▶ Src
    Pluf_Dispatcher::send 
[/var/lib/indefero/pluf-master/src/Pluf/Dispatcher.php, line 129]
    ▶ Args
    ▶ Src
    Pluf_Dispatcher::match 
[/var/lib/indefero/pluf-master/src/Pluf/Dispatcher.php, line 56]
    ▶ Args
    ▶ Src
    Pluf_Dispatcher::dispatch 
[/var/lib/indefero/indefero-1.3.2/www/index.php, line 28]
    ▶ Args
    ▶ Src

Comment 30 by Thomas Keller, May 15, 2012

Its always the litte stuff. Either set up the IDF database again 
after you applied the attached patch or execute the following SQL on 
your database:

ALTER TABLE indefero_idf_projects ALTER COLUMN current_activity DROP 
NOT NULL;

(change "indefero_" to your db prefix if you use any)

Comment 31 by Thomas Keller, May 15, 2012

Please also try to attach tags to a project, I _think_ there is 
another issue that prevents that from being successful (patch 
attached).

Comment 32 by Robin Bourianes, May 16, 2012

Ok, I can create projects now, and I can attach tags to a project.
Seems ok so far.

Comment 33 by Lennie, May 21, 2012

Not sure if this is useful to you.

I just want to report: works-for-me-too

issue-800-pluf.diff and the last issue-800-indefero2.diff

applied perfectly (except for the NEWS.mdtext).

If you ask me you can tag, label, whatever these files for 1.3.3, 
release it and change the status of this bugreport ;-)

That would have saved me some time looking for a solution.

Comment 34 by Thomas Keller, May 21, 2012

Sorry for your time. I will release the IDF change as soon as Loic 
reviewed and merged the Pluf change.

Comment 35 by Thomas Keller, Aug 3, 2012

Status: Fixed

Created: 1 year 1 month ago by Sindre Myren

Updated: 9 months 19 days ago

Status: Fixed

Owner: Thomas Keller

Followed by: 4 persons

Labels:
Type:Defect
Priority:Medium
Milestone:Release1.3.3