Thanks @dave for the detective work. It has got me further. It no longer moans about sqlite however environment variable at the start I had to set to be the same format as in the config as it gave the following error:
connection to "tryton" failed
Traceback (most recent call last):
File "/home/eamonn/.local/share/virtualenvs/tryton-dhcBaQGN/lib/python3.8/site-packages/trytond/backend/postgresql/database.py", line 174, in __new__
inst._connpool = ThreadedConnectionPool(
File "/home/eamonn/.local/share/virtualenvs/tryton-dhcBaQGN/lib/python3.8/site-packages/psycopg2/pool.py", line 161, in __init__
AbstractConnectionPool.__init__(
File "/home/eamonn/.local/share/virtualenvs/tryton-dhcBaQGN/lib/python3.8/site-packages/psycopg2/pool.py", line 59, in __init__
self._connect()
File "/home/eamonn/.local/share/virtualenvs/tryton-dhcBaQGN/lib/python3.8/site-packages/psycopg2/pool.py", line 63, in _connect
conn = psycopg2.connect(*self._args, **self._kwargs)
File "/home/eamonn/.local/share/virtualenvs/tryton-dhcBaQGN/lib/python3.8/site-packages/psycopg2/__init__.py", line 127, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError: could not translate host name "tryton" to address: Name or service not known
Traceback (most recent call last):
File "/home/eamonn/.local/share/virtualenvs/tryton-dhcBaQGN/bin/trytond_import_countries", line 8, in <module>
sys.exit(run())
File "/home/eamonn/.local/share/virtualenvs/tryton-dhcBaQGN/lib/python3.8/site-packages/trytond/modules/country/scripts/import_countries.py", line 173, in run
main(args.database, args.config_file)
File "/home/eamonn/.local/share/virtualenvs/tryton-dhcBaQGN/lib/python3.8/site-packages/trytond/modules/country/scripts/import_countries.py", line 149, in main
config.set_trytond(database, config_file=config_file)
File "/home/eamonn/.local/share/virtualenvs/tryton-dhcBaQGN/lib/python3.8/site-packages/proteus/config.py", line 293, in set_trytond
_CONFIG.current = TrytondConfig(database, user, config_file=config_file)
File "/home/eamonn/.local/share/virtualenvs/tryton-dhcBaQGN/lib/python3.8/site-packages/proteus/config.py", line 246, in __init__
self.pool.init()
File "/home/eamonn/.local/share/virtualenvs/tryton-dhcBaQGN/lib/python3.8/site-packages/trytond/pool.py", line 161, in init
restart = not load_modules(self.database_name, self, update=update,
File "/home/eamonn/.local/share/virtualenvs/tryton-dhcBaQGN/lib/python3.8/site-packages/trytond/modules/__init__.py", line 426, in load_modules
with Transaction().start(database_name, 0):
File "/home/eamonn/.local/share/virtualenvs/tryton-dhcBaQGN/lib/python3.8/site-packages/trytond/transaction.py", line 107, in start
database = backend.Database(database_name).connect()
File "/home/eamonn/.local/share/virtualenvs/tryton-dhcBaQGN/lib/python3.8/site-packages/trytond/backend/postgresql/database.py", line 174, in __new__
inst._connpool = ThreadedConnectionPool(
File "/home/eamonn/.local/share/virtualenvs/tryton-dhcBaQGN/lib/python3.8/site-packages/psycopg2/pool.py", line 161, in __init__
AbstractConnectionPool.__init__(
File "/home/eamonn/.local/share/virtualenvs/tryton-dhcBaQGN/lib/python3.8/site-packages/psycopg2/pool.py", line 59, in __init__
self._connect()
File "/home/eamonn/.local/share/virtualenvs/tryton-dhcBaQGN/lib/python3.8/site-packages/psycopg2/pool.py", line 63, in _connect
conn = psycopg2.connect(*self._args, **self._kwargs)
File "/home/eamonn/.local/share/virtualenvs/tryton-dhcBaQGN/lib/python3.8/site-packages/psycopg2/__init__.py", line 127, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError: could not translate host name "tryton" to address: Name or service not known
So I changed to this:
$ TRYTOND_DATABASE_URI='postgresql://tryton:tryton@localhost:5432/' trytond_import_countries -d 'postgresql://tryton:5432/tryton'
however it seems I made an error initially on install as I set the language in the config to en_GB but judging by the error below that’s not a valid translation:
Update countries
Traceback (most recent call last):
File "/home/eamonn/.local/share/virtualenvs/tryton-dhcBaQGN/bin/trytond_import_countries", line 8, in <module>
sys.exit(run())
File "/home/eamonn/.local/share/virtualenvs/tryton-dhcBaQGN/lib/python3.8/site-packages/trytond/modules/country/scripts/import_countries.py", line 173, in run
main(args.database, args.config_file)
File "/home/eamonn/.local/share/virtualenvs/tryton-dhcBaQGN/lib/python3.8/site-packages/trytond/modules/country/scripts/import_countries.py", line 151, in main
do_import()
File "/home/eamonn/.local/share/virtualenvs/tryton-dhcBaQGN/lib/python3.8/site-packages/trytond/modules/country/scripts/import_countries.py", line 156, in do_import
countries = update_countries(countries)
File "/home/eamonn/.local/share/virtualenvs/tryton-dhcBaQGN/lib/python3.8/site-packages/trytond/modules/country/scripts/import_countries.py", line 60, in update_countries
Country.save(records)
File "/home/eamonn/.local/share/virtualenvs/tryton-dhcBaQGN/lib/python3.8/site-packages/proteus/__init__.py", line 104, in newfunc
return self.func(owner, *args, **kwargs)
File "/home/eamonn/.local/share/virtualenvs/tryton-dhcBaQGN/lib/python3.8/site-packages/proteus/__init__.py", line 847, in save
ids = proxy.create(values, context)
File "/home/eamonn/.local/share/virtualenvs/tryton-dhcBaQGN/lib/python3.8/site-packages/proteus/config.py", line 188, in __call__
result = rpc.result(meth(*args, **kwargs))
File "/home/eamonn/.local/share/virtualenvs/tryton-dhcBaQGN/lib/python3.8/site-packages/trytond/modules/country/country.py", line 70, in create
return super(Country, cls).create(vlist)
File "/home/eamonn/.local/share/virtualenvs/tryton-dhcBaQGN/lib/python3.8/site-packages/trytond/model/modelsql.py", line 159, in wrapper
return func(cls, *args, **kwargs)
File "/home/eamonn/.local/share/virtualenvs/tryton-dhcBaQGN/lib/python3.8/site-packages/trytond/model/modelsql.py", line 658, in create
Translation.set_ids(name, 'model', Transaction().language,
File "/home/eamonn/.local/share/virtualenvs/tryton-dhcBaQGN/lib/python3.8/site-packages/trytond/ir/translation.py", line 494, in set_ids
cls.save(to_save)
File "/home/eamonn/.local/share/virtualenvs/tryton-dhcBaQGN/lib/python3.8/site-packages/trytond/model/descriptors.py", line 33, in newfunc
return self.func(owner, *args, **kwargs)
File "/home/eamonn/.local/share/virtualenvs/tryton-dhcBaQGN/lib/python3.8/site-packages/trytond/model/modelstorage.py", line 1705, in save
news = cls.create([save_values[r] for r in to_create])
File "/home/eamonn/.local/share/virtualenvs/tryton-dhcBaQGN/lib/python3.8/site-packages/trytond/ir/translation.py", line 613, in create
return super(Translation, cls).create(vlist)
File "/home/eamonn/.local/share/virtualenvs/tryton-dhcBaQGN/lib/python3.8/site-packages/trytond/model/modelsql.py", line 159, in wrapper
return func(cls, *args, **kwargs)
File "/home/eamonn/.local/share/virtualenvs/tryton-dhcBaQGN/lib/python3.8/site-packages/trytond/model/modelsql.py", line 674, in create
cls._validate(sub_records)
File "/home/eamonn/.local/share/virtualenvs/tryton-dhcBaQGN/lib/python3.8/site-packages/trytond/model/modelstorage.py", line 76, in wrapper
return func(*args, **kwargs)
File "/home/eamonn/.local/share/virtualenvs/tryton-dhcBaQGN/lib/python3.8/site-packages/trytond/model/modelstorage.py", line 1293, in _validate
raise SelectionValidationError(gettext(
trytond.model.modelstorage.SelectionValidationError: The value "en_GB" for field "Language" in "Translation" is not one of the allowed options. -
So I tried stopping trytond, updating the config to en_US, restarting the server and running again but the same error so my guess is that en_GB has now been stored somewhere. Any ideas how to get round that now or easier just blow the virtualenv away and start again.
Thanks
Eamonn