There was an error creating the database - Fresh install

From @DarkBlaez on Tue Sep 26 2017 15:22:50 GMT+0000 (UTC)

At first I thought perhaps this was an error brought about by a previous host installed with other software. But after trying to run ./install -fiap on fresh Ubuntu 14.04 a number of times and each time a fresh OS on a VM, this error seems to be prevalent , reproduces each time.

During the install there appears to be no errors, a few warnings but nothing that would cause this error.

Upon hitting the URL for the first time, the usual screen for the database setup is presented. Taking all of the defaults results in the error “There was an error creating the database”

This is reproducible every time from a fresh install of Ubuntu 14.04. What is the work around? I think others have seen this issue before as well and thought it would have been resolved by now since anyone with access to cheap VMs for testing can easily create a fresh instance and test the installer

I saw another post where it was suggested to init the DB but here’s the result after su postgres to become the user

psql -d postgres -tAc "CREATE USER airtime WITH ENCRYPTED PASSWORD ‘airtime’; ALTER USER airtime CREATEDB;"
ERROR: role “airtime” already exists

So it appears some of the initial setup is indeed OK

The real issue is the database needs to be UTF8 and should be set in the install script or flagged

DB

Copied from original issue: https://github.com/LibreTime/libretime/issues/306

From @Robbt on Tue Sep 26 2017 15:48:29 GMT+0000 (UTC)

Most of our testing has been done with VirtualBox on local VM’s. What set-up were you using ? We have seen some issues with certain VPS providers that I’m not sure were completely resolved.

When testing it I haven’t ran into this issue. Please share more specifics about your set-up so we can replicate and resolve this issue. Thanks.

From @DarkBlaez on Tue Sep 26 2017 16:24:24 GMT+0000 (UTC)

Looks like when the install script sets the locale this may not be taking pace. This happens on Digital Ocean, Vultr VPS providers.

What I had to do was:

  1. Fresh install Ubuntu 14.04
  2. set LANG=en_US.UTF-8 and LC_ALL=en_US.UTF-8 in /etc/default/locale
  3. also set the same in /etc/environment
  4. sudo locale-gen “en_US.UTF-8”
  5. sudo dpkg-reconfigure locales
  6. reboot

After that and checking locales everything looked good to perform the install. At this point the install completed and everything went without error. So we are good here. Just note that the install is not setting the locale for some reason even though I can see it setting things up as the script runs

DB

From @Robbt on Thu Sep 28 2017 00:42:02 GMT+0000 (UTC)

Odd, if you want to try to fix the script to get it to do this automatically feel free to contribute a PR. Otherwise we can leave this open and see if someone with access to digital ocean or Vultr can replicate and resolve in the script.

From @hairmare on Fri Sep 29 2017 19:18:00 GMT+0000 (UTC)

I did some successful digital ocean tests on dply.co a while ago: https://github.com/LibreTime/libretime/issues/209#issuecomment-304448396.

Recommending users to actively set up their locale is probably sensible for most cases. This info should probaby go into the cloud setup up docs that we should add to the manual.