[SOLVED]Unable to check update due to a system error: time data 'Mo 20 Jun 2016' does not match format '%a %d %b %Y'

Small update/consideration:

If we update run_command from system/osi adding LANG=en_us.UTF-8 before command we grant having all en_us outputs (1 solved), but this doesn’t solve floats decimal separator issue

Hi guys, maybe we’ve got it :grinning:

My current locale (IT):

LANG=it_IT.UTF-8
LC_CTYPE="it_IT.UTF-8"
LC_NUMERIC="it_IT.UTF-8"
LC_TIME="it_IT.UTF-8"
LC_COLLATE="it_IT.UTF-8"
LC_MONETARY="it_IT.UTF-8"
LC_MESSAGES="it_IT.UTF-8"
LC_PAPER="it_IT.UTF-8"
LC_NAME="it_IT.UTF-8"
LC_ADDRESS="it_IT.UTF-8"
LC_TELEPHONE="it_IT.UTF-8"
LC_MEASUREMENT="it_IT.UTF-8"
LC_IDENTIFICATION="it_IT.UTF-8"
LC_ALL=

So every command running under Rockstor should have same issues by @Uwe_Ganswig, but we pass /system/osy.py run_command “fake environment” settings:

def run_command(cmd, shell=False, stdout=subprocess.PIPE,
                stderr=subprocess.PIPE, stdin=subprocess.PIPE, throw=True,
                log=False, input=None):
    try:
        fake_env = dict(os.environ)
        fake_env['LANG'] = 'en_US.UTF-8'
        cmd = map(str, cmd)
        p = subprocess.Popen(cmd, shell=shell, stdout=stdout, stderr=stderr,
                             stdin=stdin, env=fake_env)

and here my Rockstor run_command(s) in english (don’t care about error, Rockstor development environment misses rockstor package, that’s ok) :smiley:

[root@rockstone ~]# tail /opt/build/var/log/rockstor.log
[19/Oct/2016 11:47:12] ERROR [storageadmin.util:33] Error running a command. cmd = ['/usr/bin/rpm', '-qi', 'rockstor']. rc = 1. stdout = ['package rockstor is not installed', '']. stderr = ['']
Traceback (most recent call last):
  File "/opt/build/src/rockstor/storageadmin/util.py", line 31, in <module>
    version, date = rpm_build_info('rockstor')
  File "/opt/build/src/rockstor/system/pkg_mgmt.py", line 92, in rpm_build_info
    o, e, rc = run_command([RPM, '-qi', pkg])
  File "/opt/build/src/rockstor/system/osi.py", line 104, in run_command
    raise CommandException(cmd, out, err, rc)
CommandException: Error running a command. cmd = ['/usr/bin/rpm', '-qi', 'rockstor']. rc = 1. stdout = ['package rockstor is not installed', '']. stderr = ['']
[19/Oct/2016 11:47:17] DEBUG [storageadmin.views.command:152] Bootstrap operations completed
1 Like

Hi @Uwe_Ganswig & everyone having a different locale (not en_US), can you please test latest PR?

How to test this? Following @phillxnet good guide about patch How to apply a patch to aid in development

From a Rockstor machine system shell run, in this order:

  • yum install patch
  • cp /opt/build/src/rockstor/system/osi.py /root/ ← backup of your osi file
  • curl https://patch-diff.githubusercontent.com/raw/rockstor/rockstor-core/pull/1492.patch > 1479.patch
  • patch -d /opt/rockstor/ -p1 < 1479.patch
  • reboot

Thx
Mirko

After patching a fresh installation the localization errors seem to be solved.