View Issue Details

IDProjectCategoryView StatusLast Update
0006629Talerbank (demonstrator)public2020-11-02 18:09
ReporterChristian Grothoff Assigned ToMS  
PriorityimmediateSeverityblockReproducibilityalways
Status resolvedResolutionfixed 
Platformi7OSDebian GNU/LinuxOS Versionsqueeze
Product Versiongit (master) 
Target Version0.8.1 
Summary0006629: make install fails
DescriptionRunning 'make install' for the python bank on a fresh system (!) fails:

$ make install
python3 manage.py compilemessages
Traceback (most recent call last):
  File "manage.py", line 19, in <module>
    main()
  File "manage.py", line 16, in main
    execute_from_command_line(sys.argv)
  File "/home/grothoff/.local/lib/python3.8/site-packages/django/core/management/__init__.py", line 401, in execute_from_command_line
    utility.execute()
  File "/home/grothoff/.local/lib/python3.8/site-packages/django/core/management/__init__.py", line 345, in execute
    settings.INSTALLED_APPS
  File "/home/grothoff/.local/lib/python3.8/site-packages/django/conf/__init__.py", line 83, in __getattr__
    self._setup(name)
  File "/home/grothoff/.local/lib/python3.8/site-packages/django/conf/__init__.py", line 70, in _setup
    self._wrapped = Settings(settings_module)
  File "/home/grothoff/.local/lib/python3.8/site-packages/django/conf/__init__.py", line 177, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/grothoff/taler/bank/talerbank/settings.py", line 104, in <module>
    DBNAME = TC.value_string("bank", "database", required=True)
  File "/home/grothoff/.local/lib/python3.8/site-packages/taler/util/talerconfig.py", line 391, in value_string
    return self.sections[section][option].value_string(
  File "/home/grothoff/.local/lib/python3.8/site-packages/taler/util/talerconfig.py", line 173, in value_string
    raise ConfigurationError(
taler.util.talerconfig.ConfigurationError: Missing required option 'DATABASE' in section 'BANK'
make: *** [Makefile:27: i18n] Error 1
TagsNo tags attached.

Activities

Christian Grothoff

2020-10-29 00:05

manager   ~0017049

The fundamental problem is that the 'bank.conf' is not installed. Running:

$ cp bank.conf ~/share/taler/config.d/

fixes the issue. However, simply adding

$ mkdir -p ~/share/taler/config.d/
$ cp bank.conf ~/share/taler/config.d/

to the Makefile MAY not be a clean fix, as the $TALER_PREFIX may be different (or not even set).
I'm not sure how we want the 'bank.conf' to be ideally installed. Also, I wonder why the 'make install'
needs to fail so hard without it.

Please discuss how to best fix before fixing...

Christian Grothoff

2020-10-29 00:15

manager   ~0017050

Oh, and I also have to set TALER_PREFIX for the above to work. Would be nice if we had a sane default there, like taler-config does...

MS

2020-10-29 16:24

manager   ~0017061

Last edited: 2020-10-29 16:25

View 2 revisions

It fails because "settings.py" gets executed always and before everything
(in this case before the "compilemessages" step).
This one then needs to tell Django the DB type / name / other values that we
chose to specify in the config file.

MS

2020-10-29 16:31

manager   ~0017062

A reasonable fix that doesn't require copying files around is to *try* loading the config file,
and if that's not found, then use some default values (possibly hard-coded).

Christian Grothoff

2020-10-29 21:38

manager   ~0017064

Actually, the bank.conf MUST be ultimately installed, so really one fix would be to do that. However, with the python-build system how to make sure it ends up where "everyone" (including the C code!) expects it is unclear to me. Is there a good way to find out the location of the share/taler/config.d/ directory from the Python build system!?!? How does talerutil find the config.d directory properly -- that is unless TALER_PREFIX is specified in the environment?

With respect to "settings.py" -- why on earth would we need to get the DB type to run the compilemessages step? I actually don't see us having a need for ANY configuration at this stage, so here we probably should modify the code to work without grabbing the configuration of the system at "compile time".

MS

2020-10-30 11:29

manager   ~0017068

Just found: compilemessages step *can* be run without "settings.py". The problem is that its wrapper script (manage.py) understandably defines DJANGO_SETTINGS_MODULE env variable before launching any sub-command (including compilemessages). So possibly we can solve this by simply
avoiding the definition of such env variable.

MS

2020-11-02 18:09

manager   ~0017084

Addressed here: d98a333e8038731d55987ea3470dbbe56e864cfe.

We basically "hide" settings.py from the "compilemessages" step.

Issue History

Date Modified Username Field Change
2020-10-29 00:03 Christian Grothoff New Issue
2020-10-29 00:03 Christian Grothoff Status new => assigned
2020-10-29 00:03 Christian Grothoff Assigned To => MS
2020-10-29 00:05 Christian Grothoff Note Added: 0017049
2020-10-29 00:15 Christian Grothoff Note Added: 0017050
2020-10-29 16:24 MS Note Added: 0017061
2020-10-29 16:25 MS Note Edited: 0017061 View Revisions
2020-10-29 16:31 MS Note Added: 0017062
2020-10-29 21:38 Christian Grothoff Note Added: 0017064
2020-10-30 11:29 MS Note Added: 0017068
2020-10-31 10:32 Christian Grothoff Target Version 0.8 => 0.8.1
2020-11-02 18:09 MS Note Added: 0017084
2020-11-02 18:09 MS Status assigned => resolved
2020-11-02 18:09 MS Resolution open => fixed