trying to get OTRS 3 up with Postgres: bin/otrs.CheckDB.pl fails: permission denied for relation valid, SQL: 'SELECT * FROM valid'

otrs.CheckDB.pl fails, it says permission denied for table "valid" - the table is there though. # /opt/otrs/bin/otrs.CheckDB.pl Trying to connect to database DSN: DBI:Pg:dbname=otrs;host=localhost; DatabaseUser: otrs DBD::Pg::st execute failed: ERROR: permission denied for relation valid at /opt/otrs/Kernel/System/DB.pm line 553. ERROR: OTRS-otrs.CheckDB.pl-10 Perl: 5.8.8 OS: linux Time: Tue Mar 29 17:23:42 2011 Message: ERROR: permission denied for relation valid, SQL: 'SELECT * FROM valid' Traceback (10727): Module: /opt/otrs/bin/otrs.CheckDB.pl (v1.4) Line: 71 DBD::Pg::st fetchrow_array failed: no statement executing at /opt/otrs/Kernel/System/DB.pm line 616. No initial inserts found! # psql -U otrs otrs psql (8.4.4) Type "help" for help.
\d valid Table "public.valid" Column | Type | Modifiers -------------+--------------------------------+---------------------------------------------------- id | integer | not null default nextval('valid_id_seq'::regclass) name | character varying(200) | not null create_time | timestamp(0) without time zone | not null create_by | integer | not null change_time | timestamp(0) without time zone | not null change_by | integer | not null Indexes: "valid_pkey" PRIMARY KEY, btree (id) "valid_name" UNIQUE, btree (name) Foreign-key constraints: "fk_valid_change_by_id" FOREIGN KEY (change_by) REFERENCES users(id) "fk_valid_create_by_id" FOREIGN KEY (create_by) REFERENCES users(id) Referenced by: TABLE "article_sender_type" CONSTRAINT "fk_article_sender_type_valid_id_id" FOREIGN KEY (valid_id) REFERENCES valid(id) TABLE "article_type" CONSTRAINT "fk_article_type_valid_id_id" FOREIGN KEY (valid_id) REFERENCES valid(id) TABLE "article" CONSTRAINT "fk_article_valid_id_id" FOREIGN KEY (valid_id) REFERENCES valid(id) TABLE "auto_response_type" CONSTRAINT "fk_auto_response_type_valid_id_id" FOREIGN KEY (valid_id) REFERENCES valid(id) TABLE "auto_response" CONSTRAINT "fk_auto_response_valid_id_id" FOREIGN KEY (valid_id) REFERENCES valid(id) TABLE "customer_user" CONSTRAINT "fk_customer_user_valid_id_id" FOREIGN KEY (valid_id) REFERENCES valid(id) TABLE "follow_up_possible" CONSTRAINT "fk_follow_up_possible_valid_id_id" FOREIGN KEY (valid_id) REFERENCES valid(id) TABLE "groups" CONSTRAINT "fk_groups_valid_id_id" FOREIGN KEY (valid_id) REFERENCES valid(id) TABLE "link_state" CONSTRAINT "fk_link_state_valid_id_id" FOREIGN KEY (valid_id) REFERENCES valid(id) TABLE "link_type" CONSTRAINT "fk_link_type_valid_id_id" FOREIGN KEY (valid_id) REFERENCES valid(id) TABLE "mail_account" CONSTRAINT "fk_mail_account_valid_id_id" FOREIGN KEY (valid_id) REFERENCES valid(id) TABLE "notification_event" CONSTRAINT "fk_notification_event_valid_id_id" FOREIGN KEY (valid_id) REFERENCES valid(id) TABLE "queue" CONSTRAINT "fk_queue_valid_id_id" FOREIGN KEY (valid_id) REFERENCES valid(id) TABLE "roles" CONSTRAINT "fk_roles_valid_id_id" FOREIGN KEY (valid_id) REFERENCES valid(id) TABLE "salutation" CONSTRAINT "fk_salutation_valid_id_id" FOREIGN KEY (valid_id) REFERENCES valid(id) TABLE "signature" CONSTRAINT "fk_signature_valid_id_id" FOREIGN KEY (valid_id) REFERENCES valid(id) TABLE "standard_attachment" CONSTRAINT "fk_standard_attachment_valid_id_id" FOREIGN KEY (valid_id) REFERENCES valid(id) TABLE "standard_response" CONSTRAINT "fk_standard_response_valid_id_id" FOREIGN KEY (valid_id) REFERENCES valid(id) TABLE "system_address" CONSTRAINT "fk_system_address_valid_id_id" FOREIGN KEY (valid_id) REFERENCES valid(id) TABLE "ticket_history_type" CONSTRAINT "fk_ticket_history_type_valid_id_id" FOREIGN KEY (valid_id) REFERENCES valid(id) TABLE "ticket_history" CONSTRAINT "fk_ticket_history_valid_id_id" FOREIGN KEY (valid_id) REFERENCES valid(id) TABLE "ticket_lock_type" CONSTRAINT "fk_ticket_lock_type_valid_id_id" FOREIGN KEY (valid_id) REFERENCES valid(id) TABLE "ticket_state" CONSTRAINT "fk_ticket_state_valid_id_id" FOREIGN KEY (valid_id) REFERENCES valid(id) TABLE "ticket_type" CONSTRAINT "fk_ticket_type_valid_id_id" FOREIGN KEY (valid_id) REFERENCES valid(id) TABLE "ticket" CONSTRAINT "fk_ticket_valid_id_id" FOREIGN KEY (valid_id) REFERENCES valid(id) TABLE "users" CONSTRAINT "fk_users_valid_id_id" FOREIGN KEY (valid_id) REFERENCES valid(id)
Any suggestions? Aleksey

Message: ERROR: permission denied for relation valid, SQL: 'SELECT * FROM valid' You're heavily invested in postgresql ... your database admin should have been able to resolve this in a heartbeat. Short answer: you don't have select privileges on the table named "valid" so you should grant select on valid to public; http://www.google.com/search?q=permission+denied+for+relation http://www.google.com/search?q=grant+select+on+to+public http://www.google.com/search?q=grant+select+on+to+public On Tue, Mar 29, 2011 at 8:28 PM, Aleksey Tsalolikhin < atsaloli.tech@gmail.com> wrote:
otrs.CheckDB.pl fails, it says permission denied for table "valid" - the table is there though.
# /opt/otrs/bin/otrs.CheckDB.pl Trying to connect to database DSN: DBI:Pg:dbname=otrs;host=localhost; DatabaseUser: otrs
DBD::Pg::st execute failed: ERROR: permission denied for relation valid at /opt/otrs/Kernel/System/DB.pm line 553. ERROR: OTRS-otrs.CheckDB.pl-10 Perl: 5.8.8 OS: linux Time: Tue Mar 29 17:23:42 2011
Message: ERROR: permission denied for relation valid, SQL: 'SELECT * FROM valid'
Traceback (10727): Module: /opt/otrs/bin/otrs.CheckDB.pl (v1.4) Line: 71
DBD::Pg::st fetchrow_array failed: no statement executing at /opt/otrs/Kernel/System/DB.pm line 616. No initial inserts found! # psql -U otrs otrs psql (8.4.4) Type "help" for help.
\d valid Table "public.valid" Column | Type | Modifiers
-------------+--------------------------------+---------------------------------------------------- id | integer | not null default nextval('valid_id_seq'::regclass) name | character varying(200) | not null create_time | timestamp(0) without time zone | not null create_by | integer | not null change_time | timestamp(0) without time zone | not null change_by | integer | not null Indexes: "valid_pkey" PRIMARY KEY, btree (id) "valid_name" UNIQUE, btree (name) Foreign-key constraints: "fk_valid_change_by_id" FOREIGN KEY (change_by) REFERENCES users(id) "fk_valid_create_by_id" FOREIGN KEY (create_by) REFERENCES users(id) Referenced by: TABLE "article_sender_type" CONSTRAINT "fk_article_sender_type_valid_id_id" FOREIGN KEY (valid_id) REFERENCES valid(id) TABLE "article_type" CONSTRAINT "fk_article_type_valid_id_id" FOREIGN KEY (valid_id) REFERENCES valid(id) TABLE "article" CONSTRAINT "fk_article_valid_id_id" FOREIGN KEY (valid_id) REFERENCES valid(id) TABLE "auto_response_type" CONSTRAINT "fk_auto_response_type_valid_id_id" FOREIGN KEY (valid_id) REFERENCES valid(id) TABLE "auto_response" CONSTRAINT "fk_auto_response_valid_id_id" FOREIGN KEY (valid_id) REFERENCES valid(id) TABLE "customer_user" CONSTRAINT "fk_customer_user_valid_id_id" FOREIGN KEY (valid_id) REFERENCES valid(id) TABLE "follow_up_possible" CONSTRAINT "fk_follow_up_possible_valid_id_id" FOREIGN KEY (valid_id) REFERENCES valid(id) TABLE "groups" CONSTRAINT "fk_groups_valid_id_id" FOREIGN KEY (valid_id) REFERENCES valid(id) TABLE "link_state" CONSTRAINT "fk_link_state_valid_id_id" FOREIGN KEY (valid_id) REFERENCES valid(id) TABLE "link_type" CONSTRAINT "fk_link_type_valid_id_id" FOREIGN KEY (valid_id) REFERENCES valid(id) TABLE "mail_account" CONSTRAINT "fk_mail_account_valid_id_id" FOREIGN KEY (valid_id) REFERENCES valid(id) TABLE "notification_event" CONSTRAINT "fk_notification_event_valid_id_id" FOREIGN KEY (valid_id) REFERENCES valid(id) TABLE "queue" CONSTRAINT "fk_queue_valid_id_id" FOREIGN KEY (valid_id) REFERENCES valid(id) TABLE "roles" CONSTRAINT "fk_roles_valid_id_id" FOREIGN KEY (valid_id) REFERENCES valid(id) TABLE "salutation" CONSTRAINT "fk_salutation_valid_id_id" FOREIGN KEY (valid_id) REFERENCES valid(id) TABLE "signature" CONSTRAINT "fk_signature_valid_id_id" FOREIGN KEY (valid_id) REFERENCES valid(id) TABLE "standard_attachment" CONSTRAINT "fk_standard_attachment_valid_id_id" FOREIGN KEY (valid_id) REFERENCES valid(id) TABLE "standard_response" CONSTRAINT "fk_standard_response_valid_id_id" FOREIGN KEY (valid_id) REFERENCES valid(id) TABLE "system_address" CONSTRAINT "fk_system_address_valid_id_id" FOREIGN KEY (valid_id) REFERENCES valid(id) TABLE "ticket_history_type" CONSTRAINT "fk_ticket_history_type_valid_id_id" FOREIGN KEY (valid_id) REFERENCES valid(id) TABLE "ticket_history" CONSTRAINT "fk_ticket_history_valid_id_id" FOREIGN KEY (valid_id) REFERENCES valid(id) TABLE "ticket_lock_type" CONSTRAINT "fk_ticket_lock_type_valid_id_id" FOREIGN KEY (valid_id) REFERENCES valid(id) TABLE "ticket_state" CONSTRAINT "fk_ticket_state_valid_id_id" FOREIGN KEY (valid_id) REFERENCES valid(id) TABLE "ticket_type" CONSTRAINT "fk_ticket_type_valid_id_id" FOREIGN KEY (valid_id) REFERENCES valid(id) TABLE "ticket" CONSTRAINT "fk_ticket_valid_id_id" FOREIGN KEY (valid_id) REFERENCES valid(id) TABLE "users" CONSTRAINT "fk_users_valid_id_id" FOREIGN KEY (valid_id) REFERENCES valid(id)
Any suggestions?
Aleksey --------------------------------------------------------------------- OTRS mailing list: otrs - Webpage: http://otrs.org/ Archive: http://lists.otrs.org/pipermail/otrs To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/otrs

On Tue, Mar 29, 2011 at 7:44 PM, Gerald Young
Message: ERROR: permission denied for relation valid, SQL: 'SELECT * FROM valid'
... you don't have select privileges on the table named "valid" so you should grant select on valid to public;
Thanks, Gerald, that did it! Perhaps this should be added to the README.database file in the otrs source tarball. I've opened bug 7144 about it. http://bugs.otrs.org/show_bug.cgi?id=7144 Cheers, Aleksey

Wow, Gerald, Aleksey, I really don't think this is a great idea.
The otrs.CheckDB.pl script just connects to your database, tries to do
a select statement on the OTRS table called 'valid' and if that works,
assumes there is a connection.
What happened in this case is that the authentication is not correctly
set up; and you 'fixed' it my giving EVERYONE select permission on the
table.
And if you only loosen the permissions on the 'valid' table of course
you immediately have permission issues on ALL the other tables the
moment you start using OTRS from the web front end.
This is really not the correct way to fix it, you should really fix it
by loosening up permissions on the database until it works (and
especially not by granting permissions to ALL) but by correctly
defining access credentials in Kernel/Config.pm
If you simply set the database to allow authentication using
username/password (and remember, that's NOT the default on most linux
distributions) and you create the database as stated in OTRS's
README.Database then you get a working set up.
If you don't really know PostgreSQL you might better opt for deploying
on MySQL which is simply the easiest because creating the databases
and so can be done from the web based installer. We still plan to add
support for multiple databases to the web based installer, and it has
been on our list to implement it for the 3.0 release, but it did not
make it because of time constraints... maybe for 3.1. Or of course if
someone would donate some code, we'd appreciate it!
--
Mike
On Wed, Mar 30, 2011 at 9:33 PM, Aleksey Tsalolikhin
On Tue, Mar 29, 2011 at 7:44 PM, Gerald Young
wrote: Message: ERROR: permission denied for relation valid, SQL: 'SELECT * FROM valid'
... you don't have select privileges on the table named "valid" so you should grant select on valid to public;
Thanks, Gerald, that did it!
Perhaps this should be added to the README.database file in the otrs source tarball. I've opened bug 7144 about it. http://bugs.otrs.org/show_bug.cgi?id=7144
Cheers, Aleksey --------------------------------------------------------------------- OTRS mailing list: otrs - Webpage: http://otrs.org/ Archive: http://lists.otrs.org/pipermail/otrs To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/otrs
participants (3)
-
Aleksey Tsalolikhin
-
Gerald Young
-
Michiel Beijen