Error message while starting : Failed to start Secure Distributed Web Date.

Thank you for your help and your quick answer.

Indeed I’m using Whonix 13.0.01.4

Please find below the requested file :

DEFAULT_LANG = 'en'

class _translations():
    def __init__(self, path, section):
        try:
            # credits to nrgaway.
            language = DEFAULT_LANG
            language = locale.getdefaultlocale()[0].split('_')[0]
            if language:
                language = language
            self.translations = path
            stream = file(self.translations, 'r')
            data = yaml.load(stream)
            if data:
                self.section = data[section]
                self.language = self.section.get(language, DEFAULT_LANG)

        except (IOError):
            # TODO: add code here.
            pass
        except (yaml.scanner.ScannerError, yaml.parser.ParserError):
            pass

    def gettext(self, key):
        return self.language.get(key, None)

Edit : I hope it is readable as I don’t know how to post otherwise here on the forum. Please do not hesitate to let me know if you need me to upload the file somewhere.
Edit 2 : @Patrick : thank you for editing my post. Now I know how to post :wink:

So it looks like you have an older version. You can wait fot Whonix 14, or try to replace the code in translations.py in the temptates (whonix-gw and whonix-ws) with

#!/usr/bin/python

import sys
import locale, yaml

DEFAULT_LANG = 'en'

class _translations():
   def yaml_get(self):
      with open(self.path) as stream:
         data = yaml.safe_load(stream)
         self.xxx = data[self.section]
         self.result = self.xxx.get(self.language, DEFAULT_LANG)

   def gettext(self, key):
      if self.result == None:
         self.yaml_get()
      try:
         text = self.result.get(key, None)
      except:
         print('ERROR: No translation for language "{}", key "{}".'.format(self.language, key))
         self.language = DEFAULT_LANG
         self.yaml_get()
         text = self.result.get(key, None)
      return(text)

   def __init__(self, path, section):
      # credits to nrgaway.
      self.path = path
      self.section = section
      self.language = DEFAULT_LANG
      self.result = None
      try:
         if locale.getdefaultlocale()[0] != None:
            self.language = locale.getdefaultlocale()[0].split('_')[0]
      except:
         self.language = DEFAULT_LANG
         print('ERROR: locale.getdefaultlocale failed. Using "{}" as default'.format(self.language))

Can you please report if it fixes the problem, or not.
.

troubadour:

@Patrick
As at the moment I have no Whonix 13 available. I cannot not know if the issue corrected in ⚓ T625 python-guimessages guimessage.py breaks on default locales settings LANG=POSIX LANG=C was installed in Whonix 13.

LANG=C works in Whonix 14 as well. A good test case btw.

In the meantime, a very similar error (when running a setup script as user) in guimessage.py instead of translations.py is fixed.

fix attribute error in guimessage.py · troubadoour/python-guimessages@ff30733 · GitHub

Thanks, merged!

@troubadour : I edited the file as requested in your answer and no error message appears anymore on the whonix-gw. Unfortunately the message still apears on whonix-ws. Is that possible ?

By the way, should I upgrade my system to the latest version of Whonix ? If yes, is it possible to do that without having to reinstall everything ? I mean, is it or will it be possible to upgrade sooner or later ?

Thank you for your answer + support & best rerards.

No, it should work in both. Perhaps you should double check the script in whonix-ws. Are you running Whonix under VirtualBox, KVM or Qubes?

For a relatively easy upgrade, it would be better to wait until Whonix 14 is officially released. If you feel brave, you can upgrade manually, following these instructions.

They are quite comprehensive.

2 Likes

I’m running Whonix on VM VirtualBox. Editing the files correctly and double checking them fixed te problem !!! :kissing_heart:

Thank you for the link, I’ll follow the instructions when the official version will be released.

I’m so grateful to find some help here :grinning:

Again, thank you for your time @0brand @Patrick @troubadour !

1 Like