Russian version




About  •  Demo  •  Download  •  Forum

Forum «Install»

Your e-mail:    store password   
Your password:

Mark the check-box "store password", in case of browsing our site from your own computer.

Apache - Internal Server Error

bram@freedomlink.net  22.08.2003 21:35

I really want to try out the agenda app, but I am running into some troubles. I have everything set up correctly in httpd.conf, and I have all of the proper modules installed for perl but when I try to access agenda apache throws a "500 Internal Server Error" after I enter the username and password. The apache error log gives me this output:

DBD::Pg::db selectall_arrayref failed: ERROR: Function task_complete(integer, "unknown") does not exist at /home/httpd/htdocs/agenda/modules/Agenda/tasks.pm line 1383.
DBD::Pg::db selectall_arrayref failed: ERROR: Function task_complete(integer, "unknown") does not exist at /home/httpd/htdocs/agenda/modules/Agenda/tasks.pm line 841.
DBD::Pg::db selectall_arrayref failed: ERROR: Function abs(text) does not exist at /home/httpd/htdocs/agenda/modules/Agenda/people.pm line 511.
[Fri Aug 22 12:28:33 2003] [error] Can't use an undefined value as an ARRAY reference at /home/httpd/htdocs/agenda/modules/Agenda/people.pm line 516.

It looks as if there is some problem accessing the database, but it is active and appears to be intact. Here is some output from psql:

agenda=# \d List of relations Schema | Name | Type | Owner
--------+-----------------------+----------+---------- public | attentions | table | postgres public | can_assign_task | table | postgres public | clients | table | postgres public | departments | table | postgres public | history | table | postgres public | history_detail | table | postgres public | jobs | table | postgres public | keywords | table | postgres public | languages | table | postgres public | payments | table | postgres public | posts | table | postgres public | posts_hierarchy | table | postgres public | projects | table | postgres public | responsibles | table | postgres public | screens | table | postgres public | seq_attentions | sequence | postgres public | seq_clients | sequence | postgres public | seq_departments | sequence | postgres public | seq_history | sequence | postgres public | seq_payments | sequence | postgres public | seq_posts | sequence | postgres public | seq_projects | sequence | postgres public | seq_tasks | sequence | postgres public | seq_template_tasks | sequence | postgres public | seq_users | sequence | postgres public | seq_works | sequence | postgres public | tasks | table | postgres public | template_responsibles | table | postgres public | template_tasks | table | postgres public | users | table | postgres public | works | table | postgres
(31 rows)

Any help would be greatly appreciated as I am very interested in using Agenda.

Thank you,
Bram Swenson.
<bram@freedomlink.net>

bram@freedomlink.net  22.08.2003 23:26

Ok, I think I have it narrowed down to some missing functions in the database that was created. hence the "ERROR: Function ... does not exist" errors. I tried to rerun the agenda_pg.sql script again and here is the output:

zappa scripts # psql agenda -U postgres -f agenda_pg.sql
Password:
psql:agenda_pg.sql:1: ERROR: Relation 'seq_payments' already exists
GRANT
DROP TABLE
CREATE TABLE
CREATE INDEX
psql:agenda_pg.sql:21: NOTICE: ALTER TABLE / ADD PRIMARY KEY will create implicit index 'payments_pkey' for table 'payments'
ALTER TABLE
GRANT
DROP TABLE
CREATE TABLE
CREATE INDEX
CREATE INDEX
psql:agenda_pg.sql:45: NOTICE: ALTER TABLE / ADD PRIMARY KEY will create implicit index 'jobs_pkey' for table 'jobs'
ALTER TABLE
GRANT
DROP TABLE
CREATE TABLE
CREATE INDEX
CREATE INDEX
psql:agenda_pg.sql:68: NOTICE: ALTER TABLE / ADD PRIMARY KEY will create implicit index 'posts_hierarchy_pkey' for table 'posts_hierarchy'
ALTER TABLE
GRANT
psql:agenda_pg.sql:72: ERROR: Relation 'seq_works' already exists
GRANT
DROP TABLE
CREATE TABLE
CREATE INDEX
CREATE INDEX
psql:agenda_pg.sql:101: NOTICE: ALTER TABLE / ADD PRIMARY KEY will create implicit index 'works_pkey' for table 'works'
ALTER TABLE
GRANT
DROP TABLE
CREATE TABLE
CREATE INDEX
psql:agenda_pg.sql:120: NOTICE: ALTER TABLE / ADD PRIMARY KEY will create implicit index 'history_detail_pkey' for table 'history_detail'
ALTER TABLE
GRANT
psql:agenda_pg.sql:124: ERROR: Relation 'seq_history' already exists
GRANT
DROP TABLE
CREATE TABLE
CREATE INDEX
CREATE INDEX
CREATE INDEX
psql:agenda_pg.sql:155: NOTICE: ALTER TABLE / ADD PRIMARY KEY will create implicit index 'history_pkey' for table 'history'
ALTER TABLE
GRANT
DROP TABLE
CREATE TABLE
CREATE INDEX
CREATE INDEX
psql:agenda_pg.sql:178: NOTICE: ALTER TABLE / ADD PRIMARY KEY will create implicit index 'responsibles_pkey' for table 'responsibles'
ALTER TABLE
GRANT
psql:agenda_pg.sql:182: ERROR: Relation 'seq_tasks' already exists
GRANT
DROP TABLE
CREATE TABLE
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
psql:agenda_pg.sql:235: NOTICE: ALTER TABLE / ADD PRIMARY KEY will create implicit index 'tasks_pkey' for table 'tasks'
ALTER TABLE
GRANT
DROP TABLE
CREATE TABLE
CREATE INDEX
CREATE INDEX
psql:agenda_pg.sql:258: NOTICE: ALTER TABLE / ADD PRIMARY KEY will create implicit index 'template_responsibles_pkey' for table 'template_responsibles'
ALTER TABLE
GRANT
DROP TABLE
CREATE TABLE
CREATE INDEX
CREATE INDEX
psql:agenda_pg.sql:281: NOTICE: ALTER TABLE / ADD PRIMARY KEY will create implicit index 'can_assign_task_pkey' for table 'can_assign_task'
ALTER TABLE
GRANT
psql:agenda_pg.sql:285: ERROR: Relation 'seq_posts' already exists
GRANT
DROP TABLE
CREATE TABLE
CREATE INDEX
psql:agenda_pg.sql:304: NOTICE: ALTER TABLE / ADD PRIMARY KEY will create implicit index 'posts_pkey' for table 'posts'
ALTER TABLE
GRANT
psql:agenda_pg.sql:308: ERROR: Relation 'seq_attentions' already exists
GRANT
DROP TABLE
CREATE TABLE
CREATE INDEX
psql:agenda_pg.sql:327: NOTICE: ALTER TABLE / ADD PRIMARY KEY will create implicit index 'attentions_pkey' for table 'attentions'
ALTER TABLE
GRANT
psql:agenda_pg.sql:331: ERROR: Relation 'seq_projects' already exists
GRANT
DROP TABLE
CREATE TABLE
CREATE INDEX
CREATE INDEX
CREATE INDEX
psql:agenda_pg.sql:369: NOTICE: ALTER TABLE / ADD PRIMARY KEY will create implicit index 'projects_pkey' for table 'projects'
ALTER TABLE
GRANT
psql:agenda_pg.sql:373: ERROR: Relation 'seq_users' already exists
GRANT
DROP TABLE
CREATE TABLE
CREATE INDEX
CREATE INDEX
psql:agenda_pg.sql:408: NOTICE: ALTER TABLE / ADD PRIMARY KEY will create implicit index 'users_pkey' for table 'users'
ALTER TABLE
GRANT
DROP TABLE
CREATE TABLE
CREATE INDEX
CREATE INDEX
psql:agenda_pg.sql:433: NOTICE: ALTER TABLE / ADD PRIMARY KEY will create implicit index 'keywords_pkey' for table 'keywords'
ALTER TABLE
GRANT
DROP TABLE
CREATE TABLE
psql:agenda_pg.sql:445: NOTICE: ALTER TABLE / ADD PRIMARY KEY will create implicit index 'screens_pkey' for table 'screens'
ALTER TABLE
GRANT
DROP TABLE
CREATE TABLE
psql:agenda_pg.sql:459: NOTICE: ALTER TABLE / ADD PRIMARY KEY will create implicit index 'languages_pkey' for table 'languages'
ALTER TABLE
GRANT
psql:agenda_pg.sql:463: ERROR: Relation 'seq_departments' already exists
GRANT
DROP TABLE
CREATE TABLE
psql:agenda_pg.sql:476: NOTICE: ALTER TABLE / ADD PRIMARY KEY will create implicit index 'departments_pkey' for table 'departments'
ALTER TABLE
GRANT
psql:agenda_pg.sql:480: ERROR: Relation 'seq_clients' already exists
GRANT
DROP TABLE
CREATE TABLE
psql:agenda_pg.sql:494: NOTICE: ALTER TABLE / ADD PRIMARY KEY will create implicit index 'clients_pkey' for table 'clients'
ALTER TABLE
GRANT
psql:agenda_pg.sql:498: ERROR: Relation 'seq_template_tasks' already exists
GRANT
DROP TABLE
CREATE TABLE
psql:agenda_pg.sql:515: NOTICE: ALTER TABLE / ADD PRIMARY KEY will create implicit index 'template_tasks_pkey' for table 'template_tasks'
ALTER TABLE
GRANT
psql:agenda_pg.sql:523: NOTICE: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
ALTER TABLE
psql:agenda_pg.sql:528: NOTICE: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
ALTER TABLE
psql:agenda_pg.sql:534: NOTICE: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
ALTER TABLE
psql:agenda_pg.sql:540: NOTICE: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
ALTER TABLE
psql:agenda_pg.sql:546: NOTICE: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
ALTER TABLE
psql:agenda_pg.sql:551: NOTICE: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
ALTER TABLE
psql:agenda_pg.sql:556: NOTICE: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
ALTER TABLE
psql:agenda_pg.sql:562: NOTICE: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
ALTER TABLE
psql:agenda_pg.sql:567: NOTICE: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
ALTER TABLE
psql:agenda_pg.sql:573: NOTICE: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
ALTER TABLE
psql:agenda_pg.sql:579: NOTICE: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
ALTER TABLE
psql:agenda_pg.sql:585: NOTICE: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
ALTER TABLE
psql:agenda_pg.sql:591: NOTICE: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
ALTER TABLE
psql:agenda_pg.sql:596: NOTICE: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
ALTER TABLE
psql:agenda_pg.sql:601: NOTICE: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
ALTER TABLE
psql:agenda_pg.sql:606: NOTICE: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
ALTER TABLE
psql:agenda_pg.sql:611: NOTICE: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
ALTER TABLE
psql:agenda_pg.sql:617: NOTICE: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
ALTER TABLE
psql:agenda_pg.sql:622: NOTICE: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
ALTER TABLE
psql:agenda_pg.sql:628: NOTICE: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
ALTER TABLE
psql:agenda_pg.sql:634: NOTICE: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
ALTER TABLE
psql:agenda_pg.sql:640: NOTICE: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
ALTER TABLE
psql:agenda_pg.sql:645: NOTICE: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
ALTER TABLE
psql:agenda_pg.sql:650: NOTICE: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
ALTER TABLE
psql:agenda_pg.sql:655: NOTICE: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
ALTER TABLE
psql:agenda_pg.sql:660: NOTICE: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
ALTER TABLE
psql:agenda_pg.sql:665: NOTICE: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
ALTER TABLE
psql:agenda_pg.sql:671: NOTICE: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
ALTER TABLE
psql:agenda_pg.sql:676: NOTICE: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
ALTER TABLE
INSERT 19392 1
psql:agenda_pg.sql:681: ERROR: RemoveFunction: function task_complete(integer, date) does not exist
psql:agenda_pg.sql:702: ERROR: language "plpgsql" does not exist
psql:agenda_pg.sql:712: ERROR: RemoveFunction: function is_child(integer, integer) does not exist
psql:agenda_pg.sql:732: ERROR: language "plpgsql" does not exist
psql:agenda_pg.sql:734: ERROR: RemoveFunction: function level(integer, integer, integer) does not exist
psql:agenda_pg.sql:751: ERROR: language "plpgsql" does not exist
psql:agenda_pg.sql:756: ERROR: RemoveFunction: function sortkey(integer, integer) does not exist
psql:agenda_pg.sql:778: ERROR: language "plpgsql" does not exist
zappa scripts #

It looks like everything goes well until the function declarations. I think postgres doesn't like the language setting as "plpgsql".

Again...Thanks in advance!
Bram Swenson.
<bram@freedomlink.net>

bram@freedomlink.net  22.08.2003 23:54

I figured out part of it!

The functions in the agenda_pg.sql script requires that the database have the plpgsql procedural language installed on it which by default it is not. After a quick look at the postgresql documentation at:

http://www.postgresql.org/docs/7.3/static/xplang-install.html

I found that you can install procedural langs by issueing the following command:

createlang -U <username> <procedurallang name> (in our case plpgsql) <dbname>

After issuing this command I reran the agenda_pg.sql and keywords.sql scripts and now my errors are less allthough I still get Internal Errors from Apache...at least we are closer!

So the remaining errors from apache error_log are:

DBD::Pg::db selectall_arrayref failed: ERROR: Function abs(text) does not exist at /home/httpd/htdocs/agenda/modules/Agenda/people.pm line 511.
[Fri Aug 22 14:33:56 2003] [error] Can't use an undefined value as an ARRAY reference at /home/httpd/htdocs/agenda/modules/Agenda/people.pm line 516.

It appears that the offending lines are in the get_birthdays subroutine in the people.pm module. I am not sure why this is happening, but it seems from the postgres docs that abs should be a built in function that produces absolute values.

I am open to suggestions at this point, but we seem to be close!

Thanks,
Bram.

bram@freedomlink.net  23.08.2003 00:22

Ok...We are really having some sql syntax issues here with agenda...What version of Postgres are you using to develop with? Are you installing and building on a clean postgres install when you test? BTW I am running PostgreSQL 7.3.3.

As far as my last error message goes:

DBD::Pg::db selectall_arrayref failed: ERROR: Function abs(text) does not exist at /home/httpd/htdocs/agenda/modules/Agenda/people.pm line 511.
[Fri Aug 22 14:33:56 2003] [error] Can't use an undefined value as an ARRAY reference at /home/httpd/htdocs/agenda/modules/Agenda/people.pm line 516.

I corrected this and belive it to be a bug...The SQL statment found in the people.pm->get_birthdays sub had some bad syntax with regards to typecasting. I have updated lines 512-515 in people.pm to this :

select usr_login, usr_first_name, usr_last_name, to_char(usr_birthday,'DD.MM.YYYY') as birthday, usr_email from users where abs(CAST(to_char(usr_birthday,'DDD') AS INT4)) - abs(CAST(to_char(current_date,'DDD') AS INT4)) between 0 and ? order by abs(CAST(to_char(usr_birthday,'DDD')AS INT4))", $Agenda::FIXUP, $self->{parent}{config}{BIRTHDAY_REMINDER});

If you notice I had to use the (CAST(...AS INT4)) function to get this query to work on my system.

The new error in apache error_log is:

DBD::Pg::db selectall_arrayref failed: ERROR: Unable to identify an operator '-' for types 'timestamp with time zone' and 'integer' at /home/httpd/htdocs/agenda/modules/Agenda/tasks.pm line 1273.
[Fri Aug 22 15:07:04 2003] [error] Can't use an undefined value as an ARRAY reference at /home/httpd/htdocs/agenda/modules/Agenda/tasks.pm line 1289.

Which is yet another SQL related issue...And I haven't even seen the first page yet! Please let me know if there is something I am missing here, as it seems that your installations of Agenda would suffer from the same issues if this was not an installation specific issue.

Kind Regards,
Bram Swenson.
<bram@freedomlink.net>


back to the top
Ñàìàðà-Èíòåðíåò ïðåäñòàâëÿåò  e-mail: manager@webzavod.ru
designed by Webzavod, 2002