Forum OpenACS Development: Installing OpenACS on NavServ
In attempt to install OpenACS as per tutorial available at: http://openacs.org/xowiki/naviserver-openacs
I got the following error:
"createdb: database creation failed: ERROR: new encoding (UTF8) is incompatible with the encoding of the template database (SQL_ASCII)"
Meaning that apt-get installed PostgreSQL 9.1 with ASCII as standard encoding. Thus, template and template0 databases were wrongly created such as default.
Then when istallation scripts reach the point when db is created it returns that error.
I already started to write notes how to solve this problem.
Does anyone already have a solution?
Since this looks like a fresh install, probably
apt-get remove postgresql postgresql-contrib postgresql-develshould do this trick. If so, i'll add the LANG setting to the script.
apt-get install postgresql postgresql-contrib postgresql-devel
I wouldn't be so strongly sure about it. We installed postgresql from apt-get. I removed and installed again even.
See version details on this post still.
source.list is bellow:
deb http://archive.ubuntu.com/ubuntu precise main restricted universe
deb http://archive.ubuntu.com/ubuntu precise-updates main restricted universe
deb http://security.ubuntu.com/ubuntu precise-security main restricted universe multiverse
deb http://archive.canonical.com/ubuntu precise partner
See details of OS installation. It isn't that old.
root@newiuri:~# cat /etc/issue
Ubuntu 12.04.4 LTS \n \l
postgres@newiuri:~$ uname -a
Linux newiuri 2.6.32-22-pve #1 SMP Mon Jul 15 08:36:46 CEST 2013 x86_64 x86_64 x86_64 GNU/Linux
Furthermore, after running apt-get again as per your notes I got warnings telling that postgresql-dev wether's missing or obsolete. it also indicates libpq-dev as a replacement. See bellow.
root@newiuri:~# apt-get install postgresql postgresql-contrib postgresql-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package postgresql-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
E: Package 'postgresql-dev' has no installation candidate
I installed it anyway. You can see bellow the default encoding's cuoriously set to ASCII.
postgres@newiuri:~$ /usr/lib/postgresql/9.1/bin/initdb -D /var/lib/postgresql/9.1/main/
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.
The database cluster will be initialized with locale C.
The default database encoding has accordingly been set to SQL_ASCII.
The default text search configuration will be set to "english".
initdb: directory "/var/lib/postgresql/9.1/main" exists but is not empty
If you want to create a new database system, either remove or empty
the directory "/var/lib/postgresql/9.1/main" or run initdb
with an argument other than "/var/lib/postgresql/9.1/main".
Moreover, I ran initdb command using -E argument
/usr/lib/postgresql/9.1/bin/initdb -E UTF8 -D /var/lib/postgresql/9.1/main/
Now, templates were properly encoded. OACS script finished successfuly!
glad, everything works fine now.
As Jim says, this is an error with postgres OR with that Database.
Mostly, this encoding problem doesn't seem to occur me now but, when it occurred to me I solved it manually (with initdb). So you have to check:
- psql -l (to see DB and encoding data)
- If SQL_ASCII , use initdb (re-install or do it manually via console)
But, it doesn't to occur via those install-**.sh scripts . Perhaps there are another postgres instances or old setup