April 9, 2019

ValueError Saat Setup MSSQL Server Di Linux

ValueError: unknown locale: UTF-8?

Beberapa hari yang lalu saya sempat menulis step by step install Microsoft SQL Server (MSSQL Server) di environment Linux, namun mungkin saja ada yang menemukan error salah satunya error dengan message ValueError: unknown locale: UTF-8, gak usah takut karena dari masalah itu ataupun lainnya kita dapat pelajaran baru😆

Disuatu waktu saya install MSSQL Server Linux di environment berbeda dari sebelumnya, saya ikuti tuh step by step installasi MSSQL Server yang saya tulis sebelumnya, alhamdulillah dapat rejeki, dapat ValueError: unknown locale: UTF-8 pada saat setup MSSQL Server🤣 Dengan kemampuan sok tau saya😆 langsung disimpulkan maksud dari error message tersebut yaitu Lokal UTF-8 tidak di kenal. Okey berarti tugas saya yaitu bagaimana agar si lokal UTF-8 itu dikenali, dengan kemampuan sok tau auto isi var lokal dengan UTF-8 menggunakan command export LC_ALL=en_US.UTF-8 , setelah itu eksekusi kembali command untuk setup MSSQL Server dan ValueError: unknown locale: UTF-8 telah hilang.

Berikut ini full message ValueError: unknown locale: UTF-8 yang saya dapatkan:

[sibunglon@RizkaWandevi ~]$ sudo /opt/mssql/bin/mssql-conf setup
Error in localization. Using en_US.
Choose an edition of SQL Server:
  1) Evaluation (free, no production use rights, 180-day limit)
  2) Developer (free, no production use rights)
  3) Express (free)
  4) Web (PAID)
  5) Standard (PAID)
  6) Enterprise (PAID)
  7) Enterprise Core (PAID)
  8) I bought a license through a retail sales channel and have a product key to enter.

Details about editions can be found at
https://go.microsoft.com/fwlink/?LinkId=852748

Use of PAID editions of this software requires separate licensing through a
Microsoft Volume Licensing program.
By choosing a PAID edition, you are verifying that you have the appropriate
number of licenses in place to install and run this software.

Enter your edition(1-8): 3
The license terms for this product can be found in
/usr/share/doc/mssql-server or downloaded from:
https://go.microsoft.com/fwlink/?LinkId=855862

The privacy statement can be viewed at:
https://go.microsoft.com/fwlink/?LinkId=853010

Do you accept the license terms? [Yes/No]:yes

Traceback (most recent call last):
  File "/opt/mssql/bin/../lib/mssql-conf/mssql-conf.py", line 279, in <module>
    main()
  File "/opt/mssql/bin/../lib/mssql-conf/mssql-conf.py", line 275, in main
    processCommands()
  File "/opt/mssql/bin/../lib/mssql-conf/mssql-conf.py", line 199, in processCommands
    COMMAND_TABLE[args.which]()
  File "/opt/mssql/bin/../lib/mssql-conf/mssql-conf.py", line 54, in handleSetup
    exit(mssqlconfhelper.setupSqlServer(eulaAccepted, noprompt=args.noprompt))
  File "/opt/mssql/lib/mssql-conf/mssqlconfhelper.py", line 817, in setupSqlServer
    languageSelect(noprompt)
  File "/opt/mssql/lib/mssql-conf/mssqlconfhelper.py", line 160, in languageSelect
    language = locale.getdefaultlocale()[0]
  File "/usr/lib64/python2.7/locale.py", line 511, in getdefaultlocale
    return _parse_localename(localename)
  File "/usr/lib64/python2.7/locale.py", line 443, in _parse_localename
    raise ValueError, 'unknown locale: %s' % localename
ValueError: unknown locale: UTF-8