Upgrade to 2.3 gave UTF-8 error
  • I don't quite understand this.  I had a working install of 2.2.1 that was just installed a couple days ago that never gave me any UTF-8 error messages and I had never previously edited the /var/lib/locales/supported.d/local file.  My initial install a couple days ago, which went without any issue, was the automated install...not the easy one...so I had installed postgres and icecast2 myself.  Everything was working great and there were no error messages whatsoever.

    Today I wanted to upgrade to 2.3 and during the apt upgrade process I got this:

    * Checking database for correct encoding
     * Unfortunately your postgresql database has not been created using a UTF-8 encoding.
     * As of Airtime 2.1, installs will fail unless the encoding has been set to UTF-8. Please verify this is the case
     * and try the install again
    There was an error during install. Exit code 1

    So I looked up some previous forum posts on similar messages and did the following:

    - First I looked in /var/lib/locales/supported.d/local and found that en_US.UTF-8 UTF-8 was inside that file
    - I then performed:
    root@stream1-phx:/var/lib/locales/supported.d# dpkg-reconfigure locales
    Generating locales...
      en_AG.UTF-8... up-to-date
      en_AU.UTF-8... up-to-date
      en_BW.UTF-8... up-to-date
      en_CA.UTF-8... up-to-date
      en_DK.UTF-8... up-to-date
      en_GB.UTF-8... up-to-date
      en_HK.UTF-8... up-to-date
      en_IE.UTF-8... up-to-date
      en_IN.UTF-8... up-to-date
      en_NG.UTF-8... up-to-date
      en_NZ.UTF-8... up-to-date
      en_PH.UTF-8... up-to-date
      en_SG.UTF-8... up-to-date
      en_US.UTF-8... up-to-date
      en_ZA.UTF-8... up-to-date
      en_ZM.UTF-8... up-to-date
      en_ZW.UTF-8... up-to-date
    Generation complete.

    And as you can see that completed successfully.  I ran the update again and all completed successfully.  So my question is why?  Was the dpkg-reconfigure locales a step I was supposed to do in the first install earlier this week?  Why did I not have any previous failures until I decided to upgrade from 2.2.1 to 2.3?  Just making sure I didn't miss anything or mess up anything else.

    Here is a pastebin of the entire process.  Hopefully someone can shed some light and possibly ease my mind whether or not I missed some steps in the initial install that caused this.  Thanks!


    Nathan
    Post edited by Nathan Miller at 2013-02-12 18:24:23
  • 7 Comments sorted by
  • Hmmmm...I thought someone would have a thought here :)

    I'm just confused why I had to run 'dpkg-reconfigure locales' on an upgrade from 2.2.1 to 2.3 but the initial clean install of 2.2.1 just a few days earlier went fine and worked great without it.
  • Hi Nathan,

    It's strange that 2.2 worked but this did not. Although I'm confused when you mention that you installed the database yourself???

    When install runs, it runs the following command to check encoding:

    sudo -u postgres psql -t -c "SHOW SERVER_ENCODING" postgres

    If this returns UTF8, then your install should be OK :).
    Airtime Pro Hosting: http://airtime.pro
  • Martin,

    Thank you for the response!  So when I say I installed the database myself I meant I followed the instructions in the manual under 'Automated Installation' in which one of the few preparation steps before installing airtime is 'sudo apt-get install postgresql' and 'sudo apt-get install icecast2'.  Sorry if I didn't make that clear.

    It is very strange to me, but I'm not really a database person.  Logic, at least to me, would lead me to believe that if it would work on the install of 2.2.1 without issue it should be the same on the upgrade to 2.3 unless 2.3 had some new requirements or dependency checks.  This also made me wonder if this came about during the postgres update which also took place when I upgraded airtime as shown here:

    The following packages will be upgraded:
      airtime libpq5 postgresql-9.1 postgresql-client-9.1

    So maybe there is a relation and the new version of postgresql did some check not previously done?  I ran the command you stated above and this is what my instance sent back:

    root@stream1-phx:~# su - postgres
    postgres@stream1-phx:~$ psql -t -c "SHOW SERVER_ENCODING" postgres
     UTF8

    So that looks good but that is still after me running dpkg-reconfigure locales which fixed the issue.  This is running on KVM and I have a snapshot before I did the upgrade.  If you'd like I can do some more troubleshooting.  I'm interested because I like to figure things out but, like I mentioned earlier, I'm not a DB guy so my troubleshooting skills in this space would need to be supplemented by someone like yourself.  Let me know any commands or checks you'd like me to run from a previous working 2.2.1 snapshot before the upgrade.

    Thanks again for your assistance!
    Post edited by Nathan Miller at 2013-02-15 14:13:08
  • Martin,

    Not to bother again but I was wondering if you had any input regardless my response to you?  If not, that is fine, I won't keep posting in this same thread.  I just thought everyone could benefit from this.  Thanks!
  • I actually have no idea why that happened. If it happens again, I may take a look into it, but at the moment its much lower priority compared to a lot of other stuff. Of course if you find out why this happened, I would love to hear about it :)
    Airtime Pro Hosting: http://airtime.pro
  • Sounds good Martin.  If you've got no immediate ideas then I imagine it may be a freak thing.  Thanks again for taking the time to respond.
  • I solved this problem with the following command:

    export LANG="en_US.UTF-8"

    And only after I updated the Postgre!

    Apparently there is a no problem of Airtime, but the Postgree!
    Post edited by Augusto N. Vasconcelos at 2013-04-10 14:10:39