3.20RC1 Calendar Queries

I know that 3.20 RC1 is not supported at all, but I am doing some testing in it with the Calendar package but I am getting errors when trying to create a Single Calendar Event, obviously because I didn't know the SQL queries to run when I installed it.


I am getting:


    Raw Entry:	[07-Dec-2008 18:57:57] PHP Fatal error: Uncaught exception 'Exception' with message 'SQLSTATE[42P01]: Undefined table: 7 ERROR: relation "sq_cal_date_val" does not exist' in /home/websites/mysource_matrix/packages/calendar/calendar_event/calendar_event.inc:781
    Raw Entry:	Stack trace:
    Raw Entry:	#0 /home/websites/mysource_matrix/packages/calendar/calendar_event/calendar_event.inc(90): Calendar_Event->cacheCalendarData(false)
    Raw Entry:	#1 /home/websites/mysource_matrix/core/include/asset.inc(463): Calendar_Event->_createAdditional(Array)
    Raw Entry:	#2 /home/websites/mysource_matrix/core/include/asset.inc(4388): Asset->create(Array)
    Raw Entry:	#3 /home/websites/mysource_matrix/core/include/asset_manager_edit_fns.inc(120): Asset->processBackend(Object(Backend_Outputter), Array)
    Raw Entry:	#4 /home/websites/mysource_matrix/core/include/asset_manager.inc(8059): Asset_Manager_Edit_Fns->paintBackend()
    Raw Entry:	#5 /home/websites/mysource_matrix/core/include/backend.inc(1471): Asset_Manager->paintBackend(Object(Backend))
    Raw Entry:	#6 /home/websites/mysource_matrix/core/include/backend.inc(189): Backend->_printMain()
    Raw Entry:	#7 /home/websites/mysou in /home/websites/mysource_matrix/packages/calendar/calendar_event/calendar_event.inc on line 781


Could someone tell me the query to run to add the sq_cal_date_val table and fix this error?

Thanks, and again, this is only for testing...

Running step_02.php during the upgrade or install will create all required tables for you. Did you get any errors when you ran it?


I didn't think that I did, so I just re-ran it, and I didn't get any errors.

Looks to me like the tables were created:

[codebox]PGSQL STORED FUNCTIONS CREATED
sq_grant_access Function
sq_set_rollback_timestamp(TIMESTAMP) Function
sq_set_rollback_timestamp Function
sq_get_rollback_timestamp Function
sq_get_lineage_from_url Function
sq_get_parent_treeids(VARCHAR, INT, TIMESTAMP) Function
sq_get_parent_treeids(VARCHAR, INT) Function
sq_rb_get_parent_treeids(VARCHAR, INT) Function
sq_get_lineage_treeids(VARCHAR, INT, TIMESTAMP) Function
sq_get_lineage_treeids(VARCHAR, INT) Function
sq_rb_get_lineage_treeids(VARCHAR, INT) Function
atoi Function
asset_link_treeid_convert Function
------------------------------------

------------------------------------
TABLE CREATION COMPLETE
No new tables added
------------------------------------

------------------------------------
INDEX CREATION COMPLETE
No Indexes added
------------------------------------

------------------------------------
SEQUENCE CREATION COMPLETE
------------------------------------

*** Package: bulkmail

------------------------------------
TABLE CREATION COMPLETE
New Tables:
sq_bmail_queue
------------------------------------

------------------------------------
INDEX CREATION COMPLETE
New Indexes:
sq_bmail_queue_po_id
sq_bmail_queue_status
------------------------------------

------------------------------------
SEQUENCE CREATION COMPLETE
------------------------------------

*** Package: calendar

------------------------------------
TABLE CREATION COMPLETE
New Tables:
sq_cal_date_val
sq_rb_cal_date_val
------------------------------------

------------------------------------
INDEX CREATION COMPLETE
New Indexes:
sq_rb_cal_date_val_assetid
sq_rb_cal_date_val_effrm
sq_rb_cal_date_val_efto
------------------------------------

------------------------------------
SEQUENCE CREATION COMPLETE
------------------------------------

*** Package: search

------------------------------------
TABLE CREATION COMPLETE
New Tables:
sq_sch_idx
------------------------------------

------------------------------------
INDEX CREATION COMPLETE
New Indexes:
sq_sch_idx_assetid
sq_sch_idx_type
sq_sch_idx_component
------------------------------------

------------------------------------
SEQUENCE CREATION COMPLETE
------------------------------------[/codebox]

What does it mean when it talks about a relation does not exist?

Looks like it didn't work the first time, but looks to have worked now. Is it working?


No, I am still getting the error even after re-running step_02. :(

I get the same kind of thing when turning on the search manager and trying to index:

    Raw Entry:	[07-Dec-2008 23:09:59] PHP Fatal error: Uncaught exception 'Exception' with message 'Unable to flush indexable content due to database error: SQLSTATE[42P01]: Undefined table: 7 ERROR: relation "sq_sch_idx" does not exist' in /home/websites/mysource_matrix/packages/search/search_manager/search_manager.inc:749
    Raw Entry:	Stack trace:
    Raw Entry:	#0 /home/websites/mysource_matrix/packages/search/search_manager/search_manager.inc(301): Search_Manager->flushIndexableContent('3162', Array)
    Raw Entry:	#1 /home/websites/mysource_matrix/packages/search/hipo_jobs/hipo_job_reindex.inc(248): Search_Manager->reindexAsset(Object(Image), Array)
    Raw Entry:	#2 /home/websites/mysource_matrix/core/hipo/hipo_job.inc(1263): HIPO_Job_ReIndex->processReIndex(Array, 'hipo_job_reinde...')
    Raw Entry:	#3 /home/websites/mysource_matrix/core/hipo/hipo_job.inc(1160): HIPO_Job->processWeb(Array, 'hipo_job_reinde...')
    Raw Entry:	#4 /home/websites/mysource_matrix/core/hipo/hipo_herder.inc(209): HIPO_Job->process()
    Raw Entry:	#5 /home/websites/mysource_matrix/core/include/mysource.inc(1341): HIPO_Herder->processWeb()
    Raw Entry:	#6 /home/websites/mysource_matrix/core/ in /home/websites/mysource_matrix/packages/search/search_manager/search_manager.inc on line 749

If you log into the psql CLI interface (or whatever interface you have), can you see the tables? I'm wondering if maybe the table does exist but one of the Matrix users does not have access to view it.


Doesn't look like they are there at all.

I ran \dt and got:

[codebox] Schema | Name | Type | Owner
--------+--------------------------+-------+--------
public | sq_ast | table | matrix
public | sq_ast_attr | table | matrix
public | sq_ast_attr_uniq_val | table | matrix
public | sq_ast_attr_val | table | matrix
public | sq_ast_edit_access | table | matrix
public | sq_ast_lnk | table | matrix
public | sq_ast_lnk_tree | table | matrix
public | sq_ast_lookup | table | matrix
public | sq_ast_lookup_remap | table | matrix
public | sq_ast_lookup_value | table | matrix
public | sq_ast_mdata | table | matrix
public | sq_ast_mdata_dflt_val | table | matrix
public | sq_ast_mdata_val | table | matrix
public | sq_ast_path | table | matrix
public | sq_ast_perm | table | matrix
public | sq_ast_role | table | matrix
public | sq_ast_typ | table | matrix
public | sq_ast_typ_inhd | table | matrix
public | sq_ast_url | table | matrix
public | sq_ast_wflow | table | matrix
public | sq_cache | table | matrix
public | sq_file_vers_file | table | matrix
public | sq_file_vers_history | table | matrix
public | sq_file_vers_lock | table | matrix
public | sq_hipo_job | table | matrix
public | sq_internal_msg | table | matrix
public | sq_lock | table | matrix
public | sq_patches | table | matrix
public | sq_pkg | table | matrix
public | sq_rb_ast | table | matrix
public | sq_rb_ast_attr_uniq_val | table | matrix
public | sq_rb_ast_attr_val | table | matrix
public | sq_rb_ast_edit_access | table | matrix
public | sq_rb_ast_lnk | table | matrix
public | sq_rb_ast_lnk_tree | table | matrix
public | sq_rb_ast_lookup | table | matrix
public | sq_rb_ast_lookup_remap | table | matrix
public | sq_rb_ast_lookup_value | table | matrix
public | sq_rb_ast_mdata | table | matrix
public | sq_rb_ast_mdata_dflt_val | table | matrix
public | sq_rb_ast_mdata_val | table | matrix
public | sq_rb_ast_path | table | matrix
public | sq_rb_ast_perm | table | matrix
public | sq_rb_ast_role | table | matrix
public | sq_rb_ast_url | table | matrix
public | sq_rb_ast_wflow | table | matrix
public | sq_rb_shdw_ast_lnk | table | matrix
public | sq_rb_trig | table | matrix
public | sq_shdw_ast_lnk | table | matrix
public | sq_thes_lnk | table | matrix
public | sq_thes_rel | table | matrix
public | sq_thes_term | table | matrix
public | sq_thes_term_note | table | matrix
public | sq_trig | table | matrix
public | sq_trig_hash | table | matrix
(55 rows)[/codebox]

I have to ask :slight_smile:


Are you sure you are using the same DB and usernames? We've never had any install problems and you get no DB errors while creating tables. It just seems very strange that the install reports tables created but your DB is not showing them to you.


I don't think so. I log into the my server as root, and stay as that, then run:

    psql -U matrix -d mysource_matrix


matrix is the user that I created when doing my initial install, same user as the Matrix website says to create. I guess I don't run step_02 as this user, should I be?

Is there another way that I could not be using the same DB and usernames?

There are only 4 databases, of which matrix uses the mysource_matrix database, with the correct matrix owner:

    		   List of databases
    	  Name	   |  Owner   | Encoding  
    -----------------+----------+-----------
     mysource_matrix | matrix   | SQL_ASCII
     postgres		| postgres | SQL_ASCII
     template0	   | postgres | SQL_ASCII
     template1	   | postgres | SQL_ASCII
    (4 rows)

I cant think of anything. I don't think I can help any more either. Something is obviously going wrong but I'm just not sure what it is without replicating or debugging it.


Thats ok, I am sure I missed some other required steps since I didn't have any official install steps. I will just wait for 3.20 and hope that doing those steps fix the problem. :)

BTW, if it helps, I was upgrading from 3.18.7.

Can you turn on log_statement in postgres, and try to capture the error that way?

Sadly, upgrading to 3.20 has not fixed this problem. :frowning: I will look into logging more errors on postgres.

Is there something else that I can try here? Something manually in the database?


I can't even use the find/replace or the quicksearch because of this. :frowning: