aerobase / omnibus-aerobase-server

Omnibus Aerobase server build extension.
https://aerobase.io
Apache License 2.0
19 stars 9 forks source link

postgresql -- invalid value for parameter "lc_*": "en_US.UTF-8" #22

Open RedFlames opened 4 years ago

RedFlames commented 4 years ago

Hi,

I'm trying to run aerobase on a Debian machine. OS: Debian GNU/Linux 9.11 (stretch)

I installed via

sudo dpkg -i aerobase-iam_2.3.7-1_stretch.deb
sudo dpkg -i aerobase_2.3.7-1_stretch.deb

I then ran sudo aerobase-ctl reconfigure, never changed anything in /etc/aerobase/aerobase.rb, I believe that was created with the machine's hostname by aerobase itself.

Problem:

End of the output:

      - execute the ruby block wait for postgresql service socket

  * execute[/opt/aerobase/bin/aerobase-ctl restart postgresql] action run
    - execute /opt/aerobase/bin/aerobase-ctl restart postgresql
Recipe: <Dynamically Defined Resource>
  * service[cassandra] action nothing (skipped due to action :nothing)
Recipe: aerobase::cassandra_disable
  * runit_service[cassandra] action disable
    * ruby_block[disable cassandra] action run (skipped due to only_if)
     (up to date)
Recipe: aerobase::postgresql_initialize
  * ruby_block[wait for postgresql to start] action run[2019-10-25T14:55:10+02:00] FATAL: Could not connect to database, retrying in 10 seconds.
[2019-10-25T14:55:20+02:00] FATAL: Could not connect to database, retrying in 10 seconds.
[2019-10-25T14:55:30+02:00] FATAL: Could not connect to the postgresql database.
Please check /var/log/aerobase/posgresql/current for more information.

I go into /var/log/aerobase/posgresql/current and see:

2019-10-25_13:10:45.92866 < 2019-10-25 16:10:45.928 IDT > FATAL:  configuration file "/var/opt/aerobase/postgresql/data/postgresql.conf" contains errors
2019-10-25_13:10:46.93505 < 2019-10-25 16:10:46.934 IDT > LOG:  invalid value for parameter "lc_messages": "en_US.UTF-8"
2019-10-25_13:10:46.93509 < 2019-10-25 16:10:46.934 IDT > LOG:  invalid value for parameter "lc_monetary": "en_US.UTF-8"
2019-10-25_13:10:46.93510 < 2019-10-25 16:10:46.934 IDT > LOG:  invalid value for parameter "lc_numeric": "en_US.UTF-8"
2019-10-25_13:10:46.93510 < 2019-10-25 16:10:46.935 IDT > LOG:  invalid value for parameter "lc_time": "en_US.UTF-8"

appearing every second.

I tried editing the offending conf file, but it gets replaced on reconfigure.

Running localectl list-locales gives:

C.UTF-8

It's the only locale I have configured, I don't need any others, really. When I run locale I see that everything is supposed to use the C locale, except 'LANG=' being unset.

I've now run sudo dpkg-reconfigure locales to generate the en_US.UTF-8 locale. I still told it to use "None" as default. cat /etc/default/locale

#LANG=C.UTF-8

I'm running a reconfigure on aerobase again now.

 ================================================================================
    Error executing action `run` on resource 'execute[restart_aerobase-server_log_service]'
    ================================================================================

    Mixlib::ShellOut::ShellCommandFailed
    ------------------------------------
    Expected process to exit with [0], but received '1'
    ---- Begin output of /opt/aerobase/embedded/bin/sv restart /opt/aerobase/sv/aerobase-server/log ----
    STDOUT: timeout: run: /opt/aerobase/sv/aerobase-server/log: (pid 32036) 20s, got TERM
    STDERR:
    ---- End output of /opt/aerobase/embedded/bin/sv restart /opt/aerobase/sv/aerobase-server/log ----
    Ran /opt/aerobase/embedded/bin/sv restart /opt/aerobase/sv/aerobase-server/log returned 1

    Resource Declaration:
    ---------------------
    # In /opt/aerobase/embedded/cookbooks/cache/cookbooks/enterprise/definitions/component_runit_service.rb

     19:   execute "restart_#{component}_log_service" do
     20:     command "#{node['runit']['sv_bin']} restart #{node['runit']['sv_dir']}/#{component}/log"
     21:     action :nothing
     22:   end
     23:

Looks like it's failing somewhere unrelated now at least. I'll try to set it up from scratch again, I suppose.

My main issue I'm trying to report is about running things without the en_US locale present.

have a nice day/weekend/week, ~rf

yanivmn commented 4 years ago

Hi @RedFlames thanks for reporting this issue. Currently we only support en_US.UTF-8 locale.

Two workarounds available:

  1. Add locale to your system, e.g:localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
  2. Shutdown internal postgres and install using debian packages: https://aerobase.io/docs/installation/index.html#connecting-to-postgresql

If you like to contribute, extracting encoding attribute from https://github.com/aerobase/omnibus-aerobase-server/blob/master/files/aerobase-cookbooks/aerobase/recipes/postgresql.rb to https://github.com/aerobase/omnibus-aerobase-server/blob/master/files/aerobase-cookbooks/aerobase/attributes/default.rb should fix this issue.