Forum OpenACS Q&A: Re: New OpenACS Tutorial

Collapse
49: Re: New OpenACS Tutorial (response to 48)
Posted by Gustaf Neumann on
Dear Christopher,

this error message comes from PostgreSQL and tells you that the database does not know about a user "wwww-data". When you installed OpenACS with the default values of the install-ns and install-oacs scripts, then the created postgres user is named "nsadmin", the database is "oacs-5-8".

In this setup, sudo psql -d oacs-5-8 -U nsadmin should work.

Collapse
50: Re: New OpenACS Tutorial (response to 49)
Posted by christopher laurence on
Hello Gustaf,

I was able to get the command to work if I used "psql -d oacs-5-8 -U postgres" When I use sudo is asks for a password and it isn't the root password. After using the command I tried using insert into but got an error message. I have created a file in my package/todo/sql/postgres/ based on the tutorial.

oacs-5-8=# insert into todo_item values(acs_object_id_seq.nextval, 'My first item', 'My first item description', 'p', 568);
ERROR: relation "todo_item" does not exist
LINE 1: insert into todo_item values(acs_object_id_seq.nextval, 'My ...
^

Collapse
51: Re: New OpenACS Tutorial (response to 50)
Posted by Benjamin Brink on
Christopher, see page 48 (and just prior) of the tutorial. The error translates to: table "todo_item" doesn't exist.
cheers
Collapse
52: Re: New OpenACS Tutorial (response to 50)
Posted by Gustaf Neumann on
Christopher,

when the install-oacs script runs successfully, it creates the user 'nsadmin'; otherwise, other things might be broken as well. To check, which users are defined in your postgres installations, use

   %psql -U postgres 
   psql (9.3.5)
   Type "help" for help.

   postgres=# \du
in order to see, what databases are defined, use
   postgres=# \l
Collapse
53: Re: New OpenACS Tutorial (response to 52)
Posted by christopher laurence on
Hello Gustaf,

This is what I got when I enter the commands:

postgres=# \du
List of roles
Role name | Attributes | Member of
-----------+------------------------------------------------+-----------
nsadmin | Superuser, Create role, Create DB | {}
postgres | Superuser, Create role, Create DB, Replication | {}

postgres=# \l
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
-----------+----------+----------+-------------+-------------+-----------------------
oacs-5-8 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
postgres | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres + postgres=CTc/postgres
template1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres + postgres=CTc/postgres
(4 rows)

Collapse
54: Re: New OpenACS Tutorial (response to 53)
Posted by Gustaf Neumann on
Christopher,

This looks correct. Therefore, the cmd as i wrote will work. maybe you were struggling with sudo. For setup of sudo, see e.g. [1]. One can setup sudo such it asks you once in a session for your password, or to ask for certain users never for a password, etc.

[1] https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux_OpenStack_Platform/2/html/Getting_Started_Guide/ch02s03.html

Collapse
55: Re: New OpenACS Tutorial (response to 54)
Posted by christopher laurence on
Hello Gustaf,

I'm using ubuntu 14.04 LT now. Is there any location where I can find the final version of the tutorial code? I have copied all the code but continue to get error messages.

Collapse
56: Re: New OpenACS Tutorial (response to 55)
Posted by Gustaf Neumann on
Dear Christopher,

i've never read the tutorial, this was contributed from the people in Guatemala. What kind of errors do you get?

-g

Collapse
57: Re: New OpenACS Tutorial (response to 56)
Posted by christopher laurence on
Hello Gustaf,

I'm getting errors that the database item doesn't exist. I'm trying to run through the tutorial to see how everything works before giving the system to a developer. I can at least complete the hello World! example.

Database operation "select" failed (exception ERROR, "ERROR: relation "todo_item" does not exist
LINE 8: from todo_item
^
")

ERROR: relation "todo_item" does not exist